From aace0e6ac0b45bc2fec8285cf97074cf679562c6 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sat, 20 Nov 2021 18:31:01 +0100 Subject: [PATCH] removed "nothread" function to use normal one instead --- source/Game.py | 10 +--------- source/Gui.py | 11 ++++------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/source/Game.py b/source/Game.py index 6daac88..c77703d 100644 --- a/source/Game.py +++ b/source/Game.py @@ -150,10 +150,6 @@ class Game: self.region_ID = self.game_ID[3] self.region = region_id_to_name[self.region_ID] if self.region_ID in region_id_to_name else self.region - @in_thread - def install_mod(self): - self.nothread_install_mod() - def count_patch_subfile_operation(self) -> int: """ count all the step patching subfile will take (for the progress bar) @@ -302,7 +298,7 @@ class Game: self.gui.progress(statut=self.gui.translate("Converting to", " ", output_format), add=1) self.convert_to(output_format) - def nothread_install_mod(self) -> None: + def install_mod(self) -> None: """ Patch the game to install the mod """ @@ -423,11 +419,7 @@ class Game: finalise(f"./file/Common_{bmglang}.txt", bmgcommon) finalise(f"./file/Common_R{bmglang}.txt", rbmgcommon) - @in_thread def patch_file(self): - self.nothread_patch_file() - - def nothread_patch_file(self): """ Prepare all files to install the mod (track, bmg text, descriptive image, ...) """ diff --git a/source/Gui.py b/source/Gui.py index b4639ee..e76e191 100644 --- a/source/Gui.py +++ b/source/Gui.py @@ -184,10 +184,7 @@ class Gui: self.frame_game_path_action.grid(row=2, column=1, columnspan=2, sticky="NEWS") self.frame_game_path_action.columnconfigure(1, weight=1) - @in_thread - def use_path(): nothread_use_path() - - def nothread_use_path(): + def use_path(): try: game_path = entry_game_path.get() if not os.path.exists(game_path): raise InvalidGamePath @@ -213,9 +210,9 @@ class Gui: @in_thread def do_everything(): - nothread_use_path() - self.game.nothread_patch_file() - self.game.nothread_install_mod() + use_path() + self.game.patch_file() + self.game.install_mod() self.button_do_everything = Button(self.frame_game_path_action, text=self.translate("Install mod"), relief=RIDGE, command=do_everything) self.button_do_everything.grid(row=1, column=1, columnspan=2, sticky="NEWS")