From 162e56b1e0b0d6157411f2d0300066c6285144fe Mon Sep 17 00:00:00 2001 From: Faraphel Date: Sat, 27 Aug 2022 20:09:36 +0200 Subject: [PATCH] progress bar path are now relative to the extracted game path --- assets/language/en.json | 2 +- source/gui/install.py | 6 ++++-- source/mkw/ExtractedGame.py | 3 ++- source/mkw/Patch/PatchDirectory.py | 2 +- source/mkw/Patch/PatchFile.py | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/assets/language/en.json b/assets/language/en.json index 59e78eb..9ca462a 100644 --- a/assets/language/en.json +++ b/assets/language/en.json @@ -109,7 +109,7 @@ "SETTINGS_FILE": "Settings file", "EXPORT_SETTINGS": "Export settings", "IMPORT_SETTINGS": "Import settings", - "PREPARING_RIIVOLUTION": "Preparing for riivolution", + "PREPARING_RIIVOLUTION": "Preparing for Riivolution", "CONVERTING_TO_RIIVOLUTION": "Converting to Riivolution patch", "PATCHS": "patchs", "PRE-PATCHS": "pre-patchs", diff --git a/source/gui/install.py b/source/gui/install.py index f0e4b8d..009cf6d 100644 --- a/source/gui/install.py +++ b/source/gui/install.py @@ -428,13 +428,15 @@ class ProgressBar(ttk.LabelFrame): self.progress_bar_part = ttk.Progressbar(self, orient="horizontal") self.progress_bar_part.grid(row=1, column=1, sticky="nsew") - self.title = ttk.Label(self, text="", anchor="center", font=("TkDefaultFont", 10), wraplength=350) + self.title = ttk.Label(self, text="", anchor=tkinter.CENTER, justify=tkinter.CENTER, + font=("TkDefaultFont", 10), wraplength=350) self.title.grid(row=2, column=1, sticky="nsew") self.progress_bar_step = ttk.Progressbar(self, orient="horizontal") self.progress_bar_step.grid(row=3, column=1, sticky="nsew") - self.description = ttk.Label(self, text="", anchor="center", font=("TkDefaultFont", 10), wraplength=350) + self.description = ttk.Label(self, text="", anchor=tkinter.CENTER, justify=tkinter.CENTER, + font=("TkDefaultFont", 10), wraplength=350) self.description.grid(row=4, column=1, sticky="nsew") def set_state(self, state: InstallerState) -> None: diff --git a/source/mkw/ExtractedGame.py b/source/mkw/ExtractedGame.py index 097d891..9469917 100644 --- a/source/mkw/ExtractedGame.py +++ b/source/mkw/ExtractedGame.py @@ -115,7 +115,8 @@ class ExtractedGame: for extracted_szs in filter(lambda path: path.is_dir(), self.path.rglob("*.d")): # for every directory that end with a .d in the extracted game, recreate the szs - yield Progress(description=_("REPACKING", ' "', extracted_szs, '"'), determinate=False) + yield Progress(description=_("REPACKING", ' "', extracted_szs.relative_to(self.path), '"'), + determinate=False) szs.create(extracted_szs, extracted_szs.with_suffix(".szs"), overwrite=True) shutil.rmtree(str(extracted_szs.resolve())) diff --git a/source/mkw/Patch/PatchDirectory.py b/source/mkw/Patch/PatchDirectory.py index 4ba6ae9..1b6c93b 100644 --- a/source/mkw/Patch/PatchDirectory.py +++ b/source/mkw/Patch/PatchDirectory.py @@ -28,7 +28,7 @@ class PatchDirectory(PatchObject): """ patch a subdirectory of the game with the PatchDirectory """ - yield Progress(description=_("PATCHING", " ", game_subpath)) + yield Progress(description=_("PATCHING", ' "', game_subpath.relative_to(extracted_game.path), '"')) # check if the directory should be patched if not self.is_enabled(extracted_game): return diff --git a/source/mkw/Patch/PatchFile.py b/source/mkw/Patch/PatchFile.py index ac715bc..6558f0f 100644 --- a/source/mkw/Patch/PatchFile.py +++ b/source/mkw/Patch/PatchFile.py @@ -82,7 +82,7 @@ class PatchFile(PatchObject): """ patch a subfile of the game with the PatchFile """ - yield Progress(description=translate("PATCHING", " ", game_subpath)) + yield Progress(description=translate("PATCHING", ' "', game_subpath.relative_to(extracted_game.path), '"')) # translate is not renamed "_" here because it is used to drop useless value in unpacking # check if the file should be patched