mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
creates backup when saving (original commit: infinitefusion-e18/pull/104/commits/c4ef959e47facac7ac883865ec71f3c3b0907ec1)
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -285,7 +285,9 @@ class PokemonLoadScreen
|
|||||||
def try_load_backup(file_path)
|
def try_load_backup(file_path)
|
||||||
if File.file?(file_path + ".bak")
|
if File.file?(file_path + ".bak")
|
||||||
pbMessage(_INTL("The save file is corrupt. A backup will be loaded."))
|
pbMessage(_INTL("The save file is corrupt. A backup will be loaded."))
|
||||||
save_data = load_save_file(file_path + ".bak")
|
file_copy(file_path, SaveData.get_backup_file_path)
|
||||||
|
File.rename(file_path + '.bak', file_path)
|
||||||
|
save_data = load_save_file(file_path)
|
||||||
else
|
else
|
||||||
self.prompt_save_deletion(file_path)
|
self.prompt_save_deletion(file_path)
|
||||||
return {}
|
return {}
|
||||||
@@ -694,6 +696,9 @@ module Game
|
|||||||
$Trainer.save_slot = slot unless auto
|
$Trainer.save_slot = slot unless auto
|
||||||
$Trainer.last_time_saved = Time.now
|
$Trainer.last_time_saved = Time.now
|
||||||
begin
|
begin
|
||||||
|
if File.exists?(file_path)
|
||||||
|
file_copy(file_path, file_path + '.bak')
|
||||||
|
end
|
||||||
SaveData.save_to_file(file_path)
|
SaveData.save_to_file(file_path)
|
||||||
Graphics.frame_reset
|
Graphics.frame_reset
|
||||||
rescue IOError, SystemCallError
|
rescue IOError, SystemCallError
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user