#============================================================================== # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息 #============================================================================== #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window alias xrxs_mp7_initialize initialize def initialize(x, y, width, height) xrxs_mp7_initialize(x, y, width, height) if $scene.is_a?(Scene_Menu) or $scene.is_a?(Scene_Item) or $scene.is_a?(Scene_Skill) or $scene.is_a?(Scene_Equip) or $scene.is_a?(Scene_Status) or $scene.is_a?(Scene_Save) or $scene.is_a?(Scene_End) self.back_opacity = 160 #————这个数值可调,为透明程度 end end end module XRXS_MP7_Module def create_spriteset @spriteset = Spriteset_Map.new end def dispose_spriteset @spriteset.dispose end end class Scene_Menu include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Item include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Skill include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Equip include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Status include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Save include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_End include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end #============================================================================== # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息 #==============================================================================
#============================================================================== # ■ 存档位真·无限扩展 v2.1 by SailCat #------------------------------------------------------------------------------ # 方法:插入到Main之前使用。 # 版本:v2.1 (Build 171011) # 效果:存档位真·无限扩展,不需要配置,系统自动检测根据存档逐一扩展 # 冲突:和其他存档扩展脚本冲突 # 操作:上下翻1,左右翻4,Ctrl+上下翻16,Ctrl+左右翻64,LR翻256,Ctrl+LR头尾 #============================================================================== class Scene_File #-------------------------------------------------------------------------- # ● 追加定义 #-------------------------------------------------------------------------- attr_reader :top_index # 首项 索引值 unless method_defined? :sailcat_initialize alias sailcat_initialize initialize end #-------------------------------------------------------------------------- # ● 初始化对像 # help_text : 帮助窗口显示的字符串 #-------------------------------------------------------------------------- def initialize(help_text) sailcat_initialize(help_text) @file_count ||= save_count end #-------------------------------------------------------------------------- # ● 设置首项,重绘首项之后的4个窗口 # index : 新的首项 #-------------------------------------------------------------------------- def top_index=(index) index = [0, [index / 4 * 4, @file_count - 1].min].max if @top_index != index @top_index = index redraw_windows end end #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main # 生成帮助窗口 @help_window = Window_Help.new @help_window.set_text(@help_text) # 选择最后操作的文件 @file_index = [@file_count - 1, $game_temp.last_file_index].min # 只刷新需要显示的窗口 self.top_index = @file_index @savefile_windows[@file_index % 4].selected = true # 执行过渡 Graphics.transition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 Input.update # 刷新画面 update # 如果画面被切换的话就中断循环 if $scene != self break end end # 准备过渡 Graphics.freeze # 释放窗口 @help_window.dispose for i in @savefile_windows i.dispose end end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @help_window.update for i in @savefile_windows[0..3] i.update end # 按下 C 键的情况下 if Input.trigger?(Input::C) # 调用过程 on_decision (定义继承目标) on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end # 按下 B 键的情况下 if Input.trigger?(Input::B) # 调用过程 on_cancel (定义继承目标) on_cancel return end # 按下下方向键的情况下 if Input.repeat?(Input::DOWN) move_index(Input.press?(Input::CTRL) ? 16 : 1) return end # 按下上方向键的情况下 if Input.repeat?(Input::UP) move_index(Input.press?(Input::CTRL) ? -16 : -1) return end # 按下左方向键的情况下 if Input.repeat?(Input::LEFT) move_index(Input.press?(Input::CTRL) ? -64 : -4) return end # 按下右方向键的情况下 if Input.repeat?(Input::RIGHT) move_index(Input.press?(Input::CTRL) ? 64 : 4) return end # 按下 R 键的情况下 if Input.trigger?(Input::R) Input.press?(Input::CTRL) ? set_index(-1) : move_index(256) return end # 按下 L 键的情况下 if Input.trigger?(Input::L) Input.press?(Input::CTRL) ? set_index(0) : move_index(-256) return end end #-------------------------------------------------------------------------- # ● 生成文件名 # file_index : 文件名的索引 (0~3) #-------------------------------------------------------------------------- def make_filename(file_index) return "Save#{file_index + 1}.rxdata" end #-------------------------------------------------------------------------- # ● 移动光标 # distance : 移动的距离 #-------------------------------------------------------------------------- def move_index(distance) if @file_index == 0 and distance < 0 set_index(-1) elsif @file_index == @file_count - 1 and distance > 0 set_index(0) else set_index([0, [@file_index + distance, @file_count - 1].min].max) end end #-------------------------------------------------------------------------- # ● 设置光标位置 # new_index : 新光标位置 #-------------------------------------------------------------------------- def set_index(new_index) new_index += @file_count if new_index < 0 # 演奏光标 SE $game_system.se_play($data_system.cursor_se) # 光标移动到新位置 @savefile_windows[@file_index % 4].selected = false @file_index = new_index self.top_index = new_index @savefile_windows[@file_index % 4].selected = true end #-------------------------------------------------------------------------- # ● 检测存档数目 #-------------------------------------------------------------------------- def save_count i = 0 while FileTest.exists?(make_filename(i)) i += 1 end return self.is_a?(Scene_Save) ? i + 1 : i end #-------------------------------------------------------------------------- # ● 重绘存档文件窗口 #-------------------------------------------------------------------------- def redraw_windows # 生成存档文件窗口 @savefile_windows.each { |i| i.dispose } unless @savefile_windows == nil @savefile_windows = [] for i in @top_index...[@top_index + 4, @file_count].min filename = make_filename(i) window = Window_SaveFile.new(i, filename) window.y = i % 4 * 104 + 64 @savefile_windows.push(window) end (4 - @savefile_windows.size).times do |i| window = Window_Base.new(0, 376 - i * 104, 640, 104) window.opacity = window.back_opacity = 128 @savefile_windows.push(window) end end end class Scene_Load < Scene_File #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize # 再生成临时对像 $game_temp = Game_Temp.new # 选择存档时间最新的文件 $game_temp.last_file_index = 0 latest_time = Time.at(0) @file_count = save_count for i in 0...@file_count File.open(make_filename(i), "r") do |f| if f.mtime > latest_time latest_time = f.mtime $game_temp.last_file_index = i end end end super("要载入哪个文件?") end end
00error.png (22.08 KB, 下载次数: 47)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |