diff --git a/Toby Doom Launcher.py b/Toby Doom Launcher.py index 3990d73..1c6d537 100755 --- a/Toby Doom Launcher.py +++ b/Toby Doom Launcher.py @@ -2516,33 +2516,29 @@ class DoomLauncher(QMainWindow): self.launch_game(gameFiles, gameFlags) def load_custom_games(self) -> Dict[str, dict]: - """Load all custom game configurations""" + """Load all custom game configurations from all available TobyCustom directories""" customGames = {} if platform.system() == "Windows": - customDir = Path.cwd() / "TobyCustom" + customDirs = [Path.cwd() / "TobyCustom"] else: - pathList = [ + customDirs = [ Path(__file__).parent / "TobyCustom", self.gamePath / "TobyCustom", Path(os.path.expanduser("~/.local/share/doom/TobyCustom")) ] - # Use first existing path or fall back to original - customDir = next( - (path for path in pathList if path.exists()), - Path(__file__).parent / "TobyCustom" - ) + # Search all existing TobyCustom directories + for customDir in customDirs: + if not customDir.exists(): + continue - if not customDir.exists(): - return customGames - - for json_file in customDir.glob("*.json"): - try: - with open(json_file, 'r') as f: - game_config = json.load(f) - customGames[game_config['name']] = game_config - except Exception as e: - print(f"Error loading custom game {json_file}: {e}") + for json_file in customDir.glob("*.json"): + try: + with open(json_file, 'r') as f: + game_config = json.load(f) + customGames[game_config['name']] = game_config + except Exception as e: + print(f"Error loading custom game {json_file}: {e}") return customGames