Few fixes for custom music addons.
This commit is contained in:
@@ -1526,12 +1526,35 @@ class DoomLauncher(QMainWindow):
|
||||
if fullPath.exists():
|
||||
gameFiles.append(str(fullPath))
|
||||
|
||||
# Add optional files last (only first one found, for priority)
|
||||
for optFile in config.get('optional_files', []):
|
||||
optPath = self.gamePath / optFile
|
||||
if optPath.exists():
|
||||
gameFiles.append(str(optPath))
|
||||
break # Only add the first optional file found
|
||||
# Add music files with custom music mod priority
|
||||
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
|
||||
if optPath.exists():
|
||||
gameFiles.append(str(optPath))
|
||||
break # Only add the first optional file found
|
||||
|
||||
# Get any custom flags
|
||||
gameFlags = config.get('flags', [])
|
||||
@@ -2610,12 +2633,35 @@ class DoomLauncher(QMainWindow):
|
||||
if fullPath.exists():
|
||||
gameFiles.append(str(fullPath))
|
||||
|
||||
# Add optional files last (only first one found, for priority)
|
||||
for optFile in config.get('optional_files', []):
|
||||
optPath = self.gamePath / optFile
|
||||
if optPath.exists():
|
||||
gameFiles.append(str(optPath))
|
||||
break # Only add the first optional file found
|
||||
# Add music files with custom music mod priority
|
||||
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
|
||||
if optPath.exists():
|
||||
gameFiles.append(str(optPath))
|
||||
break # Only add the first optional file found
|
||||
|
||||
# Get any custom flags
|
||||
gameFlags = config.get('flags', [])
|
||||
|
Reference in New Issue
Block a user