Fix Hints toggle on CLI
This commit is contained in:
97
Utils.py
97
Utils.py
@@ -249,43 +249,72 @@ def print_wiki_doors_by_region(d_regions, world, player):
|
||||
f.write(toprint)
|
||||
|
||||
def update_deprecated_args(args):
|
||||
argVars = vars(args)
|
||||
truthy = [ 1, True, "True", "true" ]
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "suppress_spoiler" in argVars:
|
||||
args.create_spoiler = args.suppress_spoiler not in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "create_spoiler" in argVars:
|
||||
args.suppress_spoiler = not args.create_spoiler in truthy
|
||||
if args:
|
||||
argVars = vars(args)
|
||||
truthy = [ 1, True, "True", "true" ]
|
||||
# Hints default to TRUE
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "no_hints" in argVars:
|
||||
src = "no_hints"
|
||||
if isinstance(argVars["hints"],dict):
|
||||
tmp = {}
|
||||
for idx in range(1,len(argVars["hints"]) + 1):
|
||||
tmp[idx] = not argVars[src] in truthy # tmp = !src
|
||||
args.hints = tmp # dest = tmp
|
||||
else:
|
||||
args.hints = not args.no_hints in truthy # dest = !src
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "hints" in argVars:
|
||||
src = "hints"
|
||||
if isinstance(argVars["hints"],dict):
|
||||
tmp = {}
|
||||
for idx in range(1,len(argVars["hints"]) + 1):
|
||||
tmp[idx] = not argVars[src] in truthy # tmp = !src
|
||||
args.no_hints = tmp # dest = tmp
|
||||
else:
|
||||
args.no_hints = not args.hints in truthy # dest = !src
|
||||
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "suppress_rom" in argVars:
|
||||
args.create_rom = args.suppress_rom not in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "create_rom" in argVars:
|
||||
args.suppress_rom = not args.create_rom in truthy
|
||||
# Spoiler defaults to FALSE
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "create_spoiler" in argVars:
|
||||
args.suppress_spoiler = not args.create_spoiler in truthy
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "suppress_spoiler" in argVars:
|
||||
args.create_spoiler = not args.suppress_spoiler in truthy
|
||||
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "no_shuffleganon" in argVars:
|
||||
args.shuffleganon = not args.no_shuffleganon in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "shuffleganon" in argVars:
|
||||
args.no_shuffleganon = not args.shuffleganon in truthy
|
||||
# ROM defaults to TRUE
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "suppress_rom" in argVars:
|
||||
args.create_rom = not args.suppress_rom in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "create_rom" in argVars:
|
||||
args.suppress_rom = not args.create_rom in truthy
|
||||
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "skip_playthrough" in argVars:
|
||||
args.calc_playthrough = not args.skip_playthrough in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "calc_playthrough" in argVars:
|
||||
args.skip_playthrough = not args.calc_playthrough in truthy
|
||||
# Shuffle Ganon defaults to TRUE
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "no_shuffleganon" in argVars:
|
||||
args.shuffleganon = not args.no_shuffleganon in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "shuffleganon" in argVars:
|
||||
args.no_shuffleganon = not args.shuffleganon in truthy
|
||||
|
||||
# Playthrough defaults to TRUE
|
||||
# Don't do: Yes
|
||||
# Do: No
|
||||
if "skip_playthrough" in argVars:
|
||||
args.calc_playthrough = not args.skip_playthrough in truthy
|
||||
# Don't do: No
|
||||
# Do: Yes
|
||||
if "calc_playthrough" in argVars:
|
||||
args.skip_playthrough = not args.calc_playthrough in truthy
|
||||
|
||||
return args
|
||||
|
||||
|
||||
Reference in New Issue
Block a user