JSONify Multiworld options

This commit is contained in:
Mike A. Trethewey
2020-02-19 01:29:48 -08:00
parent 2a1e9726b1
commit c848792c69
2 changed files with 24 additions and 17 deletions

View File

@@ -1,5 +1,7 @@
from tkinter import ttk, StringVar, Entry, Frame, Label, Spinbox, N, E, W, X, LEFT, RIGHT
import gui.widgets as widgets
import json
import os
def multiworld_page(parent,settings):
# Multiworld
@@ -8,23 +10,12 @@ def multiworld_page(parent,settings):
# Multiworld options
self.widgets = {}
myDict = {
## Number of worlds
"worlds": {
"type": "spinbox",
"label": {
"text": "Worlds"
},
"packAttrs": {
"label": { "side": LEFT },
"spinbox": { "side": RIGHT }
}
}
}
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(side=LEFT, anchor=N)
with open(os.path.join("resources","app","gui","randomize","multiworld","widgets.json")) as multiworldItems:
myDict = json.load(multiworldItems)
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
for key in dictWidgets:
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(side=LEFT, anchor=N)
## List of Player Names
key = "names"