Skip to content

Commit

Permalink
Update dank.tool.py
Browse files Browse the repository at this point in the history
- fix
  • Loading branch information
SirDank committed Jul 29, 2024
1 parent acb36ea commit 804e834
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions __src__/dank.tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def dank_tool_settings():

while True:

cls(); print(clr(f"\n - Settings: [ {_translate('restart for changes to take effect')} ]\n\n - dank.tool run counter: {runs}\n\n - do not use: offline-src, offline-mode, dev-branch!\n\n [0] Return to menu"))
cls(); print(clr(f"\n - Settings: [ {_translate('restart for changes to take effect')} ]\n\n - dank.tool run counter: {runs}\n\n - {_translate('do not use')}: offline-src, offline-mode, dev-branch!\n\n [0] {_translate('Return to menu')}"))

with open("settings.json", "r", encoding="utf-8") as file:
settings = json.loads(file.read())
Expand All @@ -534,31 +534,30 @@ def dank_tool_settings():
if not choice: break
settings = list(settings.items())
setting_key = settings[choice - 1][0]
setting_value = int(settings[choice - 1][1])
settings[choice - 1] = (setting_key, str(int(not setting_value)))
settings[choice - 1] = (setting_key, str(int(not int(settings[choice - 1][1]))))
settings = dict(settings)

if setting_value:
if int(settings[setting_key]):
match setting_key:
case "force-startup-audio" | "disable-startup-audio" | "force-translate" | "disable-translate":
with open(setting_key, "w", encoding="utf-8") as file:
file.write("")
if "force" in setting_key:
setting_key = setting_key.replace('force', 'disable')
if os.path.exists(setting_key):
if os.path.isfile(setting_key):
os.remove(setting_key)
settings[setting_key] = "0"
elif "disable" in setting_key:
setting_key = setting_key.replace('disable', 'force')
if os.path.exists(setting_key):
if os.path.isfile(setting_key):
os.remove(setting_key)
settings[setting_key] = "0"

case "compatibility-mode":
with open("compatibility-mode", "w", encoding="utf-8") as file:
file.write("")
else:
if os.path.exists(setting_key):
if os.path.isfile(setting_key):
os.remove(setting_key)

with open("settings.json", "w", encoding="utf-8") as file:
Expand Down

0 comments on commit 804e834

Please sign in to comment.