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