class Scene_Menu < Scene_Base
def initialize(menu_index = 0)
@menu_index = menu_index
end
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@gold_window.opacity = 0
@status_window = Window_MenuStatus.new(160, 0)
end
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def create_command_window
s1 = Vocab::item
s2 = Vocab::equip
s3 = Vocab::status
s4 = Vocab::save
s5 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
@command_window.index = @menu_index
if $game_system.save_disabled
@command_window.draw_item(3, false)
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
Sound.play_decision
case @command_window.index
when 0
$scene = Scene_Item.new
when 1,
$scene = Scene_Equip.new(0,0)
when 2
$scene = Scene_Status.new(0)
when 3
$scene = Scene_File.new(true, false, false)
when 4
$scene = Scene_End.new
end
end
end
end
Социальные закладки