Major GUI reorganization

This commit is contained in:
codemann8
2023-03-29 09:58:48 -05:00
parent 28e5b7503d
commit f1f75ec760
19 changed files with 517 additions and 307 deletions

View File

@@ -15,33 +15,24 @@ def overworld_page(parent):
# Load Overworld Shuffle option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
self.frames["topOverworldFrame"] = Frame(self)
self.frames["leftOverworldFrame"] = Frame(self)
self.frames["rightOverworldFrame"] = Frame(self)
self.frames["topOverworldFrame"].pack(side=TOP, anchor=NW)
self.frames["leftOverworldFrame"].pack(side=LEFT, anchor=NW, fill=Y)
self.frames["rightOverworldFrame"].pack(anchor=NW, fill=Y)
shuffleLabel = Label(self.frames["topOverworldFrame"], text="Shuffle: ")
shuffleLabel.pack(side=LEFT)
with open(os.path.join("resources","app","gui","randomize","overworld","widgets.json")) as overworldWidgets:
myDict = json.load(overworldWidgets)
for framename,theseWidgets in myDict.items():
if not theseWidgets:
continue
dictWidgets = widgets.make_widgets_from_dict(self, theseWidgets, self.frames[framename])
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
packAttrs = {"anchor":E}
if key == "terrain":
packAttrs = {"anchor":W, "pady":(3,0)}
elif key == "keepsimilar":
packAttrs = {"anchor":W, "pady":(6,0)}
elif key == "overworldflute":
packAttrs["pady"] = (20,0)
elif key in ["mixed", "whirlpool"]:
packAttrs = {"anchor":W, "padx":(79,0)}
packAttrs = {"anchor":W}
if self.widgets[key].type != "checkbox":
packAttrs["anchor"] = E
packAttrs = widgets.add_padding_from_config(packAttrs, theseWidgets[key])
self.widgets[key].pack(packAttrs)
return self