Most of this is now in doom_base.py, which stores wad/map/name, exposes them as properties, and also takes care of most common tasks needed for building command lines and such.
42 lines
1 KiB
Python
42 lines
1 KiB
Python
import io
|
|
import pathlib
|
|
import os
|
|
import re
|
|
|
|
DOOM=pathlib.Path.home().joinpath("doom")
|
|
DSDA_DIR=DOOM.joinpath("dsda-doom")
|
|
DSDA_VER='0.28.3'
|
|
DSDA=DSDA_DIR.joinpath('dsda-doom-{}-Linux.appimage'.format(DSDA_VER))
|
|
IWADS=DOOM.joinpath("iwads")
|
|
PWADS=DOOM.joinpath("pwads")
|
|
DEMOS=DOOM.joinpath("demos")
|
|
OUTPUT=DOOM.joinpath("fabricate")
|
|
|
|
DEFAULT_IWAD=IWADS.joinpath("DOOM2.WAD")
|
|
|
|
THUMB_WIDTH=1280
|
|
THUMB_HEIGHT=720
|
|
FONT="League-Spartan-Bold"
|
|
TEXT_FILL_COLOR="white"
|
|
TEXT_STROKE_COLOR="srgb(176,0,0)"
|
|
|
|
MIRROR="https://youfailit.net/pub/idgames" # NYC
|
|
|
|
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 PWADS.joinpath(wad)
|