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):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super().get_parser(prog_name)
|
||||
parser.add_argument("--main")
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
iwad = self.iwad_path(parsed_args.wad)
|
||||
pwadpath = self.pwads.joinpath(parsed_args.wad)
|
||||
mw = list(pwadpath.glob(
|
||||
'*{}*.wad'.format(parsed_args.wad), case_sensitive=False
|
||||
))
|
||||
if len(mw) != 1:
|
||||
raise Exception(
|
||||
f"Unable to guess at main pwad for wad {parsed_args.wad}."
|
||||
)
|
||||
if parsed_args.main is not None:
|
||||
mw = pwadpath.joinpath(parsed_args.main)
|
||||
else:
|
||||
mw = sorted(list(pwadpath.glob('*.wad', case_sensitive=False)))[0]
|
||||
|
||||
complevel = self.complevel()
|
||||
port = "vanilla"
|
||||
|
@ -24,5 +26,5 @@ class Eureka(dcc.doom_base.WadMap):
|
|||
|
||||
subprocess.run(
|
||||
["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