add optional TobyCustom path to ~/.local/share/doom/TobyCustom.

This commit is contained in:
Storm Dragon
2025-10-10 03:58:01 -04:00
parent d8abcc4cca
commit fd8aac0de1
+6 -10
View File
@@ -2516,25 +2516,21 @@ 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():
return customGames
continue
for json_file in customDir.glob("*.json"):
try: