Define a load order method and use it in the dsda and eureka flags.

Also coerce the type of the complevel arg to string; subprocess won't
handle that for us.
This commit is contained in:
yrriban 2025-07-16 02:01:39 -04:00
parent 3cea4a3000
commit 3fc029bf95
2 changed files with 11 additions and 3 deletions

View file

@ -49,6 +49,14 @@ class Wad(dcc.config.Base):
iwad = self.iwads.joinpath(f.read().strip() + ".WAD") iwad = self.iwads.joinpath(f.read().strip() + ".WAD")
return iwad return iwad
def load_order(self):
wads = self._config.get("load_order")
if wads is None:
wads = sorted(self.pwad_path.glob('*.wad', case_sensitive=False))
else:
wads = [self.pwad_path.joinpath(wad) for wad in wads]
return wads
class WadMap(Wad): class WadMap(Wad):
def get_parser(self, prog_name): def get_parser(self, prog_name):
@ -75,7 +83,7 @@ class WadMap(Wad):
def dsda_preamble(self): def dsda_preamble(self):
args = ["-iwad", self.iwad_path] args = ["-iwad", self.iwad_path]
wads = sorted(self.pwad_path.glob('*.wad', case_sensitive=False)) wads = self.load_order()
if len(wads) > 0: if len(wads) > 0:
args = args + ["-file"] + wads args = args + ["-file"] + wads
@ -83,7 +91,7 @@ class WadMap(Wad):
if len(dehs) > 0: if len(dehs) > 0:
args = args + ["-deh"] + dehs args = args + ["-deh"] + dehs
args = args + ["-complevel", self.complevel()] args = args + ["-complevel", str(self.complevel())]
args = args + ["-skill", "4"] args = args + ["-skill", "4"]
args = args + ["-warp", self.map] args = args + ["-warp", self.map]
return args return args

View file

@ -15,7 +15,7 @@ class Eureka(dcc.doom_base.WadMap):
if parsed_args.main is not None: if parsed_args.main is not None:
mw = pwadpath.joinpath(parsed_args.main) mw = pwadpath.joinpath(parsed_args.main)
else: else:
mw = sorted(list(pwadpath.glob('*.wad', case_sensitive=False)))[0] mw = self.load_order()[0]
complevel = self.complevel() complevel = self.complevel()
port = "vanilla" port = "vanilla"