#==============================================================================
# ■ 状态选项的二级菜单(非大众化的定制脚本)
#------------------------------------------------------------------------------
#
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#
# 作者:protosssonny
#
#==============================================================================
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
# 处理菜单画面的类。
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
@status_menu_window = Window_Command.new(160, ["查看状态", "什么什么"])
@status_menu_window.active = false
@status_menu_window.visible = false
end
#--------------------------------------------------------------------------
# ● 结束处理
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
@status_menu_window.dispose
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
@status_menu_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
elsif @status_menu_window.active
status_menu_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,2 # 技能、装备
start_actor_selection
when 3 # 状态
start_status_menu
when 4 # 存档
$scene = Scene_File.new(true, false, false)
when 5 # 结束游戏
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# ● 角色选择结束
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_menu_window.active = false
@status_menu_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# ● 开始状态的二级菜单
#--------------------------------------------------------------------------
def start_status_menu
@command_window.active = false
@status_menu_window.active = true
@status_menu_window.visible = true
end
#--------------------------------------------------------------------------
# ● 结束状态的二级菜单
#--------------------------------------------------------------------------
def end_status_menu
@status_menu_window.active = false
@status_menu_window.visible = false
@command_window.active = true
end
#--------------------------------------------------------------------------
# ● 状态的二级菜单的选择
#--------------------------------------------------------------------------
def status_menu_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_status_menu
elsif Input.trigger?(Input::C)
Sound.play_decision
@status_menu_window.active = false
case @status_menu_window.index
when 0 # 查看状态
start_actor_selection
when 1 # “什么什么”在这里写命令,通常为$scene = 某某.new的形式
p "尚未设定“什么什么”的执行命令"
end
end
end
end