add optional TobyCustom path to ~/.local/share/doom/TobyCustom.
This commit is contained in:
+6
-10
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user