| 赞 | 0 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 4 |
| 经验 | 201687 |
| 最后登录 | 2024-7-14 |
| 在线时间 | 125 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 431
- 在线时间
- 125 小时
- 注册时间
- 2006-11-2
- 帖子
- 1200
|
- #==============================================================================
- # ■ Window_PartyCommand
- #------------------------------------------------------------------------------
- # 战斗画面、选择战斗与逃跑的窗口。
- #==============================================================================
- class Window_MenuCommand < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = 160
- @commands = ["取消", "对话","物品","存盘","啊啊"]
- @item_max = 5
- @column_max = 5
- for i in 0..4
- draw_item(i, normal_color)
- end
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目标号
- # color : 文字颜色
- #--------------------------------------------------------------------------
- def draw_item(index, color)
- self.contents.font.color = color
- rect = Rect.new( index * 128 + 4, 0, 128 - 10, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- self.contents.draw_text(rect, @commands[index], 1)
- end
- #--------------------------------------------------------------------------
- # ● 更新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- self.cursor_rect.set(index * 128, 0, 128, 32)
- end
-
- def disable_item(index)
- draw_item(index, disabled_color)
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令光标的初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 生成命令窗口
- screen = Spriteset_Map.new
- @command_window = Window_MenuCommand.new
-
- # @command_window.index = @menu_index
- # 同伴人数为 0 的情况下
- if $game_party.actors.size == 0
- # 物品、特技、装备、状态无效化
- @command_window.disable_item(2)
- end
- # 禁止存档的情况下
- if $game_system.save_disabled
- # 存档无效
- @command_window.disable_item(3)
- end
- # 生成状态窗口
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- screen.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- # 命令窗口被激活的情况下: 调用 update_command
- if @command_window.active
- update_command
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (命令窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def update_command
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换的地图画面
- $scene = Scene_Map.new
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 同伴人数为 0、存档、游戏结束以外的场合
- if $game_party.actors.size == 0 and @command_window.index == 2
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 命令窗口的光标位置分支
- case @command_window.index
- when 0 # 取消
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换的地图画面
- $scene = Scene_Map.new
- when 1 # 对话kk
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- $scene = Scene_Map.new
- $game_temp.message_text = "你好"
- when 2 # 物品
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到物品画面
- $scene = Scene_Item.new
- when 3 # 存档
- # 禁止存档的情况下
- if $game_system.save_disabled
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到存档画面
- $scene = Scene_Save.new
- end
- return
- end
- end
- end
复制代码
这样就是5个了。 |
|