From ee6836e14df4754c5ec01dfda44ab01c66bea11e Mon Sep 17 00:00:00 2001 From: Luke Horwell Date: Fri, 14 Jun 2024 08:30:07 +0100 Subject: [PATCH] HACK: Make patcher work with Ultimate Collection --- gamefile.py | 1 + sims2_4k_ui_patcher.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gamefile.py b/gamefile.py index e1bb7c7..c283c9c 100644 --- a/gamefile.py +++ b/gamefile.py @@ -57,6 +57,7 @@ def get_game_name(self, file_path) -> str: Identify the game name by going up a directory until we find "filelist.txt", the root of the game installation, and take the name from this directory. """ + return "The Sims 2 Ultimate Collection" path = os.path.realpath(file_path) root_count = len(path.split(os.sep)) while root_count > 2: diff --git a/sims2_4k_ui_patcher.py b/sims2_4k_ui_patcher.py index 60d17c0..55a0689 100755 --- a/sims2_4k_ui_patcher.py +++ b/sims2_4k_ui_patcher.py @@ -231,8 +231,8 @@ def get_all_patchable_files(self) -> list: """ files = [] for filename in ["ui.package", "FontStyle.ini", "CaSIEUI.data"]: - files += glob.glob(os.path.join(self.ea_games_dir, "*Sims 2*", "TSData") + f"/**/{filename}", recursive=True) - return sorted(files) + files += glob.glob(os.path.join(self.ea_games_dir, "*Sims 2*", f"**/**/TSData/**/{filename}"), recursive=True) + return sorted(list(set(files))) def refresh_game_status(self): """