Add a command to invoke eureka for the given wad and map.
This commit is contained in:
parent
70826d4227
commit
7f397f352f
3 changed files with 39 additions and 9 deletions
|
@ -23,15 +23,9 @@ TEXT_STROKE_COLOR="srgb(176,0,0)"
|
|||
MIRROR="https://youfailit.net/pub/idgames" # NYC
|
||||
|
||||
def DsdaPreamble(wad, mapstr):
|
||||
args = []
|
||||
pwadpath = PWADS.joinpath(wad)
|
||||
iwad = DEFAULT_IWAD
|
||||
iwadpath = pwadpath.joinpath("iwad")
|
||||
if iwadpath.exists():
|
||||
with io.open(iwadpath) as f:
|
||||
iwad = IWADS.joinpath(f.read().strip() + ".WAD")
|
||||
args = args + ["-iwad", iwad]
|
||||
args = ["-iwad", IwadPath(wad)]
|
||||
|
||||
pwadpath = PWADS.joinpath(wad)
|
||||
wads = sorted(pwadpath.glob('*.wad', case_sensitive=False))
|
||||
if len(wads) > 0:
|
||||
args = args + ["-file"] + wads
|
||||
|
@ -45,7 +39,7 @@ def DsdaPreamble(wad, mapstr):
|
|||
raise Exception("No complevel set in PWAD dir {}.".format(pwadpath))
|
||||
|
||||
with io.open(complevel) as f:
|
||||
args = args + ["-complevel", f.read().strip()]
|
||||
args = args + ["-complevel", Complevel(wad)]
|
||||
|
||||
args = args + ["-skill", "4"]
|
||||
args = args + ["-warp", mapstr] # TODO: UDoom
|
||||
|
@ -68,6 +62,22 @@ def DemoOutPath(wad, mapstr):
|
|||
def DemoName(wad, mapstr):
|
||||
return "{}_map{}.lmp".format(wad, mapstr)
|
||||
|
||||
def Complevel(wad):
|
||||
complevel = PwadPath(wad).joinpath("complevel")
|
||||
if not complevel.exists():
|
||||
raise Exception("No complevel set in PWAD dir {}.".format(pwadpath))
|
||||
|
||||
with io.open(complevel) as f:
|
||||
return f.read().strip()
|
||||
|
||||
def IwadPath(wad):
|
||||
iwad = DEFAULT_IWAD
|
||||
iwadpath = PwadPath(wad).joinpath("iwad")
|
||||
if iwadpath.exists():
|
||||
with io.open(iwadpath) as f:
|
||||
iwad = IWADS.joinpath(f.read().strip() + ".WAD")
|
||||
return iwad
|
||||
|
||||
def PwadPath(wad):
|
||||
return Ensure(PWADS.joinpath(wad))
|
||||
|
||||
|
|
19
dcc/eureka.py
Normal file
19
dcc/eureka.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import dcc.doom_base
|
||||
import dcc.config
|
||||
import subprocess
|
||||
|
||||
class Eureka(dcc.doom_base.WadMap):
|
||||
def take_action(self, parsed_args):
|
||||
iwad = dcc.config.IwadPath(parsed_args.wad)
|
||||
pwadpath = dcc.config.PwadPath(parsed_args.wad)
|
||||
mw = list(pwadpath.glob('*{}*.wad'.format(parsed_args.wad), case_sensitive=False))
|
||||
if len(mw) != 1:
|
||||
raise Exception("Unable to guess at main pwad for wad {}.".format(parsed_args.wad))
|
||||
complevel = dcc.config.Complevel(parsed_args.wad)
|
||||
port = "vanilla"
|
||||
if complevel == "9":
|
||||
port = "boom"
|
||||
if complevel == "11" or complevel == "21":
|
||||
port = "mbf"
|
||||
|
||||
subprocess.run(["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map] + ["-p", port] + [mw[0]])
|
1
setup.py
1
setup.py
|
@ -33,6 +33,7 @@ setup(
|
|||
'text = dcc.text:Text',
|
||||
'thumb = dcc.thumb:Thumb',
|
||||
'dsda = dcc.dsda:DSDA',
|
||||
'eureka = dcc.eureka:Eureka',
|
||||
],
|
||||
},
|
||||
zip_safe=False,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue