Add a means of indicating the tier of map when adding the index overlay.
This commit is contained in:
parent
9bc41264e5
commit
a982c5b20c
1 changed files with 11 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ import wand.image
|
||||||
class Thumb(doomcc.doom_base.WadMap):
|
class Thumb(doomcc.doom_base.WadMap):
|
||||||
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("--index", action="store_true")
|
parser.add_argument("--index", nargs="?", const="none", default="")
|
||||||
parser.add_argument("--noov", action="store_true")
|
parser.add_argument("--noov", action="store_true")
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
@ -28,11 +28,20 @@ class Thumb(doomcc.doom_base.WadMap):
|
||||||
mdi.border(tc, 5, 5)
|
mdi.border(tc, 5, 5)
|
||||||
bi.composite(mdi, gravity="north_west")
|
bi.composite(mdi, gravity="north_west")
|
||||||
|
|
||||||
if parsed_args.index:
|
if parsed_args.index != "":
|
||||||
with wand.image.Image(
|
with wand.image.Image(
|
||||||
filename=self.fabricate.joinpath("doomed_index.png")
|
filename=self.fabricate.joinpath("doomed_index.png")
|
||||||
) as di:
|
) as di:
|
||||||
di.border(tc, 1, 1)
|
di.border(tc, 1, 1)
|
||||||
bi.composite(di, gravity="north_east")
|
bi.composite(di, gravity="north_east")
|
||||||
|
|
||||||
|
if parsed_args.index != "none":
|
||||||
|
ird = self._config.get("index_rating", {})
|
||||||
|
if parsed_args.index in ird:
|
||||||
|
with wand.image.Image(
|
||||||
|
filename=self.fabricate.joinpath(self.fabricate.joinpath(ird[parsed_args.index]))) as ri:
|
||||||
|
ri.border(tc, 1, 1)
|
||||||
|
bi.composite(ri, top=di.height+5, left=int(bi.width-ri.width-(di.width-ri.width)/2))
|
||||||
|
|
||||||
|
|
||||||
bi.save(filename=self.thumb_path())
|
bi.save(filename=self.thumb_path())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue