JSONify Generation options
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, E, W, LEFT, RIGHT, X
|
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, E, W, LEFT, RIGHT, X
|
||||||
import gui.widgets as widgets
|
import gui.widgets as widgets
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
def generation_page(parent,settings):
|
def generation_page(parent,settings):
|
||||||
# Generation Setup
|
# Generation Setup
|
||||||
@@ -9,33 +11,12 @@ def generation_page(parent,settings):
|
|||||||
# Generation Setup options
|
# Generation Setup options
|
||||||
self.widgets = {}
|
self.widgets = {}
|
||||||
|
|
||||||
myDict = {
|
with open(os.path.join("resources","app","gui","randomize","generation","checkboxes.json")) as checkboxes:
|
||||||
## Generate Spoiler
|
myDict = json.load(checkboxes)
|
||||||
"spoiler": {
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
|
||||||
"type": "checkbox",
|
for key in dictWidgets:
|
||||||
"label": {
|
self.widgets[key] = dictWidgets[key]
|
||||||
"text": "Create Spoiler Log"
|
self.widgets[key].pack(anchor=W)
|
||||||
}
|
|
||||||
},
|
|
||||||
## Don't make ROM
|
|
||||||
"suppressrom": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Do not create patched ROM"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Use Custom Item Pool as defined in Custom tab
|
|
||||||
"usecustompool": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Use custom item pool"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
|
|
||||||
for key in dictWidgets:
|
|
||||||
self.widgets[key] = dictWidgets[key]
|
|
||||||
self.widgets[key].pack(anchor=W)
|
|
||||||
|
|
||||||
## Locate base ROM
|
## Locate base ROM
|
||||||
baseRomFrame = Frame(self)
|
baseRomFrame = Frame(self)
|
||||||
|
|||||||
20
resources/app/gui/randomize/generation/checkboxes.json
Normal file
20
resources/app/gui/randomize/generation/checkboxes.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"spoiler": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Create Spoiler Log"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"suppressrom": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Do not create patched ROM"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"usecustompool": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Use custom item pool"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user