From 3d4142bee4410ab3caa379640de47be7c362fe04 Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Tue, 17 Dec 2019 21:14:20 +0100 Subject: [PATCH] Gui: properly instantiate the Namespace object and fix default player settings --- Gui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gui.py b/Gui.py index 749f072b..f50c41d9 100755 --- a/Gui.py +++ b/Gui.py @@ -372,7 +372,7 @@ def guiMain(args=None): countSpinbox = Spinbox(bottomFrame, from_=1, to=100, width=5, textvariable=countVar) def generateRom(): - guiargs = Namespace + guiargs = Namespace() guiargs.multi = int(worldVar.get()) guiargs.names = namesVar.get() guiargs.seed = int(seedVar.get()) if seedVar.get() else None @@ -428,6 +428,8 @@ def guiMain(args=None): for k,v in vars(parse_arguments([])).items(): if k not in vars(guiargs): setattr(guiargs, k, v) + elif type(v) is dict: # use same settings for every player + setattr(guiargs, k, {player: getattr(guiargs, k) for player in range(1, guiargs.multi + 1)}) try: if guiargs.count is not None: seed = guiargs.seed @@ -548,7 +550,7 @@ def guiMain(args=None): bottomFrame2 = Frame(topFrame2) def adjustRom(): - guiargs = Namespace + guiargs = Namespace() guiargs.heartbeep = heartbeepVar.get() guiargs.heartcolor = heartcolorVar.get() guiargs.fastmenu = fastMenuVar.get()