progress bar path are now relative to the extracted game path

This commit is contained in:
Faraphel 2022-08-27 20:09:36 +02:00
parent 6fe1223c8b
commit 162e56b1e0
5 changed files with 9 additions and 6 deletions

View file

@ -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",

View file

@ -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:

View file

@ -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()))

View file

@ -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

View file

@ -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