JSONify Entrando options

This commit is contained in:
Mike A. Trethewey
2020-02-17 00:10:02 -08:00
parent 9de01fbdb5
commit 663ed3442a
2 changed files with 46 additions and 45 deletions

View File

@@ -1,5 +1,7 @@
from tkinter import ttk, IntVar, StringVar, Checkbutton, Frame, Label, OptionMenu, E, W, LEFT, RIGHT
import gui.widgets as widgets
import json
import os
def entrando_page(parent):
# Entrance Randomizer
@@ -8,50 +10,11 @@ def entrando_page(parent):
# Entrance Randomizer options
self.widgets = {}
myDict = {
## Pyramid pre-opened
"openpyramid": {
"type": "checkbox",
"label": {
"text": "Pre-open Pyramid Hole"
}
},
## Shuffle Ganon
"shuffleganon": {
"type": "checkbox",
"label": {
"text": "Include Ganon's Tower and Pyramid Hole in shuffle pool"
}
},
## Entrance Shuffle
"entranceshuffle": {
"type": "selectbox",
"label": {
"text": "Entrance Shuffle"
},
"packAttrs": {
"label": { "side": LEFT },
"selectbox": { "side": RIGHT }
},
"options": {
"Vanilla": "vanilla",
"Simple": "simple",
"Restricted": "restricted",
"Full": "full",
"Crossed": "crossed",
"Insanity": "insanity",
"Restricted (Legacy)": "restricted_legacy",
"Full (Legacy)": "full_legacy",
"Madness (Legacy)": "madness_legacy",
"Insanity (Legacy)": "insanity_legacy",
"Dungeons + Full": "dungeonsfull",
"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)
with open(os.path.join("resources","app","gui","randomize","entrando","widgets.json")) as myWidgets:
myDict = json.load(myWidgets)
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