为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

RPG Maker XP脚本:存档数量增加

2017-12-24 7页 doc 20KB 283阅读

用户头像

is_882336

暂无简介

举报
RPG Maker XP脚本:存档数量增加RPG Maker XP脚本:存档数量增加 class Scene_File #?ª?ª×î?ó?æµµÊýÁ? SAVEFILE_MAX = 25 # ------------------- def initialize(help_text) @help_text = help_text end # ------------------- def main @help_window = Window_Help.new @help_window.set_text(@help_text) @savefil...
RPG Maker XP脚本:存档数量增加
RPG Maker XP脚本:存档数量增加 class Scene_File #?ª?ª×î?ó?æµµÊýÁ? SAVEFILE_MAX = 25 # ------------------- def initialize(help_text) @help_text = help_text end # ------------------- def main @help_window = Window_Help.new @help_window.set_text(@help_text) @savefile_windows = [] @cursor_displace = 0 for i in 0..3 @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i)) end @file_index = 0 @savefile_windows[@file_index].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 i.update end if Input.trigger?(Input::C) on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end if Input.trigger?(Input::B) on_cancel return end if Input.repeat?(Input::DOWN) if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1 if @file_index == SAVEFILE_MAX - 1 $game_system.se_play($data_system.buzzer_se) return end @cursor_displace += 1 if @cursor_displace == 4 @cursor_displace = 3 for i in @savefile_windows i.dispose end @savefile_windows = [] for i in 0..3 f = i - 2 + @file_index name = make_filename(f) @savefile_windows.push(Window_SaveFile.new(f, name, i)) @savefile_windows[i].selected = false end end $game_system.se_play($data_system.cursor_se) @file_index = (@file_index + 1) if @file_index == SAVEFILE_MAX @file_index = SAVEFILE_MAX - 1 end for i in 0..3 @savefile_windows[i].selected = false end @savefile_windows[@cursor_displace].selected = true return end end if Input.repeat?(Input::UP) if Input.trigger?(Input::UP) or @file_index > 0 if @file_index == 0 $game_system.se_play($data_system.buzzer_se) return end @cursor_displace -= 1 if @cursor_displace == -1 @cursor_displace = 0 for i in @savefile_windows i.dispose end @savefile_windows = [] for i in 0..3 f = i - 1 + @file_index name = make_filename(f) @savefile_windows.push(Window_SaveFile.new(f, name, i)) @savefile_windows[i].selected = false end end $game_system.se_play($data_system.cursor_se) @file_index = (@file_index - 1) if @file_index == -1 @file_index = 0 end for i in 0..3 @savefile_windows[i].selected = false end @savefile_windows[@cursor_displace].selected = true return end end end # ------------------- def make_filename(file_index) return "Save/Save#{file_index + 1}.rxdata" end # ------------------- end class Window_SaveFile < Window_Base # ------------------- def initialize(file_index, filename, position) y = 64 + position * 104 super(0, y, 640, 104) self.contents = Bitmap.new(width - 32 @file_index = file_index @filename = "Save/Save#{@file_index + 1}.rxdata" @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end refresh @selected = false end end
/
本文档为【RPG Maker XP脚本:存档数量增加】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索