Fixed a but with how files were loaded. This should improve both game sounds and the reliability of the near by object reporting.

This commit is contained in:
Storm Dragon
2025-08-13 17:18:41 -04:00
parent f1e197729a
commit 96fc322d6e
+47 -40
View File
@@ -2089,21 +2089,8 @@ class DoomLauncher(QMainWindow):
use_funny_pack: Whether to use the Funny Pack instead of normal monsters use_funny_pack: Whether to use the Funny Pack instead of normal monsters
""" """
addonFiles = [] addonFiles = []
# MENU addons in specific order for V9.0
menuPath = self.gamePath / "Addons" / "MENU" # Game specific addons first (following bat file order)
if menuPath.exists():
# Add menu files in order
menu_addons = [
"TobyV9_SimpleMenu.pk3",
f"TobySoundDirectory_{game_type}.pk3"
]
for addon in menu_addons:
addon_path = menuPath / addon
if addon_path.exists():
addonFiles.append(str(addon_path))
# Game specific addons
gamePath = self.gamePath / "Addons" / game_type gamePath = self.gamePath / "Addons" / game_type
if gamePath.exists(): if gamePath.exists():
if game_type == "HERETIC": if game_type == "HERETIC":
@@ -2135,7 +2122,7 @@ class DoomLauncher(QMainWindow):
if addon_path.exists(): if addon_path.exists():
addonFiles.append(str(addon_path)) addonFiles.append(str(addon_path))
else: # DOOM else: # DOOM
# Add Doom addons in specific order for V9.0 # Add Doom addons in specific order matching bat file
doom_addons = [ doom_addons = [
"TobyV8_Guns.pk3", "TobyV8_Guns.pk3",
"TobyV7_Monsters.pk3" if not use_funny_pack else None, "TobyV7_Monsters.pk3" if not use_funny_pack else None,
@@ -2163,10 +2150,20 @@ class DoomLauncher(QMainWindow):
"Funny Pack Missing", "Funny Pack Missing",
f"Toby_Funny_Pack.pk3 not found in {aprilPath}. Please make sure it's installed correctly in the Addons/APRIL folder." f"Toby_Funny_Pack.pk3 not found in {aprilPath}. Please make sure it's installed correctly in the Addons/APRIL folder."
) )
else:
# Normal behavior for non-Funny Pack games # MENU addons after game addons (following bat file order)
pattern = "Toby*.pk3" menuPath = self.gamePath / "Addons" / "MENU"
addonFiles.extend(str(p) for p in gamePath.glob(pattern)) if menuPath.exists():
# Add menu files in order
menu_addons = [
"TobyV9_SimpleMenu.pk3",
f"TobySoundDirectory_{game_type}.pk3"
]
for addon in menu_addons:
addon_path = menuPath / addon
if addon_path.exists():
addonFiles.append(str(addon_path))
return addonFiles return addonFiles
@@ -2183,35 +2180,45 @@ class DoomLauncher(QMainWindow):
# Determine game type and get corresponding addons # Determine game type and get corresponding addons
if "Heretic" in selectedGame: if "Heretic" in selectedGame:
gameType = "HERETIC" gameType = "HERETIC"
elif "Hexen" in selectedGame:
gameType = "HEXEN"
else: # Doom games
gameType = "DOOM"
# Get game-specific addons first (following bat file order)
baseFiles.extend(self.get_addon_files(gameType, isFunnyPack))
# Then add maps and other game-specific files
if "Heretic" in selectedGame:
if "Toby Heretic" in selectedGame: if "Toby Heretic" in selectedGame:
baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyHereticLevels.wad")) baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyHereticLevels.wad"))
elif "Hexen" in selectedGame: elif "Hexen" in selectedGame:
gameType = "HEXEN"
if "Toby Hexen" in selectedGame: if "Toby Hexen" in selectedGame:
baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyHexen.pk3")) baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyHexen.pk3"))
else: # Doom games else: # Doom games
gameType = "DOOM" if "OperationMDK" in selectedGame:
if "Toby Doom" in selectedGame:
baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyDoomLevels.pk3"))
musicRenamer = self.gamePath / "Toby-Doom-Level-Music-Renamer.pk3"
if musicRenamer.exists() and not isFunnyPack:
baseFiles.append(str(musicRenamer))
elif "OperationMDK" in selectedGame:
baseFiles.append(str(self.gamePath / "OpMDK.wad")) baseFiles.append(str(self.gamePath / "OpMDK.wad"))
if not isFunnyPack: if "Toby Doom" in selectedGame:
metalV10 = self.gamePath / "DOOM Metal X IDKFA Soundtrack.pk3" baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyDoomLevels.pk3"))
metalV7 = self.gamePath / "DoomMetalVol7.wad"
metalV6 = self.gamePath / "DoomMetalVol6.wad" # Add music files at the end for Doom games
if metalV10.exists(): if gameType == "DOOM" and not isFunnyPack:
baseFiles.append(str(metalV10)) metalV10 = self.gamePath / "DOOM Metal X IDKFA Soundtrack.pk3"
elif metalV7.exists(): metalV7 = self.gamePath / "DoomMetalVol7.wad"
baseFiles.append(str(metalV7)) metalV6 = self.gamePath / "DoomMetalVol6.wad"
elif metalV6.exists(): if metalV10.exists():
baseFiles.append(str(metalV6)) baseFiles.append(str(metalV10))
elif metalV7.exists():
baseFiles.append(str(metalV7))
elif metalV6.exists():
baseFiles.append(str(metalV6))
if "Toby Doom" in selectedGame:
musicRenamer = self.gamePath / "Toby-Doom-Level-Music-Renamer.pk3"
if musicRenamer.exists():
baseFiles.append(str(musicRenamer))
# Get game-specific addons (but we'll modify if it's Funny Pack)
baseFiles.extend(self.get_addon_files(gameType, isFunnyPack))
return baseFiles return baseFiles
def show_custom_deathmatch_dialog(self): def show_custom_deathmatch_dialog(self):