Use the same method that the dsda preamble uses to figure out what the main wad is.
This commit is contained in:
parent
ebdac7c89d
commit
4bbf57036d
1 changed files with 10 additions and 8 deletions
|
@ -4,16 +4,18 @@ import subprocess
|
||||||
|
|
||||||
|
|
||||||
class Eureka(dcc.doom_base.WadMap):
|
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):
|
def take_action(self, parsed_args):
|
||||||
iwad = self.iwad_path(parsed_args.wad)
|
iwad = self.iwad_path(parsed_args.wad)
|
||||||
pwadpath = self.pwads.joinpath(parsed_args.wad)
|
pwadpath = self.pwads.joinpath(parsed_args.wad)
|
||||||
mw = list(pwadpath.glob(
|
if parsed_args.main is not None:
|
||||||
'*{}*.wad'.format(parsed_args.wad), case_sensitive=False
|
mw = pwadpath.joinpath(parsed_args.main)
|
||||||
))
|
else:
|
||||||
if len(mw) != 1:
|
mw = sorted(list(pwadpath.glob('*.wad', case_sensitive=False)))[0]
|
||||||
raise Exception(
|
|
||||||
f"Unable to guess at main pwad for wad {parsed_args.wad}."
|
|
||||||
)
|
|
||||||
|
|
||||||
complevel = self.complevel()
|
complevel = self.complevel()
|
||||||
port = "vanilla"
|
port = "vanilla"
|
||||||
|
@ -24,5 +26,5 @@ class Eureka(dcc.doom_base.WadMap):
|
||||||
|
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map]
|
["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map]
|
||||||
+ ["-p", port] + [mw[0]]
|
+ ["-p", port] + [mw]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue