#=========================================================================
# 【YGE】 SP04 — VX菜单滑动
#-------------------------------------------------------------------------
# By.小y君
#=========================================================================
# ● 使用说明
# 将脚本插入Main之上。
# 另外,此脚本基于默认的菜单。如果是大幅度修改过的菜单以及其他的菜单脚本,
# 可能会出现错误或者无效果,请联系作者定制。
#-------------------------------------------------------------------------
#=========================================================================
# ■ Scene_Equip
#-------------------------------------------------------------------------
# 处理装备画面
#=========================================================================
class Scene_Equip < Scene_Base
#---------------------------------------------------------------------
# ● 开始处理
#---------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@help_window = Window_Help.new
@help_window.y = -80
create_item_windows
@equip_window = Window_Equip.new(208+80, 56, @actor)
@equip_window.help_window = @help_window
@equip_window.index = @equip_index
@status_window = Window_EquipStatus.new(-80, 56, @actor)
end
#---------------------------------------------------------------------
# ● 生成物品窗口
#---------------------------------------------------------------------
def create_item_windows
@item_windows = []
for i in 0...EQUIP_TYPE_MAX
@item_windows[i] = Window_EquipItem.new(0, 208, 544, 208, @actor, i)
@item_windows[i].help_window = @help_window
@item_windows[i].visible = (@equip_index == i)
@item_windows[i].y = 208
@item_windows[i].height = 208
@item_windows[i].active = false
@item_windows[i].index = -1
end
end
#---------------------------------------------------------------------
# ● 更新画面
#---------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
update_equip_window
update_status_window
update_item_windows
if @equip_window.active
update_equip_selection
elsif @item_window.active
update_item_selection
end
if @help_window.y >= 0
else
@help_window.y += 2
end
if @status_window.x >= 0
else
@status_window.x+= 2
end
if @equip_window.x <= 208
else
@equip_window.x -= 2
end
end
end
#=========================================================================
# ■ Scene_Skill
#-------------------------------------------------------------------------
# 处理特技画面的类。
#=========================================================================
class Scene_Skill < Scene_Base
#---------------------------------------------------------------------
# ● 开始处理
#---------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@viewport = Viewport.new(0, 0, 544, 416)
@help_window = Window_Help.new
@help_window.y = -80
@help_window.viewport = @viewport
@status_window = Window_SkillStatus.new(80, 56, @actor)
@status_window.viewport = @viewport
@skill_window = Window_Skill.new(0, 112+80, 544, 304, @actor)
@skill_window.viewport = @viewport
@skill_window.help_window = @help_window
@target_window = Window_MenuStatus.new(0, 0)
hide_target_window
end
#---------------------------------------------------------------------
# ● 更新画面
#---------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
if @skill_window.active
update_skill_selection
elsif @target_window.active
update_target_selection
end
if @skill_window.y <= 112
else
@skill_window.y -= 2
end
if @status_window.x <= 0
else
@status_window.x -= 2
end
if @help_window.y >= 0
else
@help_window.y += 2
end
end
end
#=========================================================================
# ■ Scene_Item
#-------------------------------------------------------------------------
# 处理物品画面的类。
#=========================================================================
class Scene_Item < Scene_Base
#---------------------------------------------------------------------
# ● 开始处理
#---------------------------------------------------------------------
def start
super
create_menu_background
@viewport = Viewport.new(0, 0, 544, 416)
@help_window = Window_Help.new
@help_window.viewport = @viewport
@help_window.y = -80
@item_window = Window_Item.new(0, 56+80, 544, 360)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.active = false
@target_window = Window_MenuStatus.new(0, 0)
hide_target_window
end
#---------------------------------------------------------------------
# ● 更新画面
#---------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
@item_window.update
@target_window.update
if @item_window.active
update_item_selection
elsif @target_window.active
update_target_selection
end
if @item_window.y <= 56
else
@item_window.y -= 2
end
if @help_window.y >= 0
else
@help_window.y += 2
end
end
end
#=========================================================================
# ■ Scene_Menu
#-------------------------------------------------------------------------
# 处理菜单画面的类。
#=========================================================================
class Scene_Menu < Scene_Base
#---------------------------------------------------------------------
# ● 开始处理
#---------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@command_window.x = -80
@gold_window = Window_Gold.new(-80, 360)
@status_window = Window_MenuStatus.new(240, 0)
end
#---------------------------------------------------------------------
# ● 更新画面
#---------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @gold_window.x >= 0
else
@gold_window.x += 2
end
if @command_window.x >= 0
else
@command_window.x += 2
end
if @status_window.x <= 160
else
@status_window.x -= 2
end
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
end