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]
if key in settings:
gui.pages[mainpage].content.widgets[widget].storageVar.set(settings[key]) gui.pages[mainpage].content.widgets[widget].storageVar.set(settings[key])

View File

@@ -8,38 +8,32 @@ def entrando_page(parent):
# Entrance Randomizer options # Entrance Randomizer options
self.widgets = {} self.widgets = {}
myDict = {
## Pyramid pre-opened ## Pyramid pre-opened
key = "openpyramid" "openpyramid": {
self.widgets[key] = widgets.make_widget( "type": "checkbox",
self, "label": {
"checkbox", "text": "Pre-open Pyramid Hole"
self, }
"Pre-open Pyramid Hole", },
None
)
self.widgets[key].pack(anchor=W)
## Shuffle Ganon ## Shuffle Ganon
key = "shuffleganon" "shuffleganon": {
self.widgets[key] = widgets.make_widget( "type": "checkbox",
self, "label": {
"checkbox", "text": "Include Ganon's Tower and Pyramid Hole in shuffle pool"
self, }
"Include Ganon's Tower and Pyramid Hole in shuffle pool", },
None
)
self.widgets[key].pack(anchor=W)
## Entrance Shuffle ## Entrance Shuffle
key = "entranceshuffle" "entranceshuffle": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Entrance Shuffle"
self, },
"Entrance Shuffle", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"Vanilla": "vanilla", "Vanilla": "vanilla",
"Simple": "simple", "Simple": "simple",
"Restricted": "restricted", "Restricted": "restricted",
@@ -53,7 +47,11 @@ def entrando_page(parent):
"Dungeons + Full": "dungeonsfull", "Dungeons + Full": "dungeonsfull",
"Dungeons + Simple": "dungeonssimple" "Dungeons + Simple": "dungeonssimple"
} }
) }
}
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(anchor=W) self.widgets[key].pack(anchor=W)
return self return self