From 8f525cbe5f9a5809fb9a33dd0f180e8bbecf8d89 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sat, 20 Nov 2021 18:17:59 +0100 Subject: [PATCH] add the name of the actual mod version at in the ROM name --- source/Game.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/Game.py b/source/Game.py index 80fe01c..6daac88 100644 --- a/source/Game.py +++ b/source/Game.py @@ -108,7 +108,7 @@ class Game: :param format: game format (ISO, WBFS, ...) """ if format in ["ISO", "WBFS", "CISO"]: - path_game_format: str = os.path.realpath(self.path + "/../MKWFaraphel." + format.lower()) + path_game_format: str = os.path.realpath(self.path + f"/../MKWFaraphel v{self.ctconfig.version}." + format.lower()) wit.copy(src_path=self.path, dst_path=path_game_format, format=format) shutil.rmtree(self.path) self.path = path_game_format @@ -125,11 +125,10 @@ class Game: elif self.extension in ["ISO", "WBFS", "CSIO"]: # Fiding a directory name that doesn't already exist - directory_name, i = "MKWiiFaraphel", 1 - while True: - path_dir = os.path.realpath(self.path + f"/../{directory_name}") - if not (os.path.exists(path_dir)): break - directory_name, i = f"MKWiiFaraphel ({i})", i + 1 + path_dir = get_next_available_dir( + parent_dir=self.path + f"/../", + dir_name=f"MKWiiFaraphel v{self.ctconfig.version}" + ) wit.extract(file=self.path, dst_dir=path_dir)