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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue