Add Retro World State (Open & Retro on) Add SpriteSomething plug to sprite selector Fix Custom Item Pool loading to use disct instead of list
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
from tkinter import ttk, Frame, E, W, LEFT, RIGHT
|
|
import gui.widgets as widgets
|
|
import json
|
|
import os
|
|
|
|
def entrando_page(parent):
|
|
# Entrance Randomizer
|
|
self = ttk.Frame(parent)
|
|
|
|
# Entrance Randomizer options
|
|
self.widgets = {}
|
|
|
|
# Entrance Randomizer option sections
|
|
self.frames = {}
|
|
self.frames["widgets"] = Frame(self)
|
|
self.frames["widgets"].pack(anchor=W)
|
|
|
|
# Load Entrance Randomizer option widgets as defined by JSON file
|
|
# Defns include frame name, widget type, widget options, widget placement attributes
|
|
# Checkboxes go West
|
|
# Everything else goes East
|
|
# They also get split left & right
|
|
with open(os.path.join("resources","app","gui","randomize","entrando","widgets.json")) as widgetDefns:
|
|
myDict = json.load(widgetDefns)
|
|
for framename,theseWidgets in myDict.items():
|
|
dictWidgets = widgets.make_widgets_from_dict(self, theseWidgets, self.frames[framename])
|
|
for key in dictWidgets:
|
|
self.widgets[key] = dictWidgets[key]
|
|
packAttrs = {"anchor":E}
|
|
if self.widgets[key].type == "checkbox":
|
|
packAttrs["anchor"] = W
|
|
self.widgets[key].pack(packAttrs)
|
|
|
|
return self
|