Disable saving for web version
This commit is contained in:
13
data/save.py
13
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")
|
||||
|
||||
Reference in New Issue
Block a user