From a3e6ed577a0f8af11ce3af7b3bd8745fd83a02de Mon Sep 17 00:00:00 2001 From: Owen Feldman Date: Fri, 17 Apr 2026 18:21:39 -0400 Subject: [PATCH] Disable saving for web version --- data/save.py | 13 +++++++++++-- game.py | 13 +++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/data/save.py b/data/save.py index 8d38e85..b6994bd 100644 --- a/data/save.py +++ b/data/save.py @@ -55,7 +55,11 @@ class SaveData: self.money = money -def save(cat): +def save(cat, hide_web_message=False): + if os.path.exists("WEB_VERSION"): + if not hide_web_message: + print("Saving is disabled.") + return currentjson = {} data_dir = get_data_dir() hash_path = os.path.join(data_dir, "dont hurt cats.json") @@ -74,7 +78,12 @@ def save(cat): json.dump(currentjson, f) -def load(filepath, bypass_tamper_check=False, force_punish=False): +def load( + filepath, bypass_tamper_check=False, force_punish=False, hide_web_message=False +): + if os.path.exists("WEB_VERSION"): + if not hide_web_message: + print("Loading is disabled.") punished = False data_dir = get_data_dir() hash_path = os.path.join(data_dir, "dont hurt cats.json") diff --git a/game.py b/game.py index 352ac3e..3386082 100644 --- a/game.py +++ b/game.py @@ -59,9 +59,10 @@ class Game: def new_game(self): self.cat = shelter() - print("Saving...") - data.save.save(self.cat) - print("Save complete.") + if not os.path.exists("WEB_VERSION"): + print("Saving...") + data.save.save(self.cat) + print("Save complete.") self.game_loop() # TODO: Add shop, make food buyable and add money system @@ -81,6 +82,10 @@ class Game: return def run(self): + if os.path.exists("WEB_VERSION"): + print( + "This is a web version of Whiskerbound, saving/loading is disabled. As soon as you quit this page, your savefile is gone." + ) title() if os.path.exists("debug.json"): bypass_tamper_check = False @@ -113,7 +118,7 @@ class Game: return options = ["New Game", "Quit"] - if os.path.exists("saves"): + if os.path.exists("saves") and not os.path.exists("WEB_VERSION"): options.insert(0, "Load Game") print("Welcome to Whiskerbound!") choice = ui.select("Please choose an option", choices=options)