Few fixes for custom music addons.

This commit is contained in:
Storm Dragon
2025-09-04 14:54:05 -04:00
parent 380bb2ba81
commit 08be529a33
+50 -4
View File
@@ -1526,8 +1526,31 @@ class DoomLauncher(QMainWindow):
if fullPath.exists(): if fullPath.exists():
gameFiles.append(str(fullPath)) gameFiles.append(str(fullPath))
# Add optional files last (only first one found, for priority) # Add music files with custom music mod priority
for optFile in config.get('optional_files', []): optional_files = config.get('optional_files', [])
music_added = False
# Check if any optional files are music-related (contain metal/music keywords)
has_music_optionals = any('metal' in opt.lower() or 'music' in opt.lower() for opt in optional_files)
if has_music_optionals:
# First try to find custom music mod (highest priority)
customMusicMod = self.find_custom_music_mod()
if customMusicMod:
gameFiles.append(str(customMusicMod))
music_added = True
else:
# Fall back to standard optional files priority
for optFile in optional_files:
optPath = self.gamePath / optFile
if optPath.exists():
gameFiles.append(str(optPath))
music_added = True
break
# Add any remaining non-music optional files
if not music_added:
for optFile in optional_files:
optPath = self.gamePath / optFile optPath = self.gamePath / optFile
if optPath.exists(): if optPath.exists():
gameFiles.append(str(optPath)) gameFiles.append(str(optPath))
@@ -2610,8 +2633,31 @@ class DoomLauncher(QMainWindow):
if fullPath.exists(): if fullPath.exists():
gameFiles.append(str(fullPath)) gameFiles.append(str(fullPath))
# Add optional files last (only first one found, for priority) # Add music files with custom music mod priority
for optFile in config.get('optional_files', []): optional_files = config.get('optional_files', [])
music_added = False
# Check if any optional files are music-related (contain metal/music keywords)
has_music_optionals = any('metal' in opt.lower() or 'music' in opt.lower() for opt in optional_files)
if has_music_optionals:
# First try to find custom music mod (highest priority)
customMusicMod = self.find_custom_music_mod()
if customMusicMod:
gameFiles.append(str(customMusicMod))
music_added = True
else:
# Fall back to standard optional files priority
for optFile in optional_files:
optPath = self.gamePath / optFile
if optPath.exists():
gameFiles.append(str(optPath))
music_added = True
break
# Add any remaining non-music optional files
if not music_added:
for optFile in optional_files:
optPath = self.gamePath / optFile optPath = self.gamePath / optFile
if optPath.exists(): if optPath.exists():
gameFiles.append(str(optPath)) gameFiles.append(str(optPath))