Dictify Entrando Options

Fix null arg issue
This commit is contained in:
Mike A. Trethewey
2020-02-15 07:20:27 -08:00
parent ec2224d0fc
commit 783d259307
2 changed files with 46 additions and 47 deletions

View File

@@ -123,4 +123,5 @@ def loadadjustargs(gui, settings):
for subpage in options[mainpage]: for subpage in options[mainpage]:
for widget in options[mainpage][subpage]: for widget in options[mainpage][subpage]:
key = options[mainpage][subpage][widget] key = options[mainpage][subpage][widget]
gui.pages[mainpage].content.widgets[widget].storageVar.set(settings[key]) if key in settings:
gui.pages[mainpage].content.widgets[widget].storageVar.set(settings[key])

View File

@@ -8,52 +8,50 @@ def entrando_page(parent):
# Entrance Randomizer options # Entrance Randomizer options
self.widgets = {} self.widgets = {}
## Pyramid pre-opened myDict = {
key = "openpyramid" ## Pyramid pre-opened
self.widgets[key] = widgets.make_widget( "openpyramid": {
self, "type": "checkbox",
"checkbox", "label": {
self, "text": "Pre-open Pyramid Hole"
"Pre-open Pyramid Hole", }
None },
) ## Shuffle Ganon
self.widgets[key].pack(anchor=W) "shuffleganon": {
"type": "checkbox",
## Shuffle Ganon "label": {
key = "shuffleganon" "text": "Include Ganon's Tower and Pyramid Hole in shuffle pool"
self.widgets[key] = widgets.make_widget( }
self, },
"checkbox", ## Entrance Shuffle
self, "entranceshuffle": {
"Include Ganon's Tower and Pyramid Hole in shuffle pool", "type": "selectbox",
None "label": {
) "text": "Entrance Shuffle"
self.widgets[key].pack(anchor=W) },
"packAttrs": {
## Entrance Shuffle "label": { "side": LEFT },
key = "entranceshuffle" "selectbox": { "side": RIGHT }
self.widgets[key] = widgets.make_widget( },
self, "options": {
"selectbox", "Vanilla": "vanilla",
self, "Simple": "simple",
"Entrance Shuffle", "Restricted": "restricted",
None, "Full": "full",
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "Crossed": "crossed",
{ "Insanity": "insanity",
"Vanilla": "vanilla", "Restricted (Legacy)": "restricted_legacy",
"Simple": "simple", "Full (Legacy)": "full_legacy",
"Restricted": "restricted", "Madness (Legacy)": "madness_legacy",
"Full": "full", "Insanity (Legacy)": "insanity_legacy",
"Crossed": "crossed", "Dungeons + Full": "dungeonsfull",
"Insanity": "insanity", "Dungeons + Simple": "dungeonssimple"
"Restricted (Legacy)": "restricted_legacy", }
"Full (Legacy)": "full_legacy",
"Madness (Legacy)": "madness_legacy",
"Insanity (Legacy)": "insanity_legacy",
"Dungeons + Full": "dungeonsfull",
"Dungeons + Simple": "dungeonssimple"
} }
) }
self.widgets[key].pack(anchor=W) dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(anchor=W)
return self return self