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 from tkinter import ttk, IntVar, StringVar, Checkbutton, Frame, Label, OptionMenu, E, W, LEFT, RIGHT
import gui.widgets as widgets import gui.widgets as widgets
import json
import os
def entrando_page(parent): def entrando_page(parent):
# Entrance Randomizer # Entrance Randomizer
@@ -8,50 +10,11 @@ def entrando_page(parent):
# Entrance Randomizer options # Entrance Randomizer options
self.widgets = {} self.widgets = {}
myDict = { with open(os.path.join("resources","app","gui","randomize","entrando","widgets.json")) as myWidgets:
## Pyramid pre-opened myDict = json.load(myWidgets)
"openpyramid": { dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
"type": "checkbox", for key in dictWidgets:
"label": { self.widgets[key] = dictWidgets[key]
"text": "Pre-open Pyramid Hole" self.widgets[key].pack(anchor=W)
}
},
## 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)
return self return self

View File

@@ -0,0 +1,38 @@
{
"openpyramid": {
"type": "checkbox",
"label": {
"text": "Pre-open Pyramid Hole"
}
},
"shuffleganon": {
"type": "checkbox",
"label": {
"text": "Include Ganon's Tower and Pyramid Hole in shuffle pool"
}
},
"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"
}
}
}