Support setting a name for a demo, supporting more than one demo stored at a time for a map.
This commit is contained in:
parent
c73c7dd457
commit
85d3686f1c
11 changed files with 35 additions and 30 deletions
|
@ -45,8 +45,8 @@ def DsdaPreamble(wad, mapstr):
|
|||
args = args + ["-warp", mapstr] # TODO: UDoom
|
||||
return args
|
||||
|
||||
def DemoInPath(wad, mapstr):
|
||||
candidates = [x for x in DEMOS.joinpath(wad).glob("{}_map{}*.lmp".format(wad, mapstr))]
|
||||
def DemoInPath(wad, mapstr, name=None):
|
||||
candidates = [x for x in DEMOS.joinpath(wad).glob("{}_map{}{}*.lmp".format(wad, mapstr, NameString(name)))]
|
||||
if len(candidates) == 0:
|
||||
raise Exception("no suitable demo candidates for WAD {} MAP {}.".format(wad, mapstr))
|
||||
if len(candidates) == 1:
|
||||
|
@ -56,11 +56,11 @@ def DemoInPath(wad, mapstr):
|
|||
def DsdaTextPath(wad, mapstr):
|
||||
return Ensure(DEMOS.joinpath(wad)).joinpath("{}_map{}.txt".format(wad, mapstr))
|
||||
|
||||
def DemoOutPath(wad, mapstr):
|
||||
return Ensure(DEMOS.joinpath(wad)).joinpath(DemoName(wad, mapstr))
|
||||
def DemoOutPath(wad, mapstr, name=None):
|
||||
return Ensure(DEMOS.joinpath(wad)).joinpath(DemoName(wad, mapstr, name))
|
||||
|
||||
def DemoName(wad, mapstr):
|
||||
return "{}_map{}.lmp".format(wad, mapstr)
|
||||
def DemoName(wad, mapstr, name=None):
|
||||
return "{}_map{}{}.lmp".format(wad, mapstr, NameString(name))
|
||||
|
||||
def Complevel(wad):
|
||||
complevel = PwadPath(wad).joinpath("complevel")
|
||||
|
@ -81,20 +81,23 @@ def IwadPath(wad):
|
|||
def PwadPath(wad):
|
||||
return Ensure(PWADS.joinpath(wad))
|
||||
|
||||
def BaseThumbPath(wad, mapstr):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}_base.png".format(wad, mapstr))
|
||||
def BaseThumbPath(wad, mapstr, name=None):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}{}_base.png".format(wad, mapstr, NameString(name)))
|
||||
|
||||
def MDoomPath(wad):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("M_DOOM_scaled.png")
|
||||
|
||||
def TextThumbPath(wad, mapstr):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}_text.png".format(wad, mapstr))
|
||||
def TextThumbPath(wad, mapstr, name=None):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}_text.png".format(wad, mapstr, NameString(name)))
|
||||
|
||||
def ThumbPath(wad, mapstr):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}_thumb.png".format(wad, mapstr))
|
||||
def ThumbPath(wad, mapstr, name=None):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}_thumb.png".format(wad, mapstr, NameString(name)))
|
||||
|
||||
def VideoPath(wad, mapstr):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}.mp4".format(wad, mapstr))
|
||||
def VideoPath(wad, mapstr, name=None):
|
||||
return Ensure(OUTPUT.joinpath(wad)).joinpath("{}_map{}{}.mp4".format(wad, mapstr, NameString(name)))
|
||||
|
||||
def NameString(name):
|
||||
return "" if name is None else "_" + name
|
||||
|
||||
def Ensure(path):
|
||||
if not path.exists():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue