|
|
@ -15,40 +15,45 @@ def menuPrinter(list): |
|
|
print(str(i) + ": " + list[i]) |
|
|
print(str(i) + ": " + list[i]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def mapSettingsRead(): |
|
|
def mapSettingsRead(mainDict): |
|
|
tempDict = {} |
|
|
tempDict = {} |
|
|
|
|
|
counter = 0 |
|
|
for i in range(len(mapsSettings)): |
|
|
for i in range(len(mapsSettings)): |
|
|
tempName = "map" + str(i) |
|
|
tempName = "map" + str(counter).zfill(2) |
|
|
print("Examining " + mapsSettings[i]) |
|
|
print("Examining " + mapsSettings[i]) |
|
|
|
|
|
|
|
|
if (mapsSettings[i][:2] != "--"): |
|
|
if (mapsSettings[i][:2] != "--"): |
|
|
if len(tempDict) != 0: |
|
|
if len(tempDict) != 0: |
|
|
settingsDict["maps"].update({tempName: tempDict}) |
|
|
settingsDict["maps"].update({tempName: tempDict}) |
|
|
|
|
|
tempDict = {} |
|
|
|
|
|
counter = counter + 1 |
|
|
tempDict["filename"] = mapsSettings[i] |
|
|
tempDict["filename"] = mapsSettings[i] |
|
|
else: |
|
|
else: |
|
|
temp = mapsSettings[i][2:].split("=") |
|
|
temp = mapsSettings[i][2:].split("=") |
|
|
tempDict.update({temp[0]: temp[1]}) |
|
|
tempDict.update({temp[0]: temp[1]}) |
|
|
|
|
|
|
|
|
if len(tempDict) != 0: |
|
|
if len(tempDict) != 0: |
|
|
settingsDict["maps"].update({tempName: tempDict}) |
|
|
mainDict["maps"].update({tempName: tempDict}) |
|
|
|
|
|
|
|
|
|
|
|
return mainDict |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Dynamic Introduction! |
|
|
# Dynamic Introduction! |
|
|
print("So it looks like you wanna play some fuckin\' DOOM!") |
|
|
print("So it looks like you wanna play some fuckin\' DOOM!") |
|
|
|
|
|
|
|
|
print("Checking current directories...") |
|
|
print("Checking current directories...") |
|
|
# On Start: Check if necessary folders are there |
|
|
# On Start: Check if necessary folders are there |
|
|
# ./gameplay/, ./maps/, ./misc/ |
|
|
# ./gameplay/, ./maps/, ./misc/ |
|
|
if (os.path.isdir('gameplay') == False): |
|
|
# If not, end the program to allow user to add WAD files. |
|
|
|
|
|
if not (os.path.isdir('gameplay') and os.path.isdir('maps') and os.path.isdir('misc')): |
|
|
print("Making Gameplay folder...") |
|
|
print("Making Gameplay folder...") |
|
|
os.mkdir('gameplay') |
|
|
os.mkdir('gameplay') |
|
|
if (os.path.isdir('maps') == False): |
|
|
|
|
|
print("Making Maps folder...") |
|
|
print("Making Maps folder...") |
|
|
os.mkdir('maps') |
|
|
os.mkdir('maps') |
|
|
if (os.path.isdir('misc') == False): |
|
|
|
|
|
print("Making Misc Folder...") |
|
|
print("Making Misc Folder...") |
|
|
os.mkdir('misc') |
|
|
os.mkdir('misc') |
|
|
|
|
|
|
|
|
|
|
|
print("Folders Created! Now go forth and fill them! Return when you are ready to DOOM!") |
|
|
|
|
|
else: |
|
|
# Load Config File |
|
|
# Load Config File |
|
|
settings = ((open("Settings.txt")).read()).splitlines() |
|
|
settings = ((open("Settings.txt")).read()).splitlines() |
|
|
|
|
|
|
|
|
@ -118,7 +123,7 @@ print(os.listdir("./maps/")) |
|
|
|
|
|
|
|
|
# Read information from the settings file |
|
|
# Read information from the settings file |
|
|
print("Adding maps to the main dict...") |
|
|
print("Adding maps to the main dict...") |
|
|
mapSettingsRead() |
|
|
settingsDict = mapSettingsRead(settingsDict) |
|
|
|
|
|
|
|
|
print("Listing everything in Gameplay...") |
|
|
print("Listing everything in Gameplay...") |
|
|
print(os.listdir("./gameplay/")) |
|
|
print(os.listdir("./gameplay/")) |
|
|
|