From b9d4b63a4feae357772dee73d56c155f8cb45343 Mon Sep 17 00:00:00 2001 From: Jaka Date: Sun, 10 Oct 2021 23:21:10 +0200 Subject: [PATCH] Fixed the bugs with different installation options addition --- deploy.py | 6 ++-- main.py | 18 +++++++--- source/filelist_template.xml | 41 ++++++++++++++++++++-- source/sunken_tapes_style_ita_template.xml | 2 +- source/sunken_tapes_style_template.xml | 2 +- source/sunken_tapes_template.xml | 16 ++++----- 6 files changed, 65 insertions(+), 20 deletions(-) diff --git a/deploy.py b/deploy.py index 8577bf7..5a27864 100644 --- a/deploy.py +++ b/deploy.py @@ -224,7 +224,7 @@ def build_xml_code(data, config): with open("./build/sunken_tapes_style.xml", "w+", encoding="utf8") as output_file: # render the template - output_file.write(template2.render(tapes=data)) + output_file.write(template2.render(tapes=data, config=config)) def deploy(config): @@ -245,9 +245,9 @@ def deploy(config): build_xml_code(data, config) if config["override_workshop"]: - mod_directory = "Mods/Sunken Tapes via Installer/" + mod_directory = "/Mods/Sunken Tapes/" else: - mod_directory = "Mods/Sunken Tapes/" + mod_directory = "/Mods/Sunken Tapez/" logging.info(f"removing the old installed mod directory {config['installdir'] + mod_directory}") rmfulldir(config["installdir"] + mod_directory) diff --git a/main.py b/main.py index e7beb4f..23fc70e 100644 --- a/main.py +++ b/main.py @@ -128,16 +128,26 @@ def create_deploy_frame(container, config): config_values = {"installdir": config["installdir"].get(), "use_ita": config["use_ita"].get() == "1", "buffs": config["buffs"].get() == "1", + "override_workshop": config["override_workshop"].get() == "1", "resolution_x": int(config["resolution_x"].get()), - "resolution_y": int(config["resolution_x"].get())} + "resolution_y": int(config["resolution_y"].get())} logging.info(f"deploying with config: {config_values}") deploy(config_values) + if config_values["override_workshop"]: + mod_name = "Sunken Tapes" + note = "" + else: + mod_name = "Sunken Tapez" + note = '\n\nThis is a custom version and is named with Z (Sunken Tapez) to differentiate it from ' \ + + 'the Steam Workshop version that would overwrite it otherwise.' + showinfo(title='Success!', - message=f'Sunken Tapes was successfully installed to:' + message=f'{mod_name} was successfully installed to:' f'\n{config["installdir"].get()}' - f'\n\nThis installer will now close.') + f'\n\nThis installer will now close.' + f'{note}') container.destroy() @@ -232,7 +242,7 @@ def create_main_window(): "buffs": buffs, "override_workshop": override_workshop, "resolution_x": width, - "resolution_y": height_workshop} + "resolution_y": height} deploy_frame = create_deploy_frame(root, config) diff --git a/source/filelist_template.xml b/source/filelist_template.xml index 5b5941d..d6f144e 100644 --- a/source/filelist_template.xml +++ b/source/filelist_template.xml @@ -1,5 +1,40 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/sunken_tapes_style_ita_template.xml b/source/sunken_tapes_style_ita_template.xml index fe8f4a1..8bfc180 100644 --- a/source/sunken_tapes_style_ita_template.xml +++ b/source/sunken_tapes_style_ita_template.xml @@ -180,7 +180,7 @@ {% for tape in tapes %} - + {% endfor %} diff --git a/source/sunken_tapes_style_template.xml b/source/sunken_tapes_style_template.xml index 7cb5d62..7549b7c 100644 --- a/source/sunken_tapes_style_template.xml +++ b/source/sunken_tapes_style_template.xml @@ -180,7 +180,7 @@ {% for tape in tapes %} - + {% endfor %} diff --git a/source/sunken_tapes_template.xml b/source/sunken_tapes_template.xml index 858eda1..3234bd1 100644 --- a/source/sunken_tapes_template.xml +++ b/source/sunken_tapes_template.xml @@ -12,8 +12,8 @@ - - + + @@ -22,7 +22,7 @@ - +