#encoding:utf-8 #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # 菜单画面中,显示队伍成员状态的窗口 #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, window_width, window_height) self.y = Graphics.height - self.height @pending_index = -1 refresh end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height 112 end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max return 1 #$game_party.members.size end #-------------------------------------------------------------------------- # ● 绘制简单的状态 #-------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x, y) draw_actor_level(actor, x, y + line_height * 1 + 10) draw_actor_icons(actor, x, y + line_height * 2) draw_actor_class(actor, x + 120, y) end #-------------------------------------------------------------------------- # ● 绘制等级 #-------------------------------------------------------------------------- def draw_actor_level(actor, x, y) change_color(system_color) draw_text(x, y, 64, line_height, Vocab::level_a) change_color(normal_color) draw_text(x + 64, y, 24, line_height, actor.level, 2) end end #============================================================================== # ■ Window_MenuCommand #------------------------------------------------------------------------------ # 菜单画面中显示指令的窗口 #============================================================================== VOCAB_LOAD = "读档" class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands add_load_command add_game_end_command end #-------------------------------------------------------------------------- # ● 向指令列表添加主要的指令 #-------------------------------------------------------------------------- def add_main_commands add_command(Vocab::item, :item, main_commands_enabled) end #-------------------------------------------------------------------------- # ● 添加读档指令 #-------------------------------------------------------------------------- def add_load_command add_command(VOCAB_LOAD, :load, continue_enabled) end #-------------------------------------------------------------------------- # ● 获取“继续游戏”选项是否有效 #-------------------------------------------------------------------------- def continue_enabled DataManager.save_file_exists? end end #============================================================================== # ■ Scene_Menu #------------------------------------------------------------------------------ # 菜单画面 #============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super create_command_window create_status_window end #-------------------------------------------------------------------------- # ● 生成指令窗口 #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new @command_window.x = 0 #(Graphics.width - @command_window.width) / 2 @command_window.y = (Graphics.height - @command_window.height) #/ 2 @command_window.set_handler(:item, method(:command_item)) @command_window.set_handler(:load, method(:command_load)) @command_window.set_handler(:game_end, method(:command_game_end)) @command_window.set_handler(:cancel, method(:return_scene)) end #-------------------------------------------------------------------------- # ● 指令“读档” #-------------------------------------------------------------------------- def command_load SceneManager.call(Scene_Load) end end
#encoding:utf-8 #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # 菜单画面中,显示队伍成员状态的窗口 #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, window_width, window_height) self.y = Graphics.height - self.height @pending_index = -1 refresh end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height 112 end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max return 1 #$game_party.members.size end #-------------------------------------------------------------------------- # ● 绘制简单的状态 #-------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x, y) draw_actor_level(actor, x, y + line_height * 1 + 10) draw_actor_icons(actor, x, y + line_height * 2) draw_actor_class(actor, x + 120, y) end #-------------------------------------------------------------------------- # ● 绘制等级 #-------------------------------------------------------------------------- def draw_actor_level(actor, x, y) change_color(system_color) draw_text(x, y, 64, line_height, Vocab::level_a) change_color(normal_color) draw_text(x + 64, y, 24, line_height, actor.level, 2) end end #============================================================================== # ■ Window_MenuCommand #------------------------------------------------------------------------------ # 菜单画面中显示指令的窗口 #============================================================================== VOCAB_SAVE = "存档" class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands add_save_command add_game_end_command end #-------------------------------------------------------------------------- # ● 向指令列表添加主要的指令 #-------------------------------------------------------------------------- def add_main_commands add_command(Vocab::item, :item, main_commands_enabled) end #-------------------------------------------------------------------------- # ● 添加存档指令 #-------------------------------------------------------------------------- def add_save_command add_command(VOCAB_SAVE, :save, continue_enabled) end #-------------------------------------------------------------------------- # ● 获取“继续游戏”选项是否有效 #-------------------------------------------------------------------------- def continue_enabled DataManager.save_file_exists? end end #============================================================================== # ■ Scene_Menu #------------------------------------------------------------------------------ # 菜单画面 #============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super create_command_window create_status_window end #-------------------------------------------------------------------------- # ● 生成指令窗口 #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new @command_window.x = 0 #(Graphics.width - @command_window.width) / 2 @command_window.y = (Graphics.height - @command_window.height) #/ 2 @command_window.set_handler(:item, method(:command_item)) @command_window.set_handler(:save, method(:command_save)) @command_window.set_handler(:game_end, method(:command_game_end)) @command_window.set_handler(:cancel, method(:return_scene)) end #-------------------------------------------------------------------------- # ● 指令“存档” #-------------------------------------------------------------------------- def command_save SceneManager.call(Scene_Save) end end
捕获.JPG (41.08 KB, 下载次数: 37)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |