{:2_276:}结果我发现是那张地图不知道哪里有问题,我换了地图就可以顺利打开菜单了 于是我就这样莫名其妙的自行解决了.... |
Scene_Menu |
这个是MenuStatus #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # 显示菜单画面和同伴状态的窗口。 #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化目标 #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 480) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 116 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 40, y + 80) draw_actor_name(actor, x, y) draw_actor_class(actor, x + 144, y) draw_actor_level(actor, x, y + 32) draw_actor_state(actor, x + 90, y + 32) draw_actor_exp(actor, x, y + 64) draw_actor_hp(actor, x + 236, y + 32) draw_actor_sp(actor, x + 236, y + 64) end end #-------------------------------------------------------------------------- # ● 刷新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 116, self.width - 32, 96) end end end 这个是Menu #============================================================================== # ■ Scene_Menu #------------------------------------------------------------------------------ # 处理菜单画面的类。 #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # ● 初始化对像 # menu_index : 命令光标的初期位置 #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main # 生成命令窗口 s1 = $data_system.words.item s2 = "状态" s3 = "存档" s4 = "结束游戏" @command_window = Window_Command.new(96, [s1, s2, s3, s4]) @command_window.x = 1 @command_window.y = 1 @command_window.index = @menu_index # 同伴人数为 0 的情况下 if $game_party.actors.size == 0 # 物品、特技、装备、状态无效化 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # 禁止存档的情况下 if $game_system.save_disabled # 存档无效 @command_window.disable_item(4) end # 生成游戏时间窗口 @playtime_window = Window_PlayTime.new @playtime_window.x = 1 @playtime_window.y = 384 #紧接上面的数值为160 @gold_window = Window_Gold.new @gold_window.x = 1 @gold_window.y = 384+96 # 执行过渡 Graphics.transition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 Input.update # 刷新画面 update # 如果切换画面就中断循环 if $scene != self break end end # 准备过渡 Graphics.freeze # 释放窗口 @command_window.dispose @playtime_window.dispose @gold_window.dispose end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @command_window.update @playtime_window.update @gold_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 < 4 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 命令窗口的光标位置分支 case @command_window.index when 0 # 物品 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到物品画面 $scene = Scene_Item.new when 1 # 状态 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 $scene = Scene_Status.new when 2 # 存档 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 when 3 # 游戏结束 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 $scene = Scene_End.new end return end end end |
请问一下要粘贴哪一部分的脚本呢? 就是说这句是和其他哪些脚本有关系的呢? 是要贴Scene_Menu的脚本还是说S贴cene_Save的脚本? |
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-11 21:45
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.