Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * EDIT SAVE FOLDER
- # by dsiver144
- #===============================================================================
- SAVE_FOLDER = "Diary" # You can freely change it to what you want.
- module DataManager
- #--------------------------------------------------------------------------
- # * Determine Existence of Save File
- #--------------------------------------------------------------------------
- def self.save_file_exists?
- if !File.directory?(SAVE_FOLDER)
- Dir.mkdir(SAVE_FOLDER)
- end
- return !Dir.glob(SAVE_FOLDER + '/Save*.rvdata2').empty?
- end
- #--------------------------------------------------------------------------
- # * Create Filename
- # index : File Index
- #--------------------------------------------------------------------------
- def self.make_filename(index)
- if !File.directory?(SAVE_FOLDER)
- Dir.mkdir(SAVE_FOLDER)
- end
- return sprintf(SAVE_FOLDER + "/Save%02d.rvdata2", index + 1)
- end
- end # DataManager
- module LGlobalSave
- FILE_NAME = SAVE_FOLDER + "/GlobalSave.rvdata2"
- def self.saveTheFile(f)
- if !File.directory?(SAVE_FOLDER)
- Dir.mkdir(SAVE_FOLDER)
- end
- File.open(FILE_NAME, "wb") do |file|
- Marshal.dump(f, file)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment