diff --git a/gui/bottom.py b/gui/bottom.py index 71b99040..c7e74c72 100644 --- a/gui/bottom.py +++ b/gui/bottom.py @@ -53,9 +53,9 @@ def bottom_frame(self,parent,args=None): guiargs.heartbeep = parent.gameOptionsWindow.gameOptionsWidgets["heartbeep"].storageVar.get() guiargs.heartcolor = parent.gameOptionsWindow.gameOptionsWidgets["heartcolor"].storageVar.get() guiargs.fastmenu = parent.gameOptionsWindow.gameOptionsWidgets["menuspeed"].storageVar.get() - guiargs.create_spoiler = bool(parent.generationSetupWindow.createSpoilerVar.get()) - guiargs.skip_playthrough = not bool(parent.generationSetupWindow.createSpoilerVar.get()) - guiargs.suppress_rom = bool(parent.generationSetupWindow.suppressRomVar.get()) + guiargs.create_spoiler = bool(parent.generationSetupWindow.generationWidgets["spoiler"].storageVar.get()) + guiargs.skip_playthrough = not bool(parent.generationSetupWindow.generationWidgets["spoiler"].storageVar.get()) + guiargs.suppress_rom = bool(parent.generationSetupWindow.generationWidgets["suppressrom"].storageVar.get()) guiargs.openpyramid = bool(parent.entrandoWindow.entrandoWidgets["openpyramid"].storageVar.get()) guiargs.mapshuffle = bool(parent.dungeonRandoWindow.dungeonWidgets["mapshuffle"].storageVar.get()) guiargs.compassshuffle = bool(parent.dungeonRandoWindow.dungeonWidgets["compassshuffle"].storageVar.get()) diff --git a/gui/loadcliargs.py b/gui/loadcliargs.py index f9c73c23..c2fbfe69 100644 --- a/gui/loadcliargs.py +++ b/gui/loadcliargs.py @@ -4,8 +4,8 @@ def loadcliargs(gui,args): if type(v) is dict: setattr(args, k, v[1]) # only get values for player 1 for now # load values from commandline args - gui.generationSetupWindow.createSpoilerVar.set(int(args.create_spoiler)) - gui.generationSetupWindow.suppressRomVar.set(int(args.suppress_rom)) + gui.generationSetupWindow.generationWidgets["spoiler"].storageVar.set(int(args.create_spoiler)) + gui.generationSetupWindow.generationWidgets["suppressrom"].storageVar.set(int(args.suppress_rom)) gui.dungeonRandoWindow.dungeonWidgets["mapshuffle"].storageVar.set(args.mapshuffle) gui.dungeonRandoWindow.dungeonWidgets["compassshuffle"].storageVar.set(args.compassshuffle) gui.dungeonRandoWindow.dungeonWidgets["smallkeyshuffle"].storageVar.set(args.keyshuffle) diff --git a/gui/randomize/generation.py b/gui/randomize/generation.py index b0f7a565..ecccd3e3 100644 --- a/gui/randomize/generation.py +++ b/gui/randomize/generation.py @@ -1,22 +1,47 @@ import os from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, E, W, LEFT, RIGHT, X +import gui.widgets as widgets def generation_page(parent,working_dirs): + # Generation Setup self = ttk.Frame(parent) # Generation Setup options + self.generationWidgets = {} + ## Generate Spoiler - self.createSpoilerVar = IntVar() - createSpoilerCheckbutton = Checkbutton(self, text="Create Spoiler Log", variable=self.createSpoilerVar) - createSpoilerCheckbutton.pack(anchor=W) + key = "spoiler" + self.generationWidgets[key] = widgets.make_widget( + self, + "checkbox", + self, + "Create Spoiler Log", + None + ) + self.generationWidgets[key].pack(anchor=W) + ## Don't make ROM - self.suppressRomVar = IntVar() - suppressRomCheckbutton = Checkbutton(self, text="Do not create patched Rom", variable=self.suppressRomVar) - suppressRomCheckbutton.pack(anchor=W) + key = "suppressrom" + self.generationWidgets[key] = widgets.make_widget( + self, + "checkbox", + self, + "Do not create patched ROM", + None + ) + self.generationWidgets[key].pack(anchor=W) + ## Use Custom Item Pool as defined in Custom tab - self.customVar = IntVar() - customCheckbutton = Checkbutton(self, text="Use custom item pool", variable=self.customVar) - customCheckbutton.pack(anchor=W) + key = "usecustompool" + self.generationWidgets[key] = widgets.make_widget( + self, + "checkbox", + self, + "Use custom item pool", + None + ) + self.generationWidgets[key].pack(anchor=W) + ## Locate base ROM baseRomFrame = Frame(self) baseRomLabel = Label(baseRomFrame, text='Base Rom: ')