Skip to content

Commit

Permalink
More explanation and default settings option
Browse files Browse the repository at this point in the history
  • Loading branch information
Krummers committed Nov 12, 2023
1 parent 85eb2e1 commit 1866249
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Patcher/Intermezzo_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def main():
print("Current settings: ")
for setting, x in zip(cs.settings, range(len(cs.settings))):
print(f"{chr(x + 65)}. {fl.CFG(os.path.join(settings.path, setting + '.cfg'))}")
print("S. Set default settings")
print("X. Exit the menu")

setting = str(input("Which setting should be edited? (Enter the corresponding letter): ")).upper()
Expand All @@ -22,8 +23,9 @@ def main():
case "A":
cfg = fl.CFG(os.path.join(settings.path, "directory.cfg"))
print("The current value is:", cfg.get_value())
print("This directory is the location the new build gets moved to after the patcher has finished.")
drive = ft.drive_selection()
print(f"Enter the directory where the files should be moved to after patching, separated by the {os.sep} character.")
print(f"Enter the directory separated by the {os.sep} character.")
print("Do not include the drive name. Start with the first folder of your directory.")
print(f"For example, the directory {drive}{os.sep}Users{os.sep}admin{os.sep}Documents would be entered as Users{os.sep}admin{os.sep}Documents.")

Expand All @@ -44,8 +46,9 @@ def main():
case "B":
cfg = fl.CFG(os.path.join(settings.path, "downloads.cfg"))
print("The current value is:", cfg.get_value())
print("This directory is the folder that gets checked for recently downloaded patch2.tar.")
drive = ft.drive_selection()
print(f"Enter the directory that should be scanned for downloaded patches, separated by the {os.sep} character.")
print(f"Enter the directory separated by the {os.sep} character.")
print("Do not include the drive name. Start with the first folder of your directory.")
print(f"For example, the directory {drive}{os.sep}Users{os.sep}admin{os.sep}Downloads would be entered as Users{os.sep}admin{os.sep}Downloads.")

Expand All @@ -66,27 +69,31 @@ def main():
case "C":
cfg = fl.CFG(os.path.join(settings.path, "iso-rename.cfg"))
print("The current value is:", cfg.get_value())
print("This option renames the ISO to something more recognisable.")
iso_rename = ft.question("Rename an ISO after patching?")

cfg.set_value(iso_rename)
ft.clear_screen()
case "D":
cfg = fl.CFG(os.path.join(settings.path, "overwrite-perm.cfg"))
print("The current value is:", cfg.get_value())
print("This option allows the patcher to overwrite files.")
overwrite_perm = ft.question("Allow files to be overwritten?")

cfg.set_value(overwrite_perm)
ft.clear_screen()
case "E":
cfg = fl.CFG(os.path.join(settings.path, "perf-monitor.cfg"))
print("The current value is:", cfg.get_value())
print("This option enables the performance monitor.")
perf_monitor = ft.question("Enable the performance monitor?")

cfg.set_value(perf_monitor)
ft.clear_screen()
case "F":
cfg = fl.CFG(os.path.join(settings.path, "pref-language.cfg"))
print("The current value is:", cfg.get_value())
print("This option is the preferred language. If any language patch gets found during the installation process, it will pick this language.")

for identifier in cs.identifiers:
print(identifier, ". ", cs.languages[cs.identifiers.index(identifier)], sep = "")
Expand All @@ -104,17 +111,27 @@ def main():
case "G":
cfg = fl.CFG(os.path.join(settings.path, "pycache.cfg"))
print("The current value is:", cfg.get_value())
print("The \"__pycache__\" folder gets generated by Python for caching purposes. This option deletes it after patching.")
delete_pycache = ft.question("Delete the \"__pycache__\" folder after patching?")

cfg.set_value(delete_pycache)
ft.clear_screen()
case "H":
cfg = fl.CFG(os.path.join(settings.path, "riivo-suffix.cfg"))
print("The current value is:", cfg.get_value())
print("This option renames a Riivolution build so two or more can be installed at once.")
riivo_suffix = ft.question("Add a suffix to Riivolution builds after patching?")

cfg.set_value(riivo_suffix)
ft.clear_screen()
case "S":
standard = ft.question("Enter default settings?")
if standard:
standards = [cwd, cwd, True, True, True, "N", True, False]
for value, setting in zip(standards, cs.settings):
cfg = fl.CFG(os.path.join(settings.path, f"{setting}.cfg"))
cfg.set_value(value)
ft.clear_screen()
case "X":
break
case _:
Expand Down

0 comments on commit 1866249

Please sign in to comment.