Fixing some seed reporting
This commit is contained in:
@@ -53,7 +53,8 @@ def start():
|
|||||||
if args.gui:
|
if args.gui:
|
||||||
from Gui import guiMain
|
from Gui import guiMain
|
||||||
guiMain(args)
|
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)
|
seed = args.seed or random.randint(0, 999999999)
|
||||||
failures = []
|
failures = []
|
||||||
logger = logging.getLogger('')
|
logger = logging.getLogger('')
|
||||||
|
|||||||
@@ -91,14 +91,19 @@ def bottom_frame(self, parent, args=None):
|
|||||||
seeds = []
|
seeds = []
|
||||||
if not needEnemizer or (needEnemizer and hasEnemizer):
|
if not needEnemizer or (needEnemizer and hasEnemizer):
|
||||||
try:
|
try:
|
||||||
if guiargs.count is not None:
|
if guiargs.count is not None and guiargs.seed:
|
||||||
seed = guiargs.seed
|
seed = guiargs.seed
|
||||||
for _ in range(guiargs.count):
|
for _ in range(guiargs.count):
|
||||||
seeds.append(seed)
|
seeds.append(seed)
|
||||||
main(seed=seed, args=guiargs, fish=parent.fish)
|
main(seed=seed, args=guiargs, fish=parent.fish)
|
||||||
seed = random.randint(0, 999999999)
|
seed = random.randint(0, 999999999)
|
||||||
else:
|
else:
|
||||||
seeds.append(guiargs.seed)
|
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)
|
main(seed=guiargs.seed, args=guiargs, fish=parent.fish)
|
||||||
except (FillError, EnemizerError, Exception, RuntimeError) as e:
|
except (FillError, EnemizerError, Exception, RuntimeError) as e:
|
||||||
logging.exception(e)
|
logging.exception(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["playthrough"] % (YES if (guiargs.calc_playthrough) else NO)) + "\n"
|
||||||
successMsg += (made["spoiler"] % (YES if (not guiargs.jsonout and guiargs.create_spoiler) else NO)) + "\n"
|
successMsg += (made["spoiler"] % (YES if (not guiargs.jsonout and guiargs.create_spoiler) else NO)) + "\n"
|
||||||
# FIXME: English
|
# 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)
|
messagebox.showinfo(title="Success", message=successMsg)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user