Replacing Save Settings on Exit with Settings on Load

This commit is contained in:
codemann8
2023-12-13 14:02:43 -06:00
parent 9820f79b0b
commit 159dbcd8db
7 changed files with 56 additions and 38 deletions

8
CLI.py
View File

@@ -355,7 +355,7 @@ def parse_settings():
},
"randomSprite": False,
"outputpath": os.path.join("."),
"saveonexit": "ask",
"settingsonload": "saved",
"outputname": "",
"startinventoryarray": {},
"notes": ""
@@ -367,6 +367,12 @@ def parse_settings():
# read saved settings file if it exists and set these
settings_path = os.path.join(".", "resources", "user", "settings.json")
settings = apply_settings_file(settings, settings_path)
if settings["settingsonload"] == "saved":
settings_path = os.path.join(".", "resources", "user", "saved.json")
settings = apply_settings_file(settings, settings_path)
elif settings["settingsonload"] == "lastused":
settings_path = os.path.join(".", "resources", "user", "last.json")
settings = apply_settings_file(settings, settings_path)
return settings
# Priority fallback is: