From aaa244678ae5353c9428b647ddc66d1d67c42502 Mon Sep 17 00:00:00 2001 From: NCLanceman Date: Tue, 18 Nov 2025 23:16:30 -0600 Subject: [PATCH] loading works --- doomstarter.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/doomstarter.py b/doomstarter.py index c9e2d56..b446af3 100644 --- a/doomstarter.py +++ b/doomstarter.py @@ -52,7 +52,7 @@ def mapSettingsRead(mainDict, maps): mainDict["maps"].update({tempName: tempDict}) tempDict = {} counter = counter + 1 - tempDict["filename"] = maps[i] + tempDict["filename"] = "./maps/" + maps[i] else: temp = maps[i][2:].split("=") tempDict.update({temp[0]: temp[1]}) @@ -63,6 +63,29 @@ def mapSettingsRead(mainDict, maps): return mainDict +def gameplaySettingsRead(mainDict, game): + tempDict = {} + counter = 0 + for i in range(len(game)): + tempName = "gameplay" + str(counter).zfill(2) + print("Examining " + game[i]) + + if (game[i][:2] != "--"): + if len(tempDict) != 0: + mainDict["gameplay"].update({tempName: tempDict}) + tempDict = {} + counter = counter + 1 + tempDict["filename"] = "./gameplay/" + game[i] + else: + temp = game[i][2:].split("=") + tempDict.update({temp[0]: temp[1]}) + + if len(tempDict) != 0: + mainDict["gameplay"].update({tempName: tempDict}) + + return mainDict + + # Dynamic Introduction! print("So it looks like you wanna play some fuckin\' DOOM!") print("Checking current directories...") @@ -147,15 +170,14 @@ else: print("Listing everything in Maps...") print(os.listdir("./maps/")) - # TODO: Add maps to main dict - # Read information from the settings file print("Adding maps to the main dict...") settingsDict = mapSettingsRead(settingsDict, mapsSettings) print("Listing everything in Gameplay...") print(os.listdir("./gameplay/")) # TODO: Add gameplay WADS to main dict + settingsDict = gameplaySettingsRead(settingsDict, gameplaySettings) print("Listing everything in Misc...") print(os.listdir("./misc/"))