JSONify Game Options
This commit is contained in:
@@ -2,7 +2,8 @@ from tkinter import ttk, IntVar, StringVar, Button, Checkbutton, Entry, Frame, L
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
import classes.SpriteSelector as spriteSelector
|
import classes.SpriteSelector as spriteSelector
|
||||||
import gui.widgets as widgets
|
import gui.widgets as widgets
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
def gameoptions_page(top, parent):
|
def gameoptions_page(top, parent):
|
||||||
# Game Options
|
# Game Options
|
||||||
@@ -11,82 +12,24 @@ def gameoptions_page(top, parent):
|
|||||||
# Game Options options
|
# Game Options options
|
||||||
self.widgets = {}
|
self.widgets = {}
|
||||||
|
|
||||||
myDict = {
|
with open(os.path.join("resources","app","gui","randomize","gameoptions","checkboxes.json")) as checkboxes:
|
||||||
## Hints: Useful/Not useful
|
myDict = json.load(checkboxes)
|
||||||
"hints": {
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
|
||||||
"type": "checkbox",
|
for key in dictWidgets:
|
||||||
"label": {
|
self.widgets[key] = dictWidgets[key]
|
||||||
"text": "Include Helpful Hints"
|
self.widgets[key].pack(anchor=W)
|
||||||
}
|
|
||||||
},
|
|
||||||
## Disable BGM
|
|
||||||
"nobgm": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Disable Music & MSU-1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## L/R Quickswap
|
|
||||||
"quickswap": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "L/R Quickswapping"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self)
|
|
||||||
for key in dictWidgets:
|
|
||||||
self.widgets[key] = dictWidgets[key]
|
|
||||||
self.widgets[key].pack(anchor=W)
|
|
||||||
|
|
||||||
leftRomOptionsFrame = Frame(self)
|
leftRomOptionsFrame = Frame(self)
|
||||||
rightRomOptionsFrame = Frame(self)
|
rightRomOptionsFrame = Frame(self)
|
||||||
leftRomOptionsFrame.pack(side=LEFT)
|
leftRomOptionsFrame.pack(side=LEFT)
|
||||||
rightRomOptionsFrame.pack(side=RIGHT)
|
rightRomOptionsFrame.pack(side=RIGHT)
|
||||||
|
|
||||||
myDict = {
|
with open(os.path.join("resources","app","gui","randomize","gameoptions","leftRomOptionsFrame.json")) as leftRomOptionsFrameItems:
|
||||||
## Heart Color
|
myDict = json.load(leftRomOptionsFrameItems)
|
||||||
"heartcolor": {
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, leftRomOptionsFrame)
|
||||||
"type": "selectbox",
|
for key in dictWidgets:
|
||||||
"label": {
|
self.widgets[key] = dictWidgets[key]
|
||||||
"text": "Heart Color"
|
self.widgets[key].pack(anchor=E)
|
||||||
},
|
|
||||||
"packAttrs": {
|
|
||||||
"label": { "side": LEFT },
|
|
||||||
"selectbox": { "side": RIGHT }
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Red": "red",
|
|
||||||
"Blue": "blue",
|
|
||||||
"Green": "green",
|
|
||||||
"Yellow": "yellow",
|
|
||||||
"Random": "random"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Heart Beep speed
|
|
||||||
"heartbeep": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Heart Beep sound rate"
|
|
||||||
},
|
|
||||||
"packAttrs": {
|
|
||||||
"label": { "side": LEFT },
|
|
||||||
"selectbox": { "side": RIGHT},
|
|
||||||
"default": "Normal"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Double": "double",
|
|
||||||
"Normal": "normal",
|
|
||||||
"Half": "half",
|
|
||||||
"Quarter": "quarter",
|
|
||||||
"Off": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, leftRomOptionsFrame)
|
|
||||||
for key in dictWidgets:
|
|
||||||
self.widgets[key] = dictWidgets[key]
|
|
||||||
self.widgets[key].pack(anchor=E)
|
|
||||||
|
|
||||||
## Sprite selection
|
## Sprite selection
|
||||||
spriteDialogFrame = Frame(leftRomOptionsFrame)
|
spriteDialogFrame = Frame(leftRomOptionsFrame)
|
||||||
@@ -114,64 +57,12 @@ def gameoptions_page(top, parent):
|
|||||||
spriteSelectButton.pack(side=LEFT)
|
spriteSelectButton.pack(side=LEFT)
|
||||||
spriteDialogFrame.pack(anchor=E)
|
spriteDialogFrame.pack(anchor=E)
|
||||||
|
|
||||||
myDict = {
|
with open(os.path.join("resources","app","gui","randomize","gameoptions","rightRomOptionsFrame.json")) as rightRomOptionsFrameItems:
|
||||||
## Menu Speed
|
myDict = json.load(rightRomOptionsFrameItems)
|
||||||
"menuspeed": {
|
dictWidgets = widgets.make_widgets_from_dict(self, myDict, rightRomOptionsFrame)
|
||||||
"type": "selectbox",
|
for key in dictWidgets:
|
||||||
"label": {
|
self.widgets[key] = dictWidgets[key]
|
||||||
"text": "Menu Speed"
|
self.widgets[key].pack(anchor=E)
|
||||||
},
|
|
||||||
"packAttrs": {
|
|
||||||
"label": { "side": LEFT },
|
|
||||||
"selectbox": { "side": RIGHT },
|
|
||||||
"default": "Normal"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Instant": "instant",
|
|
||||||
"Quadruple": "quadruple",
|
|
||||||
"Triple": "triple",
|
|
||||||
"Double": "double",
|
|
||||||
"Normal": "normal",
|
|
||||||
"Half": "half"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Overworld Palettes (not Enemizer)
|
|
||||||
"owpalettes": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Overworld Palettes"
|
|
||||||
},
|
|
||||||
"packAttrs": {
|
|
||||||
"label": { "side": LEFT },
|
|
||||||
"selectbox": { "side": RIGHT }
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Default": "default",
|
|
||||||
"Random": "random",
|
|
||||||
"Blackout": "blackout"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
## Underworld Palettes (not Enemizer)
|
|
||||||
"uwpalettes": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Underworld Palettes"
|
|
||||||
},
|
|
||||||
"packAttrs": {
|
|
||||||
"label": { "side": LEFT },
|
|
||||||
"selectbox": { "side": RIGHT }
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Default": "default",
|
|
||||||
"Random": "random",
|
|
||||||
"Blackout": "blackout"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, rightRomOptionsFrame)
|
|
||||||
for key in dictWidgets:
|
|
||||||
self.widgets[key] = dictWidgets[key]
|
|
||||||
self.widgets[key].pack(anchor=E)
|
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|||||||
20
resources/app/gui/randomize/gameoptions/checkboxes.json
Normal file
20
resources/app/gui/randomize/gameoptions/checkboxes.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"hints": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Include Helpful Hints"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nobgm": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Disable Music & MSU-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quickswap": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "L/R Quickswapping"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"heartcolor": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Heart Color"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Red": "red",
|
||||||
|
"Blue": "blue",
|
||||||
|
"Green": "green",
|
||||||
|
"Yellow": "yellow",
|
||||||
|
"Random": "random"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"heartbeep": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Heart Beep sound rate"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
},
|
||||||
|
"default": "Normal"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Double": "double",
|
||||||
|
"Normal": "normal",
|
||||||
|
"Half": "half",
|
||||||
|
"Quarter": "quarter",
|
||||||
|
"Off": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"menuspeed": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Menu Speed"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
},
|
||||||
|
"default": "Normal"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Instant": "instant",
|
||||||
|
"Quadruple": "quadruple",
|
||||||
|
"Triple": "triple",
|
||||||
|
"Double": "double",
|
||||||
|
"Normal": "normal",
|
||||||
|
"Half": "half"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"owpalettes": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Overworld Palettes"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Default": "default",
|
||||||
|
"Random": "random",
|
||||||
|
"Blackout": "blackout"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uwpalettes": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Underworld Palettes"
|
||||||
|
},
|
||||||
|
"packAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Default": "default",
|
||||||
|
"Random": "random",
|
||||||
|
"Blackout": "blackout"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user