From e2943b21dc9af82a9439fa6d89d89becb449dd44 Mon Sep 17 00:00:00 2001 From: "Mike A. Trethewey" Date: Tue, 10 Mar 2020 18:21:36 -0700 Subject: [PATCH] Fix Seed & Player Names --- CLI.py | 4 ++-- source/gui/bottom.py | 4 +--- source/gui/loadcliargs.py | 4 +++- source/gui/randomize/multiworld.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CLI.py b/CLI.py index 0497069a..46d375ce 100644 --- a/CLI.py +++ b/CLI.py @@ -163,8 +163,8 @@ def get_settings(): "custom": False, "rom": os.path.join(".", "Zelda no Densetsu - Kamigami no Triforce (Japan).sfc"), - "seed": None, - "count": None, + "seed": "", + "count": 1, "startinventory": "", "beemizer": 0, "remote_items": False, diff --git a/source/gui/bottom.py b/source/gui/bottom.py index 6d1459d2..f1da09b9 100644 --- a/source/gui/bottom.py +++ b/source/gui/bottom.py @@ -173,11 +173,9 @@ def create_guiargs(parent): guiargs.custom = bool(parent.pages["randomizer"].pages["generation"].widgets["usecustompool"].storageVar.get()) # Get Seed ID - guiargs.seed = None + guiargs.seed = "" if parent.pages["bottom"].pages["content"].widgets["seed"].storageVar.get(): guiargs.seed = parent.pages["bottom"].pages["content"].widgets["seed"].storageVar.get() - if guiargs.seed == "None": - guiargs.seed = None # Get number of generations to run guiargs.count = 1 diff --git a/source/gui/loadcliargs.py b/source/gui/loadcliargs.py index 172db9b3..a528fa50 100644 --- a/source/gui/loadcliargs.py +++ b/source/gui/loadcliargs.py @@ -28,6 +28,8 @@ def loadcliargs(gui, args, settings=None): thisType = "" # Get the value and set it arg = options[mainpage][subpage][widget] + if args[arg] == None: + args[arg] = "" label = fish.translate("gui","gui",mainpage + '.' + subpage + '.' + widget) if hasattr(gui.pages[mainpage].pages[subpage].widgets[widget],"type"): thisType = gui.pages[mainpage].pages[subpage].widgets[widget].type @@ -119,7 +121,7 @@ def loadcliargs(gui, args, settings=None): widget = "seed" setting = "seed" if args[setting]: - gui.pages[mainpage].widgets[widget].storageVar.set(str(args[setting])) + gui.pages[mainpage].widgets[widget].storageVar.set(args[setting]) # set textbox/frame label label = fish.translate("gui","gui",mainpage + '.' + subpage + '.' + widget) gui.pages[mainpage].pages[subpage].widgets[widget].pieces["frame"].label.configure(text=label) diff --git a/source/gui/randomize/multiworld.py b/source/gui/randomize/multiworld.py index d1b69380..369c1b6d 100644 --- a/source/gui/randomize/multiworld.py +++ b/source/gui/randomize/multiworld.py @@ -44,10 +44,10 @@ def multiworld_page(parent,settings): # FIXME: Got some strange behavior here; both Entry-like objects react to mousewheel on Spinbox def saveMultiNames(caller,_,mode): - settings["names"] = self.widgets[widget].storageVar.get() + settings["names"] = self.widgets["names"].storageVar.get() self.widgets[widget].storageVar.trace_add("write",saveMultiNames) # textbox - self.widgets[widget].pieces["textbox"] = Entry(self.widgets[widget].pieces["frame"], textvariable=self.widgets[key].storageVar) + self.widgets[widget].pieces["textbox"] = Entry(self.widgets[widget].pieces["frame"], textvariable=self.widgets[widget].storageVar) # frame label: pack self.widgets[widget].pieces["frame"].label.pack(side=LEFT, anchor=N)