From 3cea4a30009878979c3cac551791eda7918d5c80 Mon Sep 17 00:00:00 2001 From: yrriban Date: Wed, 16 Jul 2025 02:01:05 -0400 Subject: [PATCH 1/2] Fix text generation when it's not in the config. --- dcc/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcc/text.py b/dcc/text.py index a349a62..af06ebb 100644 --- a/dcc/text.py +++ b/dcc/text.py @@ -33,9 +33,9 @@ class Text(dcc.doom_base.WadMap): def take_action(self, parsed_args): text = None - map_names = self._config["map_names"] + map_names = self._config.get("map_names") if map_names is not None: - text = map_names[f"map{parsed_args.map}"] + text = map_names.get(f"map{parsed_args.map}") if text is None: text = sys.stdin.read().rstrip() if not parsed_args.nomap: From 3fc029bf958552afd32e7982703a32eb95b28521 Mon Sep 17 00:00:00 2001 From: yrriban Date: Wed, 16 Jul 2025 02:01:39 -0400 Subject: [PATCH 2/2] 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. --- dcc/doom_base.py | 12 ++++++++++-- dcc/eureka.py | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dcc/doom_base.py b/dcc/doom_base.py index 44983fe..39c7fdc 100644 --- a/dcc/doom_base.py +++ b/dcc/doom_base.py @@ -49,6 +49,14 @@ class Wad(dcc.config.Base): iwad = self.iwads.joinpath(f.read().strip() + ".WAD") 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): def get_parser(self, prog_name): @@ -75,7 +83,7 @@ class WadMap(Wad): def dsda_preamble(self): args = ["-iwad", self.iwad_path] - wads = sorted(self.pwad_path.glob('*.wad', case_sensitive=False)) + wads = self.load_order() if len(wads) > 0: args = args + ["-file"] + wads @@ -83,7 +91,7 @@ class WadMap(Wad): if len(dehs) > 0: args = args + ["-deh"] + dehs - args = args + ["-complevel", self.complevel()] + args = args + ["-complevel", str(self.complevel())] args = args + ["-skill", "4"] args = args + ["-warp", self.map] return args diff --git a/dcc/eureka.py b/dcc/eureka.py index 5aa2c56..392f596 100644 --- a/dcc/eureka.py +++ b/dcc/eureka.py @@ -15,7 +15,7 @@ class Eureka(dcc.doom_base.WadMap): if parsed_args.main is not None: mw = pwadpath.joinpath(parsed_args.main) else: - mw = sorted(list(pwadpath.glob('*.wad', case_sensitive=False)))[0] + mw = self.load_order()[0] complevel = self.complevel() port = "vanilla"