def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 用品
$scene = Scene_Item.new
when 1 # 存檔
$scene = Scene_File.new(true, false, false)
when 2 # 結束遊戲
$scene = Scene_End.new
end
end
end
end[/pre]
[pre lang="ruby" line="1"]class Scene_Menu < Scene_Base
def start
super
create_menu_background
create_command_window
end
def terminate
super
dispose_menu_background
@command_window.dispose
end
def update
super
update_menu_background
@command_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 用品
$scene = Scene_Item.new
when 1 # 存檔
$scene = Scene_File.new(true, false, false)
when 2 # 結束遊戲
$scene = Scene_End.new
end
end
end
end
[/pre]