JSONify Generation options

This commit is contained in:
Mike A. Trethewey
2020-02-19 01:37:40 -08:00
parent f2de282249
commit 7c3c67ec13
2 changed files with 28 additions and 27 deletions

View File

@@ -1,6 +1,8 @@
import os
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, E, W, LEFT, RIGHT, X
import gui.widgets as widgets
import json
import os
def generation_page(parent,settings):
# Generation Setup
@@ -9,33 +11,12 @@ def generation_page(parent,settings):
# Generation Setup options
self.widgets = {}
myDict = {
## Generate Spoiler
"spoiler": {
"type": "checkbox",
"label": {
"text": "Create Spoiler Log"
}
},
## 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)
with open(os.path.join("resources","app","gui","randomize","generation","checkboxes.json")) as checkboxes:
myDict = json.load(checkboxes)
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
baseRomFrame = Frame(self)

View 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"
}
}
}