JSONify Dungeon Rando options
This commit is contained in:
@@ -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 dungeon_page(parent):
|
def dungeon_page(parent):
|
||||||
# Dungeon Shuffle
|
# Dungeon Shuffle
|
||||||
@@ -14,73 +16,18 @@ def dungeon_page(parent):
|
|||||||
mscbLabel = Label(mcsbshuffleFrame, text="Shuffle: ")
|
mscbLabel = Label(mcsbshuffleFrame, text="Shuffle: ")
|
||||||
mscbLabel.pack(side=LEFT)
|
mscbLabel.pack(side=LEFT)
|
||||||
|
|
||||||
myDict = {
|
with open(os.path.join("resources","app","gui","randomize","dungeon","keysanity.json")) as keysanityItems:
|
||||||
## Map Shuffle
|
myDict = json.load(keysanityItems)
|
||||||
"mapshuffle": {
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, mcsbshuffleFrame)
|
||||||
"type": "checkbox",
|
for key in dictWidgets:
|
||||||
"label": {
|
self.widgets[key] = dictWidgets[key]
|
||||||
"text": "Maps"
|
self.widgets[key].pack(side=LEFT)
|
||||||
}
|
|
||||||
},
|
|
||||||
## Compass Shuffle
|
|
||||||
"compassshuffle": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Compasses"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Small Key Shuffle
|
|
||||||
"smallkeyshuffle": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Small Keys"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Big Key Shuffle
|
|
||||||
"bigkeyshuffle": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Small Keys"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, mcsbshuffleFrame)
|
with open(os.path.join("resources","app","gui","randomize","dungeon","widgets.json")) as dungeonWidgets:
|
||||||
|
myDict = json.load(dungeonWidgets)
|
||||||
for key in dictWidgets:
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
|
||||||
self.widgets[key] = dictWidgets[key]
|
for key in dictWidgets:
|
||||||
self.widgets[key].pack(side=LEFT)
|
self.widgets[key] = dictWidgets[key]
|
||||||
|
self.widgets[key].pack(anchor=W)
|
||||||
myDict = {
|
|
||||||
"dungeondoorshuffle": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Dungeon Door Shuffle"
|
|
||||||
},
|
|
||||||
"packAttrs": {
|
|
||||||
"label": { "side": LEFT },
|
|
||||||
"selectbox": {"side": RIGHT},
|
|
||||||
"default": "Basic"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Vanilla": "vanilla",
|
|
||||||
"Basic": "basic",
|
|
||||||
"Crossed": "crossed"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Experiemental features
|
|
||||||
"experimental": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Enable Experimental Features"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
26
resources/app/gui/randomize/dungeon/keysanity.json
Normal file
26
resources/app/gui/randomize/dungeon/keysanity.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"mapshuffle": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Maps"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"compassshuffle": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Compasses"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"smallkeyshuffle": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Small Keys"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bigkeyshuffle": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Small Keys"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
resources/app/gui/randomize/dungeon/widgets.json
Normal file
28
resources/app/gui/randomize/dungeon/widgets.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"dungeondoorshuffle": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Dungeon Door Shuffle"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
},
|
||||||
|
"default": "Basic"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Vanilla": "vanilla",
|
||||||
|
"Basic": "basic",
|
||||||
|
"Crossed": "crossed"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"experimental": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Enable Experimental Features"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user