| Fukuyama's Save Menu with a slight edit from Wachunga: | ||||||
| Ok, this script will take and <> out of the map name, that was Wachunga's edit. Now, make a new calss Above ;Main' and name it Custom Save Menu then put this into it: | ||||||
| #================================================
# ====Create a new script above main and put all that code in it. ====== #================================================ # # # # # # ? Window_SaveFile #------------------------------------------------------------------------------ # ???????????????????????????????????? #============================================================================== class Window_SaveFile < Window_Base #-------------------------------------------------------------------------- # ? ?????????? #-------------------------------------------------------------------------- attr_reader :filename # ????? attr_reader :selected # ???? #-------------------------------------------------------------------------- # ? ????????? # file_index : ?????????????? (0?3) # filename : ????? #-------------------------------------------------------------------------- def initialize(file_index, filename) super(0, 64 + file_index % 4 * 104, 640, 104) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize @file_index = file_index @filename = "Save#{@file_index + 1}.rxdata" @game_party_leader = "" #@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) @total_sec = @frame_count / Graphics.frame_rate @game_party = Marshal.load(file) @game_map_name = Marshal.load(file) @game_party_leader = @game_party.actors[0].name end refresh @selected = false rescue file.close @selected = false @file_exist = false refresh end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def refresh self.contents.clear # ????????? self.contents.font.color = normal_color if @game_party_leader == "" name = "File #{@file_index + 1}" else name = "File #{@file_index + 1} : " + @game_party_leader end self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width # ?????????????? if @file_exist # ????????? for i in [email protected] bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(0, 0, cw, ch) x = 300 - @characters.size * 32 + i * 64 - cw / 2 self.contents.blt(x, 68 - ch, bitmap, src_rect) end # ???????? hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 8, 600, 32, time_string, 2) # ?????????? self.contents.font.color = normal_color # time_string = @time_stamp.strftime("%Y/%m/%d %H:%M") # self.contents.draw_text(4, 40, 600, 32, time_string, 2) self.contents.draw_text(4, 40, 600, 32, @game_map_name[0...@game_map_name.index('<')], 2) end end #-------------------------------------------------------------------------- # ? ??????? # selected : ??????? (true=?? false=???) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor_rect end #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def update_cursor_rect if @selected self.cursor_rect.set(0, 0, @name_width + 8, 32) else self.cursor_rect.empty end end end #====================================================#========================== # ? Scene_Save #------------------------------------------------------------------------------ # ?????????????????? #====================================================#========================== class Scene_Save < Scene_File # ----------------------------- def initialize super("Save in which slot?") @confirm_window = Window_Base.new(120, 188, 400, 64) @confirm_window.contents = Bitmap.new(368, 32) string = "Sure you want to overwrite this file?" @confirm_window.contents.font.name = "OldEnglish" @confirm_window.contents.font.size = 20 @confirm_window.contents.draw_text(4, 0, 368, 32, string) @yes_no_window = Window_Command.new(100, ["Yes", "No"]) @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 @help_window.update @yes_no_window.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) if @yes_no_window.index == 0 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_party, file) Marshal.dump($game_map.name, file) 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_map, file) Marshal.dump($game_troop, file) Marshal.dump($game_player, file) end end #============================================================================== # ? Scene_Load #------------------------------------------------------------------------------ # ?????????????????? #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def initialize # ??????????????? $game_temp = Game_Temp.new # ?????????????????? $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..3 filename = make_filename(i) if FileTest.exist?(filename) file = File.open(filename, "r") if file.mtime > latest_time latest_time = file.mtime $game_temp.last_file_index = i end file.close end end super("Which file do you wish to load from?") end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def on_decision(filename) # ???????????? unless FileTest.exist?(filename) # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ??? SE ??? $game_system.se_play($data_system.load_se) # ??????????? file = File.open(filename, "rb") read_save_data(file) file.close # BGM?BGS ??? $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # ?????? (????????) $game_map.update # ?????????? $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def on_cancel # ????? SE ??? $game_system.se_play($data_system.cancel_se) # ??????????? $scene = Scene_Title.new end #-------------------------------------------------------------------------- # ? ??????????? # file : ??????????????? (??????) #-------------------------------------------------------------------------- def read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_party = Marshal.load(file) @game_map_name = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_map = Marshal.load(file) $game_troop = Marshal.load(file) $game_player = Marshal.load(file) # ??????????????????? # (?????????????????) if $game_system.magic_number != $data_system.magic_number # ???????? $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end # ??????????????? $game_party.refresh end end #============================================================================== # ? Scene_File #------------------------------------------------------------------------------ # ????????????????????????? #============================================================================== class Scene_File #-------------------------------------------------------------------------- # ? ????????? # help_text : ???????????????? #-------------------------------------------------------------------------- def initialize(help_text) @help_text = help_text end #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- def main # ??????????? @help_window = Window_Help.new @help_window.set_text(@help_text) # ??????????????? @savefile_windows = [] for i in 0..3 @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end # ?????????????? @file_index = $game_temp.last_file_index @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 if self.is_a?(Scene_Save) @confirm_window.dispose @yes_no_window.dispose end end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def update # ???????? @help_window.update for i in @savefile_windows 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) # ???????????????????????? # ?????????? 3 ?????? if Input.trigger?(Input::DOWN) or @file_index < 3 # ???? SE ??? $game_system.se_play($data_system.cursor_se) # ????????? @savefile_windows[@file_index].selected = false @file_index = (@file_index + 1) % 4 @savefile_windows[@file_index].selected = true return end end # ?????????????? if Input.repeat?(Input::UP) # ???????????????????????? # ?????????? 0 ??????? if Input.trigger?(Input::UP) or @file_index > 0 # ???? SE ??? $game_system.se_play($data_system.cursor_se) # ????????? @savefile_windows[@file_index].selected = false @file_index = (@file_index + 3) % 4 @savefile_windows[@file_index].selected = true return end end end #-------------------------------------------------------------------------- # ? ???????? # file_index : ?????????????? (0?3) #-------------------------------------------------------------------------- def make_filename(file_index) return "Save#{file_index + 1}.rxdata" end end # # Map Name Script ver.1.03.3 # by: fukuyama # Japanese Comments Removed By: K-Anator # http://www.rpg-reborn.tk # This only gives the game_map.name method #============================================================================== # Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- alias xrxs20_main main def main $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end xrxs20_main end end #============================================================================== # Game_Map #============================================================================== class Game_Map #-------------------------------------------------------------------------- def name $map_infos[@map_id] end end |
||||||