Add a configure command for initial wad setup. Reshuffle a couple things that depend on it.

This commit is contained in:
yrriban 2025-07-03 18:18:19 -04:00
parent 673e649e87
commit 5881c94c11
4 changed files with 34 additions and 10 deletions

View file

@ -29,6 +29,14 @@ class Wad(dcc.config.Base):
def wad(self):
return self._wad
def iwad_path(self):
iwad = self.iwads.joinpath(self._config.get("iwad"))
iwadpath = self.pwads.joinpath(self.wad).joinpath("iwad")
if iwadpath.exists():
with io.open(iwadpath) as f:
iwad = self.iwads.joinpath(f.read().strip() + ".WAD")
return iwad
class WadMap(Wad):
def get_parser(self, prog_name):
@ -53,7 +61,7 @@ class WadMap(Wad):
return "" if self._name is None else "_" + self._name
def dsda_preamble(self):
args = ["-iwad", self.iwad_path(self.wad)]
args = ["-iwad", self.iwad_path()]
pwadpath = self.pwads.joinpath(self.wad)
wads = sorted(pwadpath.glob('*.wad', case_sensitive=False))