removed "nothread" function to use normal one instead

This commit is contained in:
raphael60650 2021-11-20 18:31:01 +01:00
parent 6304a88d95
commit aace0e6ac0
2 changed files with 5 additions and 16 deletions

View file

@ -150,10 +150,6 @@ class Game:
self.region_ID = self.game_ID[3] 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 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: def count_patch_subfile_operation(self) -> int:
""" """
count all the step patching subfile will take (for the progress bar) 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.gui.progress(statut=self.gui.translate("Converting to", " ", output_format), add=1)
self.convert_to(output_format) self.convert_to(output_format)
def nothread_install_mod(self) -> None: def install_mod(self) -> None:
""" """
Patch the game to install the mod Patch the game to install the mod
""" """
@ -423,11 +419,7 @@ class Game:
finalise(f"./file/Common_{bmglang}.txt", bmgcommon) finalise(f"./file/Common_{bmglang}.txt", bmgcommon)
finalise(f"./file/Common_R{bmglang}.txt", rbmgcommon) finalise(f"./file/Common_R{bmglang}.txt", rbmgcommon)
@in_thread
def patch_file(self): 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, ...) Prepare all files to install the mod (track, bmg text, descriptive image, ...)
""" """

View file

@ -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.grid(row=2, column=1, columnspan=2, sticky="NEWS")
self.frame_game_path_action.columnconfigure(1, weight=1) self.frame_game_path_action.columnconfigure(1, weight=1)
@in_thread def use_path():
def use_path(): nothread_use_path()
def nothread_use_path():
try: try:
game_path = entry_game_path.get() game_path = entry_game_path.get()
if not os.path.exists(game_path): raise InvalidGamePath if not os.path.exists(game_path): raise InvalidGamePath
@ -213,9 +210,9 @@ class Gui:
@in_thread @in_thread
def do_everything(): def do_everything():
nothread_use_path() use_path()
self.game.nothread_patch_file() self.game.patch_file()
self.game.nothread_install_mod() 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 = 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") self.button_do_everything.grid(row=1, column=1, columnspan=2, sticky="NEWS")