Dictify Item Rando options

This commit is contained in:
Mike A. Trethewey
2020-02-15 07:13:40 -08:00
parent bba2058a5b
commit ec2224d0fc

View File

@@ -8,15 +8,18 @@ def item_page(parent):
# Item Randomizer options # Item Randomizer options
self.widgets = {} self.widgets = {}
myDict = {
## Retro (eventually needs to become a World State) ## Retro (eventually needs to become a World State)
key = "retro" "retro": {
self.widgets[key] = widgets.make_widget( "type": "checkbox",
self, "label": {
"checkbox", "text": "Retro mode (universal keys)"
self, }
"Retro mode (universal keys)", }
None }
) 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)
leftItemFrame = Frame(self) leftItemFrame = Frame(self)
@@ -24,153 +27,153 @@ def item_page(parent):
leftItemFrame.pack(side=LEFT) leftItemFrame.pack(side=LEFT)
rightItemFrame.pack(side=RIGHT) rightItemFrame.pack(side=RIGHT)
keys = [*map(str,range(0,7+1)),"Random"]
vals = [*map(str,range(0,7+1)),"random"]
crystalsOptions = {keys[i]: vals[i] for i in range(len(keys))}
myDict = {
## World State ## World State
key = "worldstate" "worldstate": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "World State"
leftItemFrame, },
"World State", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}, "default": "Open"}, "selectbox": { "side": RIGHT },
{ "default": "Open"
},
"options": {
"Standard": "standard", "Standard": "standard",
"Open": "open", "Open": "open",
"Inverted": "inverted" "Inverted": "inverted"
} }
) },
self.widgets[key].pack(anchor=E)
## Logic Level ## Logic Level
key = "logiclevel" "logiclevel": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Logic Level"
leftItemFrame, },
"Logic Level", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"No Glitches": "noglitches", "No Glitches": "noglitches",
"Minor Glitches": "minorglitches", "Minor Glitches": "minorglitches",
"No Logic": "nologic" "No Logic": "nologic"
} }
) },
self.widgets[key].pack(anchor=E)
## Goal ## Goal
key = "goal" "goal": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Goal"
leftItemFrame, },
"Goal", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"Defeat Ganon": "ganon", "Defeat Ganon": "ganon",
"Master Sword Pedestal": "pedestal", "Master Sword Pedestal": "pedestal",
"All Dungeons": "dungeons", "All Dungeons": "dungeons",
"Triforce Hunt": "triforcehunt", "Triforce Hunt": "triforcehunt",
"Crystals": "crystals" "Crystals": "crystals"
} }
) },
self.widgets[key].pack(anchor=E)
## Number of crystals to open GT ## Number of crystals to open GT
key = "crystals_gt" "crystals_gt": {
keys = [*map(str,range(0,7+1)),"Random"] "type": "selectbox",
vals = [*map(str,range(0,7+1)),"random"] "label": {
options = {keys[i]: vals[i] for i in range(len(keys))} "text": "Crystals to open GT"
self.widgets[key] = widgets.make_widget( },
self, "packAttrs": {
"selectbox", "label": { "side": LEFT },
leftItemFrame, "selectbox": { "side": RIGHT }
"Crystals to open GT", },
None, "options": crystalsOptions
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, },
options
)
self.widgets[key].pack(anchor=E)
## Number of crystals to damage Ganon ## Number of crystals to damage Ganon
key = "crystals_ganon" "crystals_ganon": {
keys = [*map(str,range(0,7+1)),"Random"] "type": "selectbox",
vals = [*map(str,range(0,7+1)),"random"] "label": {
options = {keys[i]: vals[i] for i in range(len(keys))} "text": "Crystals to harm Ganon"
self.widgets[key] = widgets.make_widget( },
self, "packAttrs": {
"selectbox", "label": { "side": LEFT },
leftItemFrame, "selectbox": { "side": RIGHT }
"Crystals to harm Ganon", },
None, "options": crystalsOptions
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, },
options
)
self.widgets[key].pack(anchor=E)
## Weapons ## Weapons
key = "weapons" "weapons": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Weapons"
leftItemFrame, },
"Weapons", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"Randomized": "random", "Randomized": "random",
"Assured": "assured", "Assured": "assured",
"Swordless": "swordless", "Swordless": "swordless",
"Vanilla": "vanilla" "Vanilla": "vanilla"
} }
) }
}
dictWidgets = widgets.make_widgets_from_dict(self, myDict, leftItemFrame)
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(anchor=E) self.widgets[key].pack(anchor=E)
myDict = {
## Item Pool ## Item Pool
key = "itempool" "itempool": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Item Pool"
rightItemFrame, },
"Item Pool", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"Normal": "normal", "Normal": "normal",
"Hard": "hard", "Hard": "hard",
"Expert": "expert" "Expert": "expert"
} }
) },
self.widgets[key].pack(anchor=E)
## Item Functionality ## Item Functionality
key = "itemfunction" "itemfunction": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Item Functionality"
rightItemFrame, },
"Item Functionality", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"Normal": "normal", "Normal": "normal",
"Hard": "hard", "Hard": "hard",
"Expert": "expert" "Expert": "expert"
} }
) },
self.widgets[key].pack(anchor=E)
## Timer setting ## Timer setting
key = "timer" "timer": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Timer Setting"
rightItemFrame, },
"Timer Setting", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"No Timer": "none", "No Timer": "none",
"Stopwatch": "display", "Stopwatch": "display",
"Timed": "timed", "Timed": "timed",
@@ -178,53 +181,51 @@ def item_page(parent):
"OHKO": "ohko", "OHKO": "ohko",
"Timed Countdown": "timed-countdown" "Timed Countdown": "timed-countdown"
} }
) },
self.widgets[key].pack(anchor=E)
## Progressives: On/Off ## Progressives: On/Off
key = "progressives" "progressives": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Progressive Items"
rightItemFrame, },
"Progressive Items", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "selectbox": { "side": RIGHT }
{ },
"options": {
"On": "on", "On": "on",
"Off": "off", "Off": "off",
"Random": "random" "Random": "random"
} }
) },
self.widgets[key].pack(anchor=E) ## Accessibility
"accessibility": {
## Accessibilty "type": "selectbox",
key = "accessibility" "label": {
self.widgets[key] = widgets.make_widget( "text": "Accessibility"
self, },
"selectbox", "packAttrs": {
rightItemFrame, "label": { "side": LEFT },
"Accessibility", "selectbox": { "side": RIGHT }
None, },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}}, "options": {
{
"100% Inventory": "items", "100% Inventory": "items",
"100% Locations": "locations", "100% Locations": "locations",
"Beatable": "none" "Beatable": "none"
} }
) },
self.widgets[key].pack(anchor=E)
## Item Sorting Algorithm ## Item Sorting Algorithm
key = "sortingalgo" "sortingalgo": {
self.widgets[key] = widgets.make_widget( "type": "selectbox",
self, "label": {
"selectbox", "text": "Item Sorting"
rightItemFrame, },
"Item Sorting", "packAttrs": {
None, "label": { "side": LEFT },
{"label": {"side": LEFT}, "selectbox": {"side": RIGHT}, "default": "Balanced"}, "selectbox": { "side": RIGHT },
{ "default": "Balanced"
},
"options": {
"Freshness": "freshness", "Freshness": "freshness",
"Flood": "flood", "Flood": "flood",
"VT8.21": "vt21", "VT8.21": "vt21",
@@ -233,7 +234,11 @@ def item_page(parent):
"VT8.26": "vt26", "VT8.26": "vt26",
"Balanced": "balanced" "Balanced": "balanced"
} }
) }
}
dictWidgets = widgets.make_widgets_from_dict(self, myDict, rightItemFrame)
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(anchor=E) self.widgets[key].pack(anchor=E)
return self return self