Compare commits
No commits in common. "469d8eb13ab67f67031aaea60e3b0dfcab00af17" and "3fc029bf958552afd32e7982703a32eb95b28521" have entirely different histories.
469d8eb13a
...
3fc029bf95
4 changed files with 9 additions and 11 deletions
|
@ -92,7 +92,7 @@ class Concat(dcc.doom_base.Wad):
|
||||||
)
|
)
|
||||||
img.trim(reset_coords=True)
|
img.trim(reset_coords=True)
|
||||||
img.border("graya(25%, 25%)", 10, 10)
|
img.border("graya(25%, 25%)", 10, 10)
|
||||||
img.border(self.thumbnail_text_stroke, 16, 16)
|
img.border(dcc.config.TEXT_STROKE_COLOR, 16, 16)
|
||||||
# for this to work... the image needs to have a width that's a
|
# for this to work... the image needs to have a width that's a
|
||||||
# multiple of 8. dude whyyyyyyy
|
# multiple of 8. dude whyyyyyyy
|
||||||
padfactor = 8
|
padfactor = 8
|
||||||
|
|
|
@ -20,7 +20,6 @@ class Base(Command):
|
||||||
self._config_name = parsed_args.config_name
|
self._config_name = parsed_args.config_name
|
||||||
self._config = tomlkit.toml_file.TOMLFile(
|
self._config = tomlkit.toml_file.TOMLFile(
|
||||||
self.doom.joinpath(self.config_name)).read()
|
self.doom.joinpath(self.config_name)).read()
|
||||||
|
|
||||||
self._dsda = self._config.get("dsda")
|
self._dsda = self._config.get("dsda")
|
||||||
if self.dsda is None:
|
if self.dsda is None:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
|
@ -29,7 +28,6 @@ class Base(Command):
|
||||||
for d in ("iwads", "pwads", "demos", "fabricate"):
|
for d in ("iwads", "pwads", "demos", "fabricate"):
|
||||||
self._init_attr([d], d, fn=self.doom.joinpath)
|
self._init_attr([d], d, fn=self.doom.joinpath)
|
||||||
|
|
||||||
def finalize(self):
|
|
||||||
self._init_attr(["thumbnail", "height"], 720)
|
self._init_attr(["thumbnail", "height"], 720)
|
||||||
self._init_attr(["thumbnail", "width"], 1280)
|
self._init_attr(["thumbnail", "width"], 1280)
|
||||||
self._init_attr(["thumbnail", "font"], None)
|
self._init_attr(["thumbnail", "font"], None)
|
||||||
|
|
|
@ -21,13 +21,12 @@ class Wad(dcc.config.Base):
|
||||||
self._wad_config = tomlkit.toml_file.TOMLFile(wcp).read()
|
self._wad_config = tomlkit.toml_file.TOMLFile(wcp).read()
|
||||||
for k,v in self._wad_config.items():
|
for k,v in self._wad_config.items():
|
||||||
if isinstance(v, dict):
|
if isinstance(v, dict):
|
||||||
if k not in self._config:
|
if not k in self._config:
|
||||||
self._config[k] = {}
|
self._config[k] = {}
|
||||||
for sk in v:
|
for sk in v:
|
||||||
self._config[k][sk] = v[sk]
|
self._config[k][sk] = v[sk]
|
||||||
else:
|
else:
|
||||||
self._config[k] = v
|
self._config[k] = v
|
||||||
self.finalize()
|
|
||||||
|
|
||||||
def run(self, parsed_args):
|
def run(self, parsed_args):
|
||||||
self.wad_init(parsed_args)
|
self.wad_init(parsed_args)
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import dcc.doom_base
|
import dcc.config
|
||||||
import omg
|
import omg
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import wand.color
|
import wand.color
|
||||||
import wand.image
|
import wand.image
|
||||||
|
|
||||||
|
|
||||||
class Extract(dcc.doom_base.Wad):
|
class Extract(dcc.config.base):
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
parser = super().get_parser(prog_name)
|
parser = super().get_parser(prog_name)
|
||||||
|
parser.add_argument('wad')
|
||||||
parser.add_argument('lump')
|
parser.add_argument('lump')
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ class Extract(dcc.doom_base.Wad):
|
||||||
) as img:
|
) as img:
|
||||||
img.transparent_color(wand.color.Color("#ff00ff"), 0.0)
|
img.transparent_color(wand.color.Color("#ff00ff"), 0.0)
|
||||||
img.save(
|
img.save(
|
||||||
filename=self.fabricate.joinpath(parsed_args.wad)
|
filename=self.output.joinpath(parsed_args.wad)
|
||||||
.joinpath(parsed_args.lump + ".png")
|
.joinpath(parsed_args.lump + ".png")
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue