Add a pwad_path property and also convert the iwad_path method to a property.

This commit is contained in:
yrriban 2025-07-03 18:21:24 -04:00
parent 5881c94c11
commit b14c12c609
3 changed files with 12 additions and 7 deletions

View file

@ -29,9 +29,14 @@ class Wad(dcc.config.Base):
def wad(self):
return self._wad
@property
def pwad_path(self):
return self.pwads.joinpath(self.wad)
@property
def iwad_path(self):
iwad = self.iwads.joinpath(self._config.get("iwad"))
iwadpath = self.pwads.joinpath(self.wad).joinpath("iwad")
iwadpath = self.pwad_path.joinpath("iwad")
if iwadpath.exists():
with io.open(iwadpath) as f:
iwad = self.iwads.joinpath(f.read().strip() + ".WAD")
@ -61,14 +66,13 @@ class WadMap(Wad):
return "" if self._name is None else "_" + self._name
def dsda_preamble(self):
args = ["-iwad", self.iwad_path()]
args = ["-iwad", self.iwad_path]
pwadpath = self.pwads.joinpath(self.wad)
wads = sorted(pwadpath.glob('*.wad', case_sensitive=False))
wads = sorted(self.pwad_path.glob('*.wad', case_sensitive=False))
if len(wads) > 0:
args = args + ["-file"] + wads
dehs = sorted(pwadpath.glob('*.deh', case_sensitive=False))
dehs = sorted(self.pwad_path.glob('*.deh', case_sensitive=False))
if len(dehs) > 0:
args = args + ["-deh"] + dehs