Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # SAVE FILE CHAPTER/LOCATION
- # by dsiver144
- #-------------------------------------------------------------------------------
- # How to use: Set pre-defined variables to current chapter's info.
- #===============================================================================
- module Chapter
- Chapter_VAR_ID = 6 # Set variable 6 equal to current chapter. (Number)
- Chapter_name_VAR_ID = 7 # Set variable 7 equal to current chapter name. (String)
- end # Chapter
- class Window_SaveFile < Window_Base
- #--------------------------------------------------------------------------
- # * alias method: refresh
- #--------------------------------------------------------------------------
- alias_method(:dsi_save_file_chapter_refresh, :refresh)
- def refresh
- dsi_save_file_chapter_refresh
- draw_game_chaper(0,0)
- draw_location(0,22)
- end
- #--------------------------------------------------------------------------
- # * new method: draw_game_chaper
- #--------------------------------------------------------------------------
- def draw_game_chaper(x,y)
- header = DataManager.load_header(@file_index)
- return unless header
- chapter = header[:game_chapter]
- name = header[:game_chapterName]
- if !name.is_a?(String)
- draw_text(x, y , contents_width - 2, line_height, "Chapter #{chapter}", 2)
- else
- draw_text(x, y , contents_width - 2, line_height, "Chapter #{chapter} : #{name}", 2)
- end
- end
- #--------------------------------------------------------------------------
- # * new method: draw_game_chaper
- #--------------------------------------------------------------------------
- def draw_location(x,y)
- header = DataManager.load_header(@file_index)
- return unless header
- location = header[:location]
- draw_text(x, y , contents_width - 2, line_height, "#{location}", 2)
- end
- end # Window_SaveFile
- module DataManager
- #--------------------------------------------------------------------------
- # * overwrite method: make_save_header
- #--------------------------------------------------------------------------
- def self.make_save_header
- header = {}
- header[:characters] = $game_party.characters_for_savefile
- header[:playtime_s] = $game_system.playtime_s
- header[:game_chapter] = $game_variables[Chapter::Chapter_VAR_ID]
- header[:game_chapterName] = $game_variables[Chapter::Chapter_name_VAR_ID]
- header[:location] = $game_map.display_name
- header
- end
- end # DataManager
- #===============================================================================
- # * END OF FILE
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement