From e9ca4f02e0d2f35e5b75aecc1eb96d22c530ce37 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 13 Jul 2025 22:04:13 -0400 Subject: [PATCH] More changes for the new version. --- Toby Doom Launcher.py | 148 ++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 47 deletions(-) diff --git a/Toby Doom Launcher.py b/Toby Doom Launcher.py index 093c028..619b721 100755 --- a/Toby Doom Launcher.py +++ b/Toby Doom Launcher.py @@ -1348,28 +1348,27 @@ class DoomLauncher(QMainWindow): if dialog.exec(): values = dialog.get_dialog_values() - # Set up game files - gameFiles = [ - str(self.gamePath / f"TobyAccMod_V{self.tobyVersion}.pk3") - ] - - # Add menu addons - menuPath = self.gamePath / "Addons/MENU" - if menuPath.exists(): - gameFiles.extend(str(p) for p in menuPath.glob("Toby*.pk3")) - - # Add selected mod - gameFiles.append(selectedMod) + # Get base game files (includes TobyAccMod and all addons) + gameFiles = self.get_selected_game_files() + + # Note: selectedMod is already included in base game files via get_selected_game_files() # Add deathmatch map only if checkbox is checked if values.get('use_toby_maps', True): - deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V1-5.wad") + # Add bot spawner menu + botSpawnerMenu = str(self.gamePath / "Addons/MENU/TobyBotSpawnerMenu.pk3") + if Path(botSpawnerMenu).exists(): + gameFiles.append(botSpawnerMenu) + deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V2-0.wad") if Path(deathMatchMap).exists(): gameFiles.append(deathMatchMap) # Get deathmatch flags and add map selection gameFlags = self.get_deathmatch_flags(values) - gameFlags.extend(["-warp", str(mapIndex)]) + if selectedMap.lower() == "lobby": + gameFlags.extend(["+map", "lobby"]) + else: + gameFlags.extend(["-warp", str(mapIndex)]) # Check/set freedm.wad as IWAD freedmPath = self.find_freedm() @@ -1461,7 +1460,7 @@ class DoomLauncher(QMainWindow): mapsDir = self.gamePath / "Addons/MAPS" if mapsDir.exists(): mapFiles.extend([p.name for p in mapsDir.glob("*.wad") - if p.name != "TobyDeathArena_V1-5.wad"]) + if p.name not in ["TobyDeathArena_V1-5.wad", "Toby-Demo-Level.wad"]]) # Add Operation MDK as special case opMDK = self.gamePath / "OpMDK.wad" @@ -1913,6 +1912,7 @@ class DoomLauncher(QMainWindow): """Populate the game selection combo box""" gameList = [ "Toby Demo Map", + "Tutorial", "Funny Pack - Demo Map", "Classic Doom", "Funny Pack - Classic Doom", @@ -1961,28 +1961,67 @@ class DoomLauncher(QMainWindow): use_funny_pack: Whether to use the Funny Pack instead of normal monsters """ addonFiles = [] - # MENU addons are common to all games + # MENU addons in specific order for V9.0 menuPath = self.gamePath / "Addons" / "MENU" if menuPath.exists(): - addonFiles.extend(str(p) for p in menuPath.glob("Toby*.pk3")) + # 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 if gamePath.exists(): if game_type == "HERETIC": - pattern = "TobyHeretic*.pk3" - addonFiles.extend(str(p) for p in gamePath.glob(pattern)) + heretic_addons = [ + "TobyHereticWeaponsV8.pk3", + "TobyHereticMonsters.pk3", + "TobyHereticItemsV8.pk3", + "TobyHereticDecorations.pk3", + "TobyHereticMenu.wad", + "TobyHereticBeacons.pk3" + ] + + for addon in heretic_addons: + addon_path = gamePath / addon + if addon_path.exists(): + addonFiles.append(str(addon_path)) + elif game_type == "HEXEN": - pattern = "TobyHexen*.pk3" - addonFiles.extend(str(p) for p in gamePath.glob(pattern)) + hexen_addons = [ + "TobyHexenWeapons.pk3", + "TobyHexenMonsters.pk3", + "TobyHexenItems.pk3", + "TobyHexenDecorations.pk3", + "TobyHexenMenu.wad" + ] + + for addon in hexen_addons: + addon_path = gamePath / addon + if addon_path.exists(): + addonFiles.append(str(addon_path)) else: # DOOM - # Add normal Doom addons (but skip monster packs if using Funny Pack) + # Add Doom addons in specific order for V9.0 + doom_addons = [ + "TobyV8_Guns.pk3", + "TobyV7_Monsters.pk3" if not use_funny_pack else None, + "TobyV8_Pickups.pk3", + "TobyV8_Decorations.pk3" + ] + + for addon in doom_addons: + if addon: + addon_path = gamePath / addon + if addon_path.exists(): + addonFiles.append(str(addon_path)) + if use_funny_pack: - # Only add non-monster Doom addons - for pk3Path in gamePath.glob("Toby*.pk3"): - if "Monsters" not in pk3Path.name: - addonFiles.append(str(pk3Path)) - # Look for Funny Pack in the APRIL folder aprilPath = self.gamePath / "Addons" / "APRIL" funnyPackPath = aprilPath / "Toby_Funny_Pack.pk3" @@ -2025,7 +2064,9 @@ class DoomLauncher(QMainWindow): else: # Doom games gameType = "DOOM" if "Demo Map" in selectedGame: - baseFiles.append(str(self.gamePath / "Addons/MAPS/Toby-Demo-Level.wad")) + baseFiles.append(str(self.gamePath / "Addons/MAPS/Toby-Demo-Level_V2_ALT.wad")) + elif "Tutorial" in selectedGame: + baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyTutorial-V2.wad")) elif "Toby Doom" in selectedGame: baseFiles.append(str(self.gamePath / "Addons/MAPS/TobyDoomLevels.wad")) musicRenamer = self.gamePath / "Toby-Doom-Level-Music-Renamer.pk3" @@ -2150,28 +2191,27 @@ class DoomLauncher(QMainWindow): if dialog.exec(): values = dialog.get_dialog_values() - # Set up game files - gameFiles = [ - str(self.gamePath / f"TobyAccMod_V{self.tobyVersion}.pk3") - ] - - # Add menu addons - menuPath = self.gamePath / "Addons/MENU" - if menuPath.exists(): - gameFiles.extend(str(p) for p in menuPath.glob("Toby*.pk3")) - - # Add selected mod - gameFiles.append(selectedMod) + # Get base game files (includes TobyAccMod and all addons) + gameFiles = self.get_selected_game_files() + + # Note: selectedMod is already included in base game files via get_selected_game_files() # Add deathmatch map only if checkbox is checked if values.get('use_toby_maps', True): - deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V1-5.wad") + # Add bot spawner menu + botSpawnerMenu = str(self.gamePath / "Addons/MENU/TobyBotSpawnerMenu.pk3") + if Path(botSpawnerMenu).exists(): + gameFiles.append(botSpawnerMenu) + deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V2-0.wad") if Path(deathMatchMap).exists(): gameFiles.append(deathMatchMap) # Get deathmatch flags and add map selection gameFlags = self.get_deathmatch_flags(values) - gameFlags.extend(["-warp", str(mapIndex)]) + if selectedMap.lower() == "lobby": + gameFlags.extend(["+map", "lobby"]) + else: + gameFlags.extend(["-warp", str(mapIndex)]) # Check/set freedm.wad as IWAD freedmPath = self.find_freedm() @@ -2290,7 +2330,7 @@ class DoomLauncher(QMainWindow): mapsDir = self.gamePath / "Addons/MAPS" if mapsDir.exists(): mapFiles.extend([p.name for p in mapsDir.glob("*.wad") - if p.name != "TobyDeathArena_V1-5.wad"]) + if p.name not in ["TobyDeathArena_V1-5.wad", "Toby-Demo-Level.wad"]]) # Add Operation MDK as special case opMDK = self.gamePath / "OpMDK.wad" @@ -2537,13 +2577,20 @@ class DoomLauncher(QMainWindow): # Add deathmatch map only if checkbox is checked if values.get('use_toby_maps', True): - deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V1-5.wad") + # Add bot spawner menu + botSpawnerMenu = str(self.gamePath / "Addons/MENU/TobyBotSpawnerMenu.pk3") + if Path(botSpawnerMenu).exists(): + gameFiles.append(botSpawnerMenu) + deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V2-0.wad") if Path(deathMatchMap).exists(): gameFiles.append(deathMatchMap) gameFlags = self.get_deathmatch_flags(values) # Add map selection flag - gameFlags.extend(["-warp", str(mapIndex)]) + if selectedMap.lower() == "lobby": + gameFlags.extend(["+map", "lobby"]) + else: + gameFlags.extend(["-warp", str(mapIndex)]) # Check/set freedm.wad as IWAD freedmPath = self.find_freedm() @@ -2631,14 +2678,21 @@ class DoomLauncher(QMainWindow): # Add deathmatch map only if checkbox is checked if values.get('use_toby_maps', True): - deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V1-5.wad") + # Add bot spawner menu + botSpawnerMenu = str(self.gamePath / "Addons/MENU/TobyBotSpawnerMenu.pk3") + if Path(botSpawnerMenu).exists(): + gameFiles.append(botSpawnerMenu) + deathMatchMap = str(self.gamePath / "Addons/MAPS/TobyDeathArena_V2-0.wad") if Path(deathMatchMap).exists(): gameFiles.append(deathMatchMap) gameFlags = self.get_deathmatch_flags(values) # Add map selection flag - gameFlags.extend(["-warp", str(mapIndex)]) + if selectedMap.lower() == "lobby": + gameFlags.extend(["+map", "lobby"]) + else: + gameFlags.extend(["-warp", str(mapIndex)]) # Check/set freedm.wad as IWAD freedmPath = self.find_freedm()