Professional Documents
Culture Documents
code
# * reload (load screen improvement) by mewsterus
# * to install, just insert this in a descriptive code slot right above main
#===============================================================================
# � window_load
#-------------------------------------------------------------------------------
# edited by mewsterus
#===============================================================================
#===============================================================================
# � window_loadcommand
#-------------------------------------------------------------------------------
# written by mewsterus
#===============================================================================
#===============================================================================
# � scene_load
#-------------------------------------------------------------------------------
# edited by mewsterus
#===============================================================================
class scene_load
#-----------------------------------------------------------------------------
# @ main loop
#-----------------------------------------------------------------------------
def main
@sprite = sprite.new
@sprite.bitmap = rpg::cache.title($data_system.title_name)
@top_window = window_loadcommand.new
@savefile_windows = []
for i in 0..3
@savefile_windows.push(window_load.new(i))
end
@savefile_windows[0].x = 640
@savefile_windows[1].x = -640
@savefile_windows[2].x = 640
@savefile_windows[3].x = -640
graphics.transition
loop do
graphics.update
input.update
if @savefile_windows[0].x > 0
@savefile_windows[0].x -= 64
end
if @savefile_windows[1].x < 0
@savefile_windows[1].x += 64
end
if @savefile_windows[2].x > 0
@savefile_windows[2].x -= 64
end
if @savefile_windows[3].x < 0
@savefile_windows[3].x += 64
end
if @top_window.x < 0
@top_window.x += 64
else
update
end
if $scene != self
break
end
end
unless @scene_title
@sprite.dispose
end
for i in 0..10
@top_window.x += 64
@savefile_windows[0].x -= 64
@savefile_windows[1].x += 64
@savefile_windows[2].x -= 64
@savefile_windows[3].x += 64
graphics.update
end
graphics.freeze
@top_window.dispose
for i in @savefile_windows
i.dispose
end
end
#-----------------------------------------------------------------------------
# @ update the screen
#-----------------------------------------------------------------------------
def update
unless @delete
@top_window.update
end
for i in @savefile_windows
i.update
end
if @top_window.active
update_top
return
end
if @file_active
update_file
return
end
end
#-----------------------------------------------------------------------------
# @ update the top window
#-----------------------------------------------------------------------------
def update_top
if input.trigger?(input::c)
case @top_window.index
when 0
command_new_game
return
when 1
@delete = true
$game_system.se_play($data_system.decision_se)
@top_window.active = false
@file_active = true
@file_index = 0
@savefile_windows[@file_index].selected = true
return
end
end
if input.trigger?(input::b)
$game_system.se_play($data_system.cancel_se)
$scene = scene_title.new
@scene_title = true
return
end
if input.repeat?(input::down)
$game_system.se_play($data_system.cursor_se)
@top_window.active = false
@file_active = true
@file_index = 0
@savefile_windows[@file_index].selected = true
return
end
if input.trigger?(input::up)
$game_system.se_play($data_system.cursor_se)
@top_window.active = false
@file_active = true
@file_index = 3
@savefile_windows[@file_index].selected = true
return
end
end
#-----------------------------------------------------------------------------
# @ update the file windows
#-----------------------------------------------------------------------------
def update_file
if input.trigger?(input::c)
if @delete
if filetest.exist?("save#{@file_index + 1}.rxdata")
$game_system.se_play($data_system.decision_se)
file.delete("save#{@file_index + 1}.rxdata")
@savefile_windows[@file_index].refresh
@delete = false
@savefile_windows[@file_index].selected = false
@file_active = false
@top_window.active = true
else
$game_system.se_play($data_system.buzzer_se)
end
return
end
on_decision("save#{@file_index + 1}.rxdata")
return
end
if input.trigger?(input::b)
$game_system.se_play($data_system.cancel_se)
if @delete
@delete = false
@savefile_windows[@file_index].selected = false
@file_active = false
@top_window.active = true
return
end
$scene = scene_title.new
@scene_title = true
return
end
if input.repeat?(input::down)
unless @file_index < 3 or @delete
if input.trigger?(input::down)
$game_system.se_play($data_system.cursor_se)
@savefile_windows[@file_index].selected = false
@file_active = false
@top_window.active = true
return
end
end
if input.trigger?(input::down) or @file_index < 3
$game_system.se_play($data_system.cursor_se)
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 1) % 4
@savefile_windows[@file_index].selected = true
return
end
end
if input.repeat?(input::up)
unless @file_index > 0 or @delete
$game_system.se_play($data_system.cursor_se)
@savefile_windows[@file_index].selected = false
@file_active = false
@top_window.active = true
return
end
if input.trigger?(input::up) or @file_index > 0
$game_system.se_play($data_system.cursor_se)
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 3) % 4
@savefile_windows[@file_index].selected = true
return
end
end
end
#-----------------------------------------------------------------------------
# @ decision command
#-----------------------------------------------------------------------------
def on_decision(filename)
unless filetest.exist?(filename)
command_new_game
return
end
$game_system.se_play($data_system.load_se)
$game_temp = game_temp.new
file = file.open(filename, "rb")
characters = marshal.load(file)
graphics.frame_count = marshal.load(file)
$game_system = marshal.load(file)
$game_switches = marshal.load(file)
$game_variables = marshal.load(file)
$game_self_switches = marshal.load(file)
$game_screen = marshal.load(file)
$game_actors = marshal.load(file)
$game_party = marshal.load(file)
$game_troop = marshal.load(file)
$game_map = marshal.load(file)
$game_player = marshal.load(file)
if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
file.close
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = scene_map.new
@scene_title = false
end
#--------------------------------------------------------------------------
# @ generate new game
#--------------------------------------------------------------------------
def command_new_game
$game_system.se_play($data_system.decision_se)
audio.bgm_stop
graphics.frame_count = 0
$game_temp = game_temp.new
$game_system = game_system.new
$game_switches = game_switches.new
$game_variables = game_variables.new
$game_self_switches = game_selfswitches.new
$game_screen = game_screen.new
$game_actors = game_actors.new
$game_party = game_party.new
$game_troop = game_troop.new
$game_map = game_map.new
$game_player = game_player.new
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = scene_map.new
@scene_title = false
end
end
screens
para activar caras, a�ada esto a principal justo antes esto define los valores de
fuente:
code
$face_enabled = true
code
# * location window by mewsterus
# * to install, just insert this in a descriptive code slot right above main
# *
# * this replaces the playtime window. replace the class method below to
# * window_steps if you prefer that the step counter window be the one replaced
#===============================================================================
# � window_playtime
#-------------------------------------------------------------------------------
# written by mewsterus; the location window
#===============================================================================
class window_playtime < window_base
#-----------------------------------------------------------------------------
# @ refresh the window
#-----------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "location")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_map.name.delete("*").to_s, 2)
end
end
#===============================================================================
# � game_map
#-------------------------------------------------------------------------------
# written by mewsterus
#===============================================================================
class game_map
#-----------------------------------------------------------------------------
# @ return map name
#-----------------------------------------------------------------------------
def name
$data_map[@map_id]
end
end
#===============================================================================
# � main
#-------------------------------------------------------------------------------
# written by mewsterus
#===============================================================================
begin
$location_enabled = true
$data_map = load_data("data/mapinfos.rxdata")
for key in $data_map.keys
$data_map[key] = $data_map[key].name
end
end
si usted consigue cualquier problema con cualquier l�nea que dice esto:
code
self.contents.font.size = $fontsize
code
$defaultfonttype = $fontface = font.default_name = $fontname = "arial"
$defaultfontsize = $fontsize = font.default_size = 24
esto deber�a resolver todos los problemas.adem�s, si usted quiere que las ventanas
salvar�(ahorrar�) se parezcan a esto en scene_save, encuentre estas l�neas:
code
class window_load
def initialize(file_index)
code
class window_savefile
def initialize(file_index, arg = nil)
busca esto:
code
@savefile_windows.push(window_load.new(i))
code
@savefile_windows.push(window_savefile.new(i))