|
|
@ -15,21 +15,46 @@ def menuPrinter(list): |
|
|
print(str(i) + ": " + list[i]) |
|
|
print(str(i) + ": " + list[i]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def mapSettingsRead(mainDict): |
|
|
# TODO: Make a single function that reads settings |
|
|
|
|
|
def sourcePortSettingsRead(mainDict, ports): |
|
|
tempDict = {} |
|
|
tempDict = {} |
|
|
counter = 0 |
|
|
counter = 0 |
|
|
for i in range(len(mapsSettings)): |
|
|
for i in range(len(ports)): |
|
|
|
|
|
tempName = "port" + str(counter).zfill(2) |
|
|
|
|
|
print("Examining " + ports[i]) |
|
|
|
|
|
|
|
|
|
|
|
if (ports[i][:2] != "--"): |
|
|
|
|
|
if len(tempDict) != 0: |
|
|
|
|
|
mainDict["sourcePorts"].update({tempName: tempDict}) |
|
|
|
|
|
tempDict = {} |
|
|
|
|
|
counter = counter + 1 |
|
|
|
|
|
tempDict["title"] = ports[i] |
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
|
|
|
temp = ports[i][2:].split("=") |
|
|
|
|
|
tempDict.update({temp[0]: temp[1]}) |
|
|
|
|
|
|
|
|
|
|
|
if len(tempDict) != 0: |
|
|
|
|
|
mainDict["sourcePorts"].update({tempName: tempDict}) |
|
|
|
|
|
|
|
|
|
|
|
return mainDict |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def mapSettingsRead(mainDict, maps): |
|
|
|
|
|
tempDict = {} |
|
|
|
|
|
counter = 0 |
|
|
|
|
|
for i in range(len(maps)): |
|
|
tempName = "map" + str(counter).zfill(2) |
|
|
tempName = "map" + str(counter).zfill(2) |
|
|
print("Examining " + mapsSettings[i]) |
|
|
print("Examining " + maps[i]) |
|
|
|
|
|
|
|
|
if (mapsSettings[i][:2] != "--"): |
|
|
if (maps[i][:2] != "--"): |
|
|
if len(tempDict) != 0: |
|
|
if len(tempDict) != 0: |
|
|
settingsDict["maps"].update({tempName: tempDict}) |
|
|
mainDict["maps"].update({tempName: tempDict}) |
|
|
tempDict = {} |
|
|
tempDict = {} |
|
|
counter = counter + 1 |
|
|
counter = counter + 1 |
|
|
tempDict["filename"] = mapsSettings[i] |
|
|
tempDict["filename"] = maps[i] |
|
|
else: |
|
|
else: |
|
|
temp = mapsSettings[i][2:].split("=") |
|
|
temp = maps[i][2:].split("=") |
|
|
tempDict.update({temp[0]: temp[1]}) |
|
|
tempDict.update({temp[0]: temp[1]}) |
|
|
|
|
|
|
|
|
if len(tempDict) != 0: |
|
|
if len(tempDict) != 0: |
|
|
@ -117,13 +142,16 @@ else: |
|
|
# subprocess.run(sourceport_dict["Woof"]["runcommand"], shell=True) |
|
|
# subprocess.run(sourceport_dict["Woof"]["runcommand"], shell=True) |
|
|
|
|
|
|
|
|
# List all that stuff in a file |
|
|
# List all that stuff in a file |
|
|
|
|
|
print("Addings Source Ports from Settings file...") |
|
|
|
|
|
settingsDict = sourcePortSettingsRead(settingsDict, sourceSettings) |
|
|
|
|
|
|
|
|
print("Listing everything in Maps...") |
|
|
print("Listing everything in Maps...") |
|
|
print(os.listdir("./maps/")) |
|
|
print(os.listdir("./maps/")) |
|
|
# TODO: Add maps to main dict |
|
|
# TODO: Add maps to main dict |
|
|
|
|
|
|
|
|
# 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...") |
|
|
settingsDict = mapSettingsRead(settingsDict) |
|
|
settingsDict = mapSettingsRead(settingsDict, mapsSettings) |
|
|
|
|
|
|
|
|
print("Listing everything in Gameplay...") |
|
|
print("Listing everything in Gameplay...") |
|
|
print(os.listdir("./gameplay/")) |
|
|
print(os.listdir("./gameplay/")) |
|
|
|