Changed string concatenation methods

pull/11/head
Nicholas Hope 2022-08-02 19:16:35 -04:00
parent 49a23ba3e5
commit 56441229c9
1 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,6 @@
""" Makes the configs as a massive string """
# Used for the conditions in the <double> type
condDict = {}
def makeCFG(cfg):
@ -13,8 +14,8 @@ def makeCFG(cfg):
# Doubles are weird. All of the toggles got put into a dictionary.
# This takes all of the nested dictionaries and turns them into the right string
for key, toggles in condDict.items():
ret += f'alias +{key}_toggles \"{toggles["plus_toggles"]}\"\n' +\
f'alias -{key}_toggles \"{toggles["minus_toggles"]}\"\n' +\
ret += f'alias +{key}_toggles "{toggles["plus_toggles"]}"\n' +\
f'alias -{key}_toggles "{toggles["minus_toggles"]}"\n' +\
f'bind {key} +{key}_toggles\n'
return ret
@ -70,7 +71,7 @@ def impulse(key, instruction):
elif cmd == "build" or cmd == "destroy":
instruction = f"{cmd} "+expandBuildings(restOfCmd)
return f'bind {key} {instruction}\n'
return f'bind {key} "{instruction}"\n'
def voice(keyword):
keyword = keyword.lower()
@ -136,8 +137,8 @@ def double(key, options):
ret = branch(main_str, pBindContent, pBindType) +\
branch(alt_str, sBindContent, sBindType) +\
f'alias +{tog_str} \"bind {key} {alt_str}\"\n' +\
f'alias -{tog_str} \"bind {key} {main_str}\"\n'
f'alias +{tog_str} "bind {key} {alt_str}"\n' +\
f'alias -{tog_str} "bind {key} {main_str}"\n'
cond_name = options["condition"]