- UID
- 117
- 帖子
- 14936
- 主题
- 1013
- 精华
- 2
- 积分
- 23743
- 历练
- 3
- 声望
- 133
- 人气
- 2625
- 经验
- 21523
- 金钱
- 3498
- 注册时间
- 2009-10-1
- 最后登录
- 2024-11-24
- 在线时间
- 2308 小时
- 阅读权限
- 100
TA的每日心情 | 擦汗 9 分钟前 |
---|
签到天数: 1409 天 [LV.10]以坛为家III - 精华
- 2
- 积分
- 23743
- 历练
- 3
- 声望
- 133
- 人气
- 2625
|
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #在覆盖存档的时候弹出对话框提示
- class Scene_Save < Scene_File
- # -----------------------------
- def initialize
- super("")
- @confirm_window = Window_Base.new(120, 188, 400, 64)
- @confirm_window.contents = Bitmap.new(368, 32)
- string = "确定要覆盖这个进度吗?"
- @confirm_window.contents.font.name = "黑体"
- @confirm_window.contents.font.size = 24
- @confirm_window.contents.draw_text(4, 0, 368, 32, string)
- @yes_no_window = Window_Command.new(100, ["覆盖", "取消"])
- @confirm_window.visible = false
- @confirm_window.z = 1500
- @yes_no_window.visible = false
- @yes_no_window.active = false
- @yes_no_window.index = 1
- @yes_no_window.x = 270
- @yes_no_window.y = 252
- @yes_no_window.z = 1500
- @mode = 0
- end
- # -----------------------------
- def on_decision(filename)
- if FileTest.exist?(filename)
- @confirm_window.visible = true
- @yes_no_window.visible = true
- @yes_no_window.active = true
- @mode = 1
- else
- $game_system.se_play($data_system.save_se)
- file = File.open(filename, "wb")
- write_save_data(file)
- file.close
- if $game_temp.save_calling
- $game_temp.save_calling = false
- $scene = Scene_Map.new
- return
- end
- $scene = Scene_Menu.new(4)
- end
- end
- # -----------------------------
- def update
- if @mode == 0
- super
- else
- @yes_no_window.update
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.decision_se)
- if @yes_no_window.index == 0
- @yes_no_window.visible = false
- @yes_no_window.active = false
- @confirm_window.visible = false
- filename = make_filename(@file_index)
- $game_system.se_play($data_system.save_se)
- file = File.open(filename, "wb")
- write_save_data(file)
- file.close
- if $game_temp.save_calling
- $game_temp.save_calling = false
- $scene = Scene_Map.new
- else
- $scene = Scene_Menu.new(4)
- end
- else
- @confirm_window.visible = false
- @yes_no_window.visible = false
- @yes_no_window.active = false
- @yes_no_window.index = 1
- @mode = 0
- end
- end
- if Input.trigger?(Input::B)
- @confirm_window.visible = false
- @yes_no_window.visible = false
- @yes_no_window.active = false
- @yes_no_window.index = 1
- @mode = 0
- return
- end
- end
- end
- # -----------------------------
- def on_cancel
- $game_system.se_play($data_system.cancel_se)
- if $game_temp.save_calling
- $game_temp.save_calling = false
- $scene = Scene_Map.new
- return
- end
- $scene = Scene_Menu.new(4)
- end
- # -----------------------------
- def write_save_data(file)
- characters = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- Marshal.dump(characters, file)
- Marshal.dump(Graphics.frame_count, file)
- $game_system.save_count += 1
- $game_system.magic_number = $data_system.magic_number
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- end
- end
- class Scene_File
- alias carol3_main main
- def main
- carol3_main
- if self.is_a?(Scene_Save)
- @confirm_window.dispose
- @yes_no_window.dispose
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
-
复制代码 与存档类脚本…… |
|