Bug fixes

* Fixed Cho's quidditch outfit being supplied list of colours even when not needed.
* Fixed Hermione hair cum layers
* Added sanity check for missing directories for cum layers relying on clothing states.
* Added sanity check for apply_color function, and added hints how to fix the errors.
This commit is contained in:
LoafyLemon 2023-03-13 21:18:40 +00:00
parent 591377163a
commit ac6313863f
8 changed files with 10 additions and 15 deletions

View File

@ -200,8 +200,12 @@ init python:
try:
c = TintMatrix(self.color[n])
return Transform(img, matrixcolor=c)
except TypeError:
print(f"Item doesn't support colors but was supplied with a list; Try removing numbered files in its directory:\n{self.__repr__()}")
d = At(Frame(Text("TypeErr", color="#ffff00"), tile=True), blink_repeat)
return Transform(AlphaMask(d, img))
except IndexError:
print(f"Mismatched number of textures and colors:\n{self.__repr__()}")
print(f"Mismatched number of textures and colors; Try reducing number of supplied colours in item definition:\n{self.__repr__()}")
d = At(Frame(Text("IndxErr", color="#ff0000"), tile=True), blink_repeat)
return Transform(AlphaMask(d, img))

View File

@ -78,6 +78,9 @@ init python:
path = posixpath.join(modpath, "characters", self.char.name, "poses", self.char.pose, "cum", part, name, identifier)
path = path if _lookahead(path) else posixpath.join(os.path.split(path)[0], (identifier := "default"))
if config.developer and not _lookahead(path):
print(f"Files and/or directories are missing: {path}/")
else:
zorder = types.get("cum")
path = posixpath.join(self.char.modpath, "characters", self.char.name, "poses", self.char.pose, "cum", part, name)
@ -92,7 +95,7 @@ init python:
ltype, *tails = fn.rsplit("_")
if not ltype in types:
print("Invalid layer type for file: {}".format(f))
print(f"Invalid layer type for file: {f}")
continue
zorder = zorder or types.get(ltype)
@ -101,7 +104,7 @@ init python:
lmodifier, *tails = tails
if not lmodifier in modifiers:
print("Invalid modifier for file: {}".format(f))
print(f"Invalid modifier for file: {f}")
continue
zorder_mod = modifiers.get(lmodifier)