Fixing some seed reporting

This commit is contained in:
aerinon
2020-03-23 15:40:56 -06:00
parent 4fc15e84fc
commit 0b13db754d
2 changed files with 10 additions and 4 deletions

View File

@@ -53,7 +53,8 @@ def start():
if args.gui:
from Gui import guiMain
guiMain(args)
elif args.count is not None:
elif args.count is not None and args.count > 1:
random.seed(None)
seed = args.seed or random.randint(0, 999999999)
failures = []
logger = logging.getLogger('')

View File

@@ -91,13 +91,18 @@ def bottom_frame(self, parent, args=None):
seeds = []
if not needEnemizer or (needEnemizer and hasEnemizer):
try:
if guiargs.count is not None:
if guiargs.count is not None and guiargs.seed:
seed = guiargs.seed
for _ in range(guiargs.count):
seeds.append(seed)
main(seed=seed, args=guiargs, fish=parent.fish)
seed = random.randint(0, 999999999)
else:
if guiargs.seed:
seeds.append(guiargs.seed)
else:
random.seed(None)
guiargs.seed = random.randint(0, 999999999)
seeds.append(guiargs.seed)
main(seed=guiargs.seed, args=guiargs, fish=parent.fish)
except (FillError, EnemizerError, Exception, RuntimeError) as e:
@@ -119,7 +124,7 @@ def bottom_frame(self, parent, args=None):
successMsg += (made["playthrough"] % (YES if (guiargs.calc_playthrough) else NO)) + "\n"
successMsg += (made["spoiler"] % (YES if (not guiargs.jsonout and guiargs.create_spoiler) else NO)) + "\n"
# FIXME: English
successMsg += ("Seed%s: %s" % ('s' if len(seeds) > 1 else "", ','.join(seeds)))
successMsg += ("Seed%s: %s" % ('s' if len(seeds) > 1 else "", ','.join(str(x) for x in seeds)))
messagebox.showinfo(title="Success", message=successMsg)