#------------------------------------------------------------------------------- #- More Informative Saves v1.0a #-- Customizable save slots capable of holding all sorts of data #-- By mjshi #-- OK for use in all projects with credit #------------------------------------------------------------------------------- # Installation: Put above Main. #------------------------------------------------------------------------------- module MISav #----------------------------------------------------------------------------- # **CONFIGURATION** #----------------------------------------------------------------------------- # Save Menu Configuration # FileName = "File" ShiftX = 0 ShiftY = 0 Window_Width = Graphics.width #100% width Max_Savefiles = 12 # Number of savefiles to show at once Number_Viewable = 4 # # Show save/load messages? (true/false) Show_Msg = true MsgWindow_ShiftX = ShiftX #makes the msgwindow move with the savefiles MsgWindow_ShiftY = ShiftY #makes the msgwindow move with the savefiles MsgWindow_Width = Graphics.width #100% width # SaveMsg = "Save to which file?" LoadMsg = "Load which file?" # #----------------------------------------------------------------------------- # Should we show the player's party on the save file? # Show_Party = true # # Where should we show the party members? PARTY_X = 152 PARTY_Y = 58 PARTY_SPACING = 12 #default is 12 # #----------------------------------------------------------------------------- # Should we show the player's face images on the save file? # Show_Faces = false FACE_X = 0 FACE_Y = 0 FACE_SPACING = 10 # TEXT = [ #----------------------------------------------------------------------------- # Text to show on the save/load screen. # Format: # ["text", x position or align, line number], #----------------------------------------------------------------------------- #-"text" is what you want to display #-align can be 0 (left), 1 (center), or 2 (right). Anything larger than a 2 # will be treated as a specific x coordinate. #-line number can range from 0 to 2, 0 is the first line, 2 is the last, # and decimals are OK. #----------------------------------------------------------------------------- # Put a # in front of the ones you don't want to show # **Don't forget the comma after each []!** ["Some Text Here", 300, 0.5], ] THINGS = [ #----------------------------------------------------------------------------- # Variables to show on the save/load screen. # Format: # ["name", "value", x position or align, line number], #----------------------------------------------------------------------------- #-"name" can be called whatever you want, as long as there are no spaces. # I'd recommend naming it something useful so you know what it is, and to # put "_s" (for save) at the end so there are no conflicts with other things. #-"value" is any bit of game data that you want to show up on the save. #----------------------------------------------------------------------------- # Put a # in front of the ones you don't want to show # **Don't forget the comma after each []!** ["playtime_s", "$game_system.playtime_s", 2, 0], ["location_s", "$game_map.display_name", 2, 1], #["gamevariable1", "$game_variables[1]", 2, 2], ] #----------------------------------------------------------------------------- # **END OF CONFIGURATION** #----------------------------------------------------------------------------- if (Window_Width + ShiftX) > Graphics.width Window_Width -= ShiftX end if (MsgWindow_Width + MsgWindow_ShiftX) > Graphics.width MsgWindow_Width -= MsgWindow_ShiftX end end #--------------------------------------------------------------------# # !!! Beware of crashes and errors if you edit beyond this point !!! # #--------------------------------------------------------------------# module DataManager def self.make_save_header header = {} header[:characters] = $game_party.characters_for_savefile for item in MISav::THINGS header[item[0].to_sym] = eval item[1] end header end def self.savefile_max return MISav::Max_Savefiles end end module Vocab SaveMessage = MISav::SaveMsg LoadMessage = MISav::LoadMsg File = MISav::FileName end class Window_SaveFile def initialize(height, index) super(MISav::ShiftX, index * height + MISav::ShiftY, MISav::Window_Width, height) @file_index = index refresh @selected = false end def refresh contents.clear draw_party_characters(MISav::PARTY_X, MISav::PARTY_Y, MISav::PARTY_SPACING) if MISav::Show_Party draw_face_characters(MISav::FACE_X, MISav::FACE_Y, MISav::FACE_SPACING) if MISav::Show_Faces draw_custom_items change_color(normal_color) name = Vocab::File + " #{@file_index + 1}" draw_text(4, 0, 200, line_height, name) @name_width = text_size(name).width end def draw_party_characters(x, y, spacing) header = DataManager.load_header(@file_index) return unless header header[:characters].each_with_index do |data, i| draw_character(data[0], data[1], x + i * (32 + spacing), y) end end def draw_face_characters(x, y, spacing) header = DataManager.load_header(@file_index) return unless header header[:characters].each_with_index do |data, i| draw_face(data[0], data[1], x + i * (96 + spacing), y, enabled = true) end end def draw_custom_items header = DataManager.load_header(@file_index) return unless header #["text", x position or align, line number] for item in MISav::TEXT if item[1] > 2 draw_text(item[1], line_height*item[2], contents.width - 4, line_height, item[0]) else draw_text(0, line_height*item[2], contents.width - 4, line_height, item[0], item[1]) end end #["name", "value", x position or align, line number] for item in MISav::THINGS if item[2] > 2 draw_text(item[2], line_height*item[3], contents.width - 4, line_height, header[item[0].to_sym]) else draw_text(0, line_height*item[3], contents.width - 4, line_height, header[item[0].to_sym], item[2]) end end end end class Scene_File def start super create_help_window if MISav::Show_Msg create_savefile_viewport create_savefile_windows init_selection end def create_help_window @help_window = Window_Help.new(1) @help_window.set_text(help_window_text) @help_window.x = MISav::MsgWindow_ShiftX @help_window.y = MISav::MsgWindow_ShiftY @help_window.width = MISav::MsgWindow_Width end def visible_max return MISav::Number_Viewable end def savefile_height @savefile_viewport.rect.height/visible_max - MISav::ShiftY/visible_max end end