Document stuff, add a couple things

Add Retro World State (Open & Retro on)
Add SpriteSomething plug to sprite selector
Fix Custom Item Pool loading to use disct instead of list
This commit is contained in:
Mike A. Trethewey
2020-03-03 23:43:43 -08:00
parent e093431b00
commit 4968e72a3b
23 changed files with 179 additions and 53 deletions

View File

@@ -1,4 +1,4 @@
from tkinter import ttk, IntVar, StringVar, Checkbutton, Frame, Label, OptionMenu, E, W, LEFT, RIGHT
from tkinter import ttk, Frame, Label, E, W, LEFT, RIGHT
import gui.widgets as widgets
import json
import os
@@ -19,6 +19,9 @@ def dungeon_page(parent):
mscbLabel = Label(self.frames["keysanity"], text="Shuffle: ")
mscbLabel.pack(side=LEFT)
# Load Dungeon Shuffle option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
# This first set goes in the Keysanity frame
with open(os.path.join("resources","app","gui","randomize","dungeon","keysanity.json")) as keysanityItems:
myDict = json.load(keysanityItems)
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self.frames["keysanity"])
@@ -26,6 +29,7 @@ def dungeon_page(parent):
self.widgets[key] = dictWidgets[key]
self.widgets[key].pack(side=LEFT)
# These get split left & right
self.frames["widgets"] = Frame(self)
self.frames["widgets"].pack(anchor=W)
with open(os.path.join("resources","app","gui","randomize","dungeon","widgets.json")) as dungeonWidgets:

View File

@@ -1,5 +1,5 @@
import os
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, LabelFrame, OptionMenu, N, E, W, LEFT, RIGHT, BOTTOM, X
from tkinter import ttk, filedialog, StringVar, Button, Entry, Frame, Label, N, E, W, LEFT, RIGHT, BOTTOM, X
import gui.widgets as widgets
import json
import os
@@ -18,6 +18,7 @@ def enemizer_page(parent,settings):
# Enemizer option sections
self.frames = {}
# Enemizer option frames
self.frames["checkboxes"] = Frame(self)
self.frames["checkboxes"].pack(anchor=W)
@@ -30,6 +31,9 @@ def enemizer_page(parent,settings):
self.frames["rightEnemizerFrame"].pack(side=RIGHT)
self.frames["bottomEnemizerFrame"].pack(fill=X)
# Load Enemizer option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
# These get split left & right
with open(os.path.join("resources","app","gui","randomize","enemizer","widgets.json")) as widgetDefns:
myDict = json.load(widgetDefns)
for framename,theseWidgets in myDict.items():
@@ -42,6 +46,7 @@ def enemizer_page(parent,settings):
self.widgets[key].pack(packAttrs)
## Enemizer CLI Path
# This one's more-complicated, build it and stuff it
enemizerPathFrame = Frame(self.frames["bottomEnemizerFrame"])
enemizerCLIlabel = Label(enemizerPathFrame, text="EnemizerCLI path: ")
enemizerCLIlabel.pack(side=LEFT)

View File

@@ -1,4 +1,4 @@
from tkinter import ttk, IntVar, StringVar, Checkbutton, Frame, Label, OptionMenu, E, W, LEFT, RIGHT
from tkinter import ttk, Frame, E, W, LEFT, RIGHT
import gui.widgets as widgets
import json
import os
@@ -15,6 +15,11 @@ def entrando_page(parent):
self.frames["widgets"] = Frame(self)
self.frames["widgets"].pack(anchor=W)
# Load Entrance Randomizer option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
# Checkboxes go West
# Everything else goes East
# They also get split left & right
with open(os.path.join("resources","app","gui","randomize","entrando","widgets.json")) as widgetDefns:
myDict = json.load(widgetDefns)
for framename,theseWidgets in myDict.items():

View File

@@ -1,4 +1,4 @@
from tkinter import ttk, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, OptionMenu, E, W, LEFT, RIGHT
from tkinter import ttk, StringVar, Button, Entry, Frame, Label, E, W, LEFT, RIGHT
from functools import partial
import classes.SpriteSelector as spriteSelector
import gui.widgets as widgets
@@ -17,11 +17,17 @@ def gameoptions_page(top, parent):
self.frames["checkboxes"] = Frame(self)
self.frames["checkboxes"].pack(anchor=W)
# Game Options frames
self.frames["leftRomOptionsFrame"] = Frame(self)
self.frames["rightRomOptionsFrame"] = Frame(self)
self.frames["leftRomOptionsFrame"].pack(side=LEFT)
self.frames["rightRomOptionsFrame"].pack(side=RIGHT)
# Load Game Options widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
# Checkboxes go West
# Everything else goes East
# They also get split left & right
with open(os.path.join("resources","app","gui","randomize","gameoptions","widgets.json")) as widgetDefns:
myDict = json.load(widgetDefns)
for framename,theseWidgets in myDict.items():
@@ -34,6 +40,7 @@ def gameoptions_page(top, parent):
self.widgets[key].pack(packAttrs)
## Sprite selection
# This one's more-complicated, build it and stuff it
spriteDialogFrame = Frame(self.frames["leftRomOptionsFrame"])
baseSpriteLabel = Label(spriteDialogFrame, text='Sprite:')
@@ -75,4 +82,3 @@ def set_sprite(sprite_param, random_sprite=False, spriteSetter=None, spriteNameV
spriteNameVar.set(sprite_param.name)
if randomSpriteVar:
randomSpriteVar.set(random_sprite)

View File

@@ -1,5 +1,4 @@
import os
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, E, W, LEFT, RIGHT, X
from tkinter import ttk, filedialog, StringVar, Button, Entry, Frame, Label, E, W, LEFT, X
import gui.widgets as widgets
import json
import os
@@ -16,6 +15,8 @@ def generation_page(parent,settings):
self.frames["checkboxes"] = Frame(self)
self.frames["checkboxes"].pack(anchor=W)
# Load Generation Setup option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
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.frames["checkboxes"])
@@ -26,6 +27,7 @@ def generation_page(parent,settings):
self.frames["baserom"] = Frame(self)
self.frames["baserom"].pack(anchor=W, fill=X)
## Locate base ROM
# This one's more-complicated, build it and stuff it
baseRomFrame = Frame(self.frames["baserom"])
baseRomLabel = Label(baseRomFrame, text='Base Rom: ')
self.romVar = StringVar()

View File

@@ -1,8 +1,8 @@
from tkinter import ttk, IntVar, StringVar, Checkbutton, Frame, Label, OptionMenu, E, W, LEFT, RIGHT
from tkinter import ttk, Frame, E, W, LEFT, RIGHT
import gui.widgets as widgets
import json
import os
def item_page(parent):
# Item Randomizer
self = ttk.Frame(parent)
@@ -13,6 +13,7 @@ def item_page(parent):
# Item Randomizer option sections
self.frames = {}
# Item Randomizer option frames
self.frames["checkboxes"] = Frame(self)
self.frames["checkboxes"].pack(anchor=W)
@@ -21,6 +22,10 @@ def item_page(parent):
self.frames["leftItemFrame"].pack(side=LEFT)
self.frames["rightItemFrame"].pack(side=RIGHT)
# Load Item Randomizer option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
# Checkboxes go West
# Everything else goes East
with open(os.path.join("resources","app","gui","randomize","item","widgets.json")) as widgetDefns:
myDict = json.load(widgetDefns)
for framename,theseWidgets in myDict.items():

View File

@@ -1,4 +1,4 @@
from tkinter import ttk, StringVar, Entry, Frame, Label, Spinbox, N, E, W, X, LEFT, RIGHT
from tkinter import ttk, StringVar, Entry, Frame, Label, N, E, W, X, LEFT
import gui.widgets as widgets
import json
import os
@@ -15,6 +15,8 @@ def multiworld_page(parent,settings):
self.frames["widgets"] = Frame(self)
self.frames["widgets"].pack(anchor=W, fill=X)
# Load Multiworld option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes
with open(os.path.join("resources","app","gui","randomize","multiworld","widgets.json")) as multiworldItems:
myDict = json.load(multiworldItems)
dictWidgets = widgets.make_widgets_from_dict(self, myDict, self.frames["widgets"])
@@ -23,6 +25,7 @@ def multiworld_page(parent,settings):
self.widgets[key].pack(side=LEFT, anchor=N)
## List of Player Names
# This one's more-complicated, build it and stuff it
key = "names"
self.widgets[key] = Frame(self.frames["widgets"])
self.widgets[key].label = Label(self.widgets[key], text='Player names')