Some debug stuff
This commit is contained in:
29
game.py
29
game.py
@@ -81,6 +81,7 @@ class Game:
|
||||
return
|
||||
|
||||
def run(self):
|
||||
title()
|
||||
if os.path.exists("debug.json"):
|
||||
bypass_tamper_check = False
|
||||
debug_config = None
|
||||
@@ -89,22 +90,28 @@ class Game:
|
||||
if content.strip():
|
||||
debug_config = json.loads(content)
|
||||
if debug_config:
|
||||
if debug_config.get("bypass_tamper_check", None):
|
||||
if debug_config.get("bypass_tamper_check_message", None):
|
||||
if (
|
||||
debug_config["bypass_tamper_check"]
|
||||
debug_config["bypass_tamper_check_message"]
|
||||
== data.text.BYPASS_TAMPER_CHECK_MESSAGE
|
||||
):
|
||||
bypass_tamper_check = True
|
||||
if debug_config.get("bypass_tamper_check_enable", False):
|
||||
bypass_tamper_check = True
|
||||
if debug_config.get("auto_load_savefile", None):
|
||||
self.cat = data.save.load(
|
||||
debug_config["auto_load_savefile"],
|
||||
bypass_tamper_check=bypass_tamper_check,
|
||||
)
|
||||
self.game_loop()
|
||||
print(f"{self.cat.name} says bye")
|
||||
return
|
||||
try:
|
||||
self.cat = data.save.load(
|
||||
debug_config["auto_load_savefile"],
|
||||
bypass_tamper_check=bypass_tamper_check,
|
||||
)
|
||||
self.game_loop()
|
||||
except:
|
||||
print(
|
||||
"There was an error loading the autoload savefile, please check your configuration."
|
||||
)
|
||||
else:
|
||||
print(f"{self.cat.name} says bye")
|
||||
return
|
||||
|
||||
title()
|
||||
options = ["New Game", "Quit"]
|
||||
if os.path.exists("saves"):
|
||||
options.insert(0, "Load Game")
|
||||
|
||||
Reference in New Issue
Block a user