From ac6313863ff0fe10aee0d80dbb9e0eb8f4353184 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Mon, 13 Mar 2023 21:18:40 +0000 Subject: [PATCH] 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. --- .../cho/poses/default/clothes/accessory/protectors1/0.webp | 3 --- .../poses/default/clothes/accessory/protectors1/extra.webp | 3 --- .../cho/poses/default/clothes/accessory/protectors2/0.webp | 3 --- .../poses/default/clothes/accessory/protectors2/extra.webp | 3 --- .../poses/default/cum/hair/heavy/{ => default}/cum.webp | 0 .../poses/default/cum/hair/light/{ => default}/cum.webp | 0 game/scripts/doll/clothes.rpy | 6 +++++- game/scripts/doll/cum.rpy | 7 +++++-- 8 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 game/characters/cho/poses/default/clothes/accessory/protectors1/0.webp delete mode 100644 game/characters/cho/poses/default/clothes/accessory/protectors1/extra.webp delete mode 100644 game/characters/cho/poses/default/clothes/accessory/protectors2/0.webp delete mode 100644 game/characters/cho/poses/default/clothes/accessory/protectors2/extra.webp rename game/characters/hermione/poses/default/cum/hair/heavy/{ => default}/cum.webp (100%) rename game/characters/hermione/poses/default/cum/hair/light/{ => default}/cum.webp (100%) diff --git a/game/characters/cho/poses/default/clothes/accessory/protectors1/0.webp b/game/characters/cho/poses/default/clothes/accessory/protectors1/0.webp deleted file mode 100644 index 6fbb7bcc..00000000 --- a/game/characters/cho/poses/default/clothes/accessory/protectors1/0.webp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4f16469f76fa22ea43a2346407a802434ae02dff4da1c40bec6af146a42feae -size 94 diff --git a/game/characters/cho/poses/default/clothes/accessory/protectors1/extra.webp b/game/characters/cho/poses/default/clothes/accessory/protectors1/extra.webp deleted file mode 100644 index 6fbb7bcc..00000000 --- a/game/characters/cho/poses/default/clothes/accessory/protectors1/extra.webp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4f16469f76fa22ea43a2346407a802434ae02dff4da1c40bec6af146a42feae -size 94 diff --git a/game/characters/cho/poses/default/clothes/accessory/protectors2/0.webp b/game/characters/cho/poses/default/clothes/accessory/protectors2/0.webp deleted file mode 100644 index 6fbb7bcc..00000000 --- a/game/characters/cho/poses/default/clothes/accessory/protectors2/0.webp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4f16469f76fa22ea43a2346407a802434ae02dff4da1c40bec6af146a42feae -size 94 diff --git a/game/characters/cho/poses/default/clothes/accessory/protectors2/extra.webp b/game/characters/cho/poses/default/clothes/accessory/protectors2/extra.webp deleted file mode 100644 index 6fbb7bcc..00000000 --- a/game/characters/cho/poses/default/clothes/accessory/protectors2/extra.webp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4f16469f76fa22ea43a2346407a802434ae02dff4da1c40bec6af146a42feae -size 94 diff --git a/game/characters/hermione/poses/default/cum/hair/heavy/cum.webp b/game/characters/hermione/poses/default/cum/hair/heavy/default/cum.webp similarity index 100% rename from game/characters/hermione/poses/default/cum/hair/heavy/cum.webp rename to game/characters/hermione/poses/default/cum/hair/heavy/default/cum.webp diff --git a/game/characters/hermione/poses/default/cum/hair/light/cum.webp b/game/characters/hermione/poses/default/cum/hair/light/default/cum.webp similarity index 100% rename from game/characters/hermione/poses/default/cum/hair/light/cum.webp rename to game/characters/hermione/poses/default/cum/hair/light/default/cum.webp diff --git a/game/scripts/doll/clothes.rpy b/game/scripts/doll/clothes.rpy index d6914742..426a8bf9 100644 --- a/game/scripts/doll/clothes.rpy +++ b/game/scripts/doll/clothes.rpy @@ -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)) diff --git a/game/scripts/doll/cum.rpy b/game/scripts/doll/cum.rpy index 06cf8c95..2635481d 100644 --- a/game/scripts/doll/cum.rpy +++ b/game/scripts/doll/cum.rpy @@ -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)