From 4bbf57036d755c1e2538b4b8ea897914579e8461 Mon Sep 17 00:00:00 2001 From: yrriban Date: Tue, 1 Jul 2025 22:53:59 -0400 Subject: [PATCH] Use the same method that the dsda preamble uses to figure out what the main wad is. --- dcc/eureka.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dcc/eureka.py b/dcc/eureka.py index ed049e3..d147879 100644 --- a/dcc/eureka.py +++ b/dcc/eureka.py @@ -4,16 +4,18 @@ import subprocess class Eureka(dcc.doom_base.WadMap): + def get_parser(self, prog_name): + parser = super().get_parser(prog_name) + parser.add_argument("--main") + return parser + def take_action(self, parsed_args): iwad = self.iwad_path(parsed_args.wad) pwadpath = self.pwads.joinpath(parsed_args.wad) - mw = list(pwadpath.glob( - '*{}*.wad'.format(parsed_args.wad), case_sensitive=False - )) - if len(mw) != 1: - raise Exception( - f"Unable to guess at main pwad for wad {parsed_args.wad}." - ) + if parsed_args.main is not None: + mw = pwadpath.joinpath(parsed_args.main) + else: + mw = sorted(list(pwadpath.glob('*.wad', case_sensitive=False)))[0] complevel = self.complevel() port = "vanilla" @@ -24,5 +26,5 @@ class Eureka(dcc.doom_base.WadMap): subprocess.run( ["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map] - + ["-p", port] + [mw[0]] + + ["-p", port] + [mw] )