赞 | 5 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 620
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023
|
6楼
楼主 |
发表于 2008-3-6 20:13:15
|
只看该作者
{/pz}抱歉
修改时忘了,
用这个替换掉里面的Scene_Menu
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # menu_index : 菜单命令位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- @cg_number = 5 # CG 背景數量
- end
- #--------------------------------------------------------------------------
- # ● 执行开始
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
-
- @actor_index = 0
- @actor = $game_party.members[@actor_index]
- # 生成金钱窗口
- @gold_window = Window_Gold.new(0, 360)
- # 生成状态窗口
- @status_window = Window_Status.new(@actor)
- # 生成时间窗口
- @time_window = Window_PlayTime.new
-
- @viewport = Viewport.new(0, 0, 544, 416)
-
- # 生成帮助窗口
- @help_window = Window_Help.new
- @help_window.visible = false
- @help_window.x = 0
- @help_window.y = 360
-
- # 生成物品窗口
- @item_window = Window_Item.new(160, 176, 384, 184)
- @item_window.index = -1
- @item_window.visible = false
- @item_window.active = false
-
- # 生成物品分类窗口
- @category_window = Window_ItemCategory.new
- @category_window.width = 160
- @category_window.height = 184
- @category_window.visible = false
- @category_window.active = false
-
- # 生成技能窗口
- @skill_window = Window_Skill.new(0, 176, 544, 184, @actor)
- @skill_window.index = -1
- @skill_window.visible = false
- @skill_window.active = false
-
- # 生成装备窗口
- @equip_window = Window_Equip.new(208, 56, @actor)
- @equip_window.index = -1
- @equip_window.x = 160
- @equip_window.y = 176
- @equip_window.width += 48
- @equip_window.height += 32
- @equip_window.visible = false
- @equip_window.active = false
-
- # 生成装备状态窗口
- @equip_status_window = Window_EquipStatus.new(0, 56, @actor)
- @equip_status_window.y = 176
- @equip_status_window.height += 32
- @equip_status_window.visible = false
- create_equip_item_windows
-
- # 生成目标窗口
- @target_window = Window_MenuStatus.new(0, 0)
- @target_window.visible = false
- @target_window.active = false
- @target_window.z = 1500
- end
- def create_menu_background
- # 生成CG背景
- @viewport2 = Viewport.new(0, 176, 544, 184)
- @menuback_sprite = Sprite.new(@viewport2)
- @menuback_sprite.bitmap = Bitmap.new("Graphics/Pictures/CG#{rand(@cg_number)+1}")
- update_menu_background
- end
- #--------------------------------------------------------------------------
- # ● 执行结束
- #--------------------------------------------------------------------------
- def terminate
- super
- # 释放背景
- dispose_menu_background
- # 释放所有窗口
- @command_window.dispose
- @gold_window.dispose
- @status_window.dispose
- @time_window.dispose
- @help_window.dispose
- @item_window.dispose
- @category_window.dispose
- @skill_window.dispose
- @equip_window.dispose
- @target_window.dispose
- @equip_status_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 刷新背景
- update_menu_background
- # 刷新所有窗口
- @command_window.update
- @gold_window.update
- @status_window.update
- @time_window.update
- @help_window.update
- @item_window.update
- @category_window.update
- @skill_window.update
- @equip_item_window.update if @equip_item_window != nil
- @equip_window.update
- @target_window.update
-
- if @command_window.active
- update_command_selection
- elsif @item_window.active
- update_item_selection
- elsif @skill_window.active
- update_skill_selection
- elsif @target_window.active
- update_item_target_selection if @command_window.index == 0
- update_skill_target_selection if @command_window.index == 1
- elsif @category_window.active
- update_category_selection
- elsif @equip_window.active
- update_equip_selection
- update_equip_item_windows
- update_equip_status_window
- elsif @equip_item_window.active
- update_equip_item_selection
- end
- if @status_window.active
- prev_actor if Input.trigger?(Input::LEFT)
- next_actor if Input.trigger?(Input::RIGHT)
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成命令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = "任务"
- s5 = Vocab::save
- s6 = Vocab::game_end
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # 当队伍无人时
- @command_window.draw_item(0, false) # 无效化物品选项
- @command_window.draw_item(1, false) # 无效化技能选项
- @command_window.draw_item(2, false) # 无效化装备选项
- end
- if $game_system.save_disabled # 禁止存档的场合
- @command_window.draw_item(4, false) # 无效化存档选项
- 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 < 3
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- if @command_window.index < 3
- @help_window.visible = true
- @gold_window.visible = false
- @time_window.visible = false
- @command_window.active = false
- @status_window.active = false
- end
- case @command_window.index
- when 0 # 物品
- @category_window.visible = true
- @category_window.active = true
- @category_window.help_window = @help_window
- @category_window.index = 0
- @item_window.visible = true
- @help_window.visible = true
- when 1 # 技能
- @skill_window.help_window = @help_window
- @skill_window.visible = true
- @skill_window.active = true
- @skill_window.index = 0
- @help_window.visible = true
- when 2 # 装备
- @equip_window.help_window = @help_window
- @equip_window.visible = true
- @equip_status_window.visible = true
- @equip_window.active = true
- @equip_window.index = 0
- @help_window.visible = true
- when 3
- $scene = Scene_Task.new(3)
- when 4 # 存档
- $scene = Scene_File.new(true, false, false)
- when 5 # 结束
- $scene = Scene_End.new
- end
- end
- end
-
- def return_to_command(index)
- @help_window.visible = false
- @gold_window.visible = true
- @time_window.visible = true
- @status_window.active = true
- @command_window.active = true
- @command_window.index = index
- case index
- when 0
- @item_window.visible = false
- @category_window.visible = false
- @category_window.active = false
- when 1
- @skill_window.visible = false
- @skill_window.active = false
- when 2
- @equip_window.active = false
- @equip_window.visible = false
- @equip_status_window.visible = false
- hide_equip_item_windows
- end
- end
-
- #--------------------------------------------------------------------------
- # ● 切换到下一个角色
- #--------------------------------------------------------------------------
- def next_actor
- Sound.play_cursor
- @actor_index += 1
- @actor_index %= $game_party.members.size
- @status_window.dispose
- @actor = $game_party.members[@actor_index]
- @status_window = Window_Status.new(@actor)
- end
- #--------------------------------------------------------------------------
- # ● 切换到上一个角色
- #--------------------------------------------------------------------------
- def prev_actor
- Sound.play_cursor
- @actor_index += $game_party.members.size - 1
- @actor_index %= $game_party.members.size
- @status_window.dispose
- @actor = $game_party.members[@actor_index]
- @status_window = Window_Status.new(@actor)
- end
-
- def update_equip_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::R)
- Sound.play_cursor
- next_actor
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- prev_actor
- elsif Input.trigger?(Input::C)
- if @actor.fix_equipment
- Sound.play_buzzer
- else
- Sound.play_decision
- @equip_window.active = false
- @item_window.active = true
- @item_window.index = 0
- end
- end
- end
- end
复制代码 |
|