Condense Enemizer options
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, LabelFrame, OptionMenu, N, E, W, LEFT, RIGHT, X
|
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, LabelFrame, OptionMenu, N, E, W, LEFT, RIGHT, BOTTOM, X
|
||||||
import gui.widgets as widgets
|
import gui.widgets as widgets
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@@ -17,15 +17,28 @@ def enemizer_page(parent,settings):
|
|||||||
self.frames["checkboxes"] = Frame(self)
|
self.frames["checkboxes"] = Frame(self)
|
||||||
self.frames["checkboxes"].pack(anchor=W)
|
self.frames["checkboxes"].pack(anchor=W)
|
||||||
|
|
||||||
with open(os.path.join("resources","app","gui","randomize","enemizer","checkboxes.json")) as checkboxes:
|
self.frames["selectOptionsFrame"] = Frame(self)
|
||||||
myDict = json.load(checkboxes)
|
self.frames["leftEnemizerFrame"] = Frame(self.frames["selectOptionsFrame"])
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self.frames["checkboxes"])
|
self.frames["rightEnemizerFrame"] = Frame(self.frames["selectOptionsFrame"])
|
||||||
for key in dictWidgets:
|
self.frames["bottomEnemizerFrame"] = Frame(self)
|
||||||
self.widgets[key] = dictWidgets[key]
|
self.frames["selectOptionsFrame"].pack(fill=X)
|
||||||
self.widgets[key].pack(anchor=W)
|
self.frames["leftEnemizerFrame"].pack(side=LEFT)
|
||||||
|
self.frames["rightEnemizerFrame"].pack(side=RIGHT)
|
||||||
|
self.frames["bottomEnemizerFrame"].pack(fill=X)
|
||||||
|
|
||||||
|
with open(os.path.join("resources","app","gui","randomize","enemizer","widgets.json")) as widgetDefns:
|
||||||
|
myDict = json.load(widgetDefns)
|
||||||
|
for framename,theseWidgets in myDict.items():
|
||||||
|
dictWidgets = widgets.make_widgets_from_dict(self, theseWidgets, self.frames[framename])
|
||||||
|
for key in dictWidgets:
|
||||||
|
self.widgets[key] = dictWidgets[key]
|
||||||
|
packAttrs = {"anchor":E}
|
||||||
|
if self.widgets[key].type == "checkbox":
|
||||||
|
packAttrs["anchor"] = W
|
||||||
|
self.widgets[key].pack(packAttrs)
|
||||||
|
|
||||||
## Enemizer CLI Path
|
## Enemizer CLI Path
|
||||||
enemizerPathFrame = Frame(self)
|
enemizerPathFrame = Frame(self.frames["bottomEnemizerFrame"])
|
||||||
enemizerCLIlabel = Label(enemizerPathFrame, text="EnemizerCLI path: ")
|
enemizerCLIlabel = Label(enemizerPathFrame, text="EnemizerCLI path: ")
|
||||||
enemizerCLIlabel.pack(side=LEFT)
|
enemizerCLIlabel.pack(side=LEFT)
|
||||||
self.enemizerCLIpathVar = StringVar(value=settings["enemizercli"])
|
self.enemizerCLIpathVar = StringVar(value=settings["enemizercli"])
|
||||||
@@ -40,23 +53,4 @@ def enemizer_page(parent,settings):
|
|||||||
enemizerCLIbrowseButton.pack(side=LEFT)
|
enemizerCLIbrowseButton.pack(side=LEFT)
|
||||||
enemizerPathFrame.pack(fill=X)
|
enemizerPathFrame.pack(fill=X)
|
||||||
|
|
||||||
self.frames["leftEnemizerFrame"] = Frame(self)
|
|
||||||
self.frames["rightEnemizerFrame"] = Frame(self)
|
|
||||||
self.frames["leftEnemizerFrame"].pack(side=LEFT, anchor=N)
|
|
||||||
self.frames["rightEnemizerFrame"].pack(side=RIGHT, anchor=N)
|
|
||||||
|
|
||||||
with open(os.path.join("resources","app","gui","randomize","enemizer","leftEnemizerFrame.json")) as leftEnemizerFrameItems:
|
|
||||||
myDict = json.load(leftEnemizerFrameItems)
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self.frames["leftEnemizerFrame"])
|
|
||||||
for key in dictWidgets:
|
|
||||||
self.widgets[key] = dictWidgets[key]
|
|
||||||
self.widgets[key].pack(anchor=E)
|
|
||||||
|
|
||||||
with open(os.path.join("resources","app","gui","randomize","enemizer","rightEnemizerFrame.json")) as rightEnemizerFrameItems:
|
|
||||||
myDict = json.load(rightEnemizerFrameItems)
|
|
||||||
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self.frames["rightEnemizerFrame"])
|
|
||||||
for key in dictWidgets:
|
|
||||||
self.widgets[key] = dictWidgets[key]
|
|
||||||
self.widgets[key].pack(anchor=E)
|
|
||||||
|
|
||||||
return self,settings
|
return self,settings
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"potshuffle": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Pot Shuffle"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"enemyshuffle": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Enemy Shuffle"
|
|
||||||
},
|
|
||||||
"managerAttrs": {
|
|
||||||
"label": {
|
|
||||||
"side": "left"
|
|
||||||
},
|
|
||||||
"selectbox": {
|
|
||||||
"side": "right"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Vanilla": "none",
|
|
||||||
"Shuffled": "shuffled",
|
|
||||||
"Chaos": "chaos"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bossshuffle": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Boss Shuffle"
|
|
||||||
},
|
|
||||||
"managerAttrs": {
|
|
||||||
"label": {
|
|
||||||
"side": "left"
|
|
||||||
},
|
|
||||||
"selectbox": {
|
|
||||||
"side": "right"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Vanilla": "none",
|
|
||||||
"Basic": "basic",
|
|
||||||
"Shuffled": "shuffled",
|
|
||||||
"Chaos": "chaos"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"enemydamage": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Enemy Damage"
|
|
||||||
},
|
|
||||||
"managerAttrs": {
|
|
||||||
"label": {
|
|
||||||
"side": "left"
|
|
||||||
},
|
|
||||||
"selectbox": {
|
|
||||||
"side": "right"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Vanilla": "default",
|
|
||||||
"Shuffled": "shuffled",
|
|
||||||
"Chaos": "chaos"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"enemyhealth": {
|
|
||||||
"type": "selectbox",
|
|
||||||
"label": {
|
|
||||||
"text": "Enemy Health"
|
|
||||||
},
|
|
||||||
"managerAttrs": {
|
|
||||||
"label": {
|
|
||||||
"side": "left"
|
|
||||||
},
|
|
||||||
"selectbox": {
|
|
||||||
"side": "right"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"Vanilla": "default",
|
|
||||||
"Easy": "easy",
|
|
||||||
"Normal": "normal",
|
|
||||||
"Hard": "hard",
|
|
||||||
"Expert": "expert"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
93
resources/app/gui/randomize/enemizer/widgets.json
Normal file
93
resources/app/gui/randomize/enemizer/widgets.json
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
{
|
||||||
|
"checkboxes": {
|
||||||
|
"potshuffle": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Pot Shuffle"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"leftEnemizerFrame": {
|
||||||
|
"enemyshuffle": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Enemy Shuffle"
|
||||||
|
},
|
||||||
|
"managerAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Vanilla": "none",
|
||||||
|
"Shuffled": "shuffled",
|
||||||
|
"Chaos": "chaos"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bossshuffle": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Boss Shuffle"
|
||||||
|
},
|
||||||
|
"managerAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Vanilla": "none",
|
||||||
|
"Basic": "basic",
|
||||||
|
"Shuffled": "shuffled",
|
||||||
|
"Chaos": "chaos"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rightEnemizerFrame": {
|
||||||
|
"enemydamage": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Enemy Damage"
|
||||||
|
},
|
||||||
|
"managerAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Vanilla": "default",
|
||||||
|
"Shuffled": "shuffled",
|
||||||
|
"Chaos": "chaos"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enemyhealth": {
|
||||||
|
"type": "selectbox",
|
||||||
|
"label": {
|
||||||
|
"text": "Enemy Health"
|
||||||
|
},
|
||||||
|
"managerAttrs": {
|
||||||
|
"label": {
|
||||||
|
"side": "left"
|
||||||
|
},
|
||||||
|
"selectbox": {
|
||||||
|
"side": "right"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"Vanilla": "default",
|
||||||
|
"Easy": "easy",
|
||||||
|
"Normal": "normal",
|
||||||
|
"Hard": "hard",
|
||||||
|
"Expert": "expert"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user