JSONify Multiworld options
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
from tkinter import ttk, StringVar, Entry, Frame, Label, Spinbox, N, E, W, X, LEFT, RIGHT
|
from tkinter import ttk, StringVar, Entry, Frame, Label, Spinbox, N, E, W, X, LEFT, RIGHT
|
||||||
import gui.widgets as widgets
|
import gui.widgets as widgets
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
def multiworld_page(parent,settings):
|
def multiworld_page(parent,settings):
|
||||||
# Multiworld
|
# Multiworld
|
||||||
@@ -8,23 +10,12 @@ def multiworld_page(parent,settings):
|
|||||||
# Multiworld options
|
# Multiworld options
|
||||||
self.widgets = {}
|
self.widgets = {}
|
||||||
|
|
||||||
myDict = {
|
with open(os.path.join("resources","app","gui","randomize","multiworld","widgets.json")) as multiworldItems:
|
||||||
## Number of worlds
|
myDict = json.load(multiworldItems)
|
||||||
"worlds": {
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
|
||||||
"type": "spinbox",
|
for key in dictWidgets:
|
||||||
"label": {
|
self.widgets[key] = dictWidgets[key]
|
||||||
"text": "Worlds"
|
self.widgets[key].pack(side=LEFT, anchor=N)
|
||||||
},
|
|
||||||
"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)
|
|
||||||
|
|
||||||
## List of Player Names
|
## List of Player Names
|
||||||
key = "names"
|
key = "names"
|
||||||
|
|||||||
16
resources/app/gui/randomize/multiworld/widgets.json
Normal file
16
resources/app/gui/randomize/multiworld/widgets.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"worlds": {
|
||||||
|
"type": "spinbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Worlds"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"spinbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user