diff --git a/game/characters/tonks/body/breasts/normal.webp b/game/characters/tonks/body/breasts/normal.webp index df72fbd4..cadcd90b 100644 --- a/game/characters/tonks/body/breasts/normal.webp +++ b/game/characters/tonks/body/breasts/normal.webp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:878652ef87c99aff155571e07aff279d28b89c1fddd2ad7ced23ed708538e531 -size 14606 +oid sha256:b8d1b06ce10c1ddf3ce260070e170a3541b635babce63ba50a6c91699ae512d8 +size 15346 diff --git a/game/characters/tonks/clothes/top/santa_top/0_back.webp b/game/characters/tonks/clothes/top/santa_top/0_zorder_8.webp similarity index 100% rename from game/characters/tonks/clothes/top/santa_top/0_back.webp rename to game/characters/tonks/clothes/top/santa_top/0_zorder_8.webp diff --git a/game/characters/tonks/clothes/top/santa_top/1_back.webp b/game/characters/tonks/clothes/top/santa_top/1_zorder_8.webp similarity index 100% rename from game/characters/tonks/clothes/top/santa_top/1_back.webp rename to game/characters/tonks/clothes/top/santa_top/1_zorder_8.webp diff --git a/game/characters/tonks/clothes/top/santa_top/outline_back.webp b/game/characters/tonks/clothes/top/santa_top/outline_zorder_8.webp similarity index 100% rename from game/characters/tonks/clothes/top/santa_top/outline_back.webp rename to game/characters/tonks/clothes/top/santa_top/outline_zorder_8.webp diff --git a/game/scripts/doll/clothes.rpy b/game/scripts/doll/clothes.rpy index 454ba113..b185f96b 100644 --- a/game/scripts/doll/clothes.rpy +++ b/game/scripts/doll/clothes.rpy @@ -48,8 +48,12 @@ init python: def set_layers(self): for x in self.layers_special: - path = "{}{}.webp".format(self.imagepath, x) - self.__dict__[x] = path if renpy.loadable(path) else None + + if x == "zorder": + self.__dict__["zlayers"] = [f for f in renpy.list_files() if f.startswith(self.imagepath.lstrip("/")) and "zorder" in f] + else: + path = "{}{}.webp".format(self.imagepath, x) + self.__dict__[x] = path if renpy.loadable(path) else None for x in self.layers_additional: self.__dict__[x] = [] @@ -86,6 +90,8 @@ init python: self.get_armfix(mannequin=True) ] + sprites.extend(self.get_zlayers()) + sprites.sort(key=itemgetter(1)) # Apply Alpha mask @@ -146,6 +152,24 @@ init python: # Defers rebuild until next time get_image is called self.cached_icon = False + def get_zlayers(self): + """Returns a list of zordered layers""" + zlayers = [] + + for i in self.zlayers: + path, filename = os.path.split(i) + filename = os.path.splitext(filename)[0] + + # I.e "0_zorder_35", we don't need the middle control + layertype, _, zorder = filename.split("_") + + if layertype.isdigit(): + zlayers.append((self.apply_color(i, int(layertype)), int(zorder))) + else: + zlayers.append((i, int(zorder))) + + return zlayers + def get_back(self): """Returns a list of layers displayed in the back of object/character""" back_outline = [self.back_outline] if self.back_outline else [] diff --git a/game/scripts/doll/common.rpy b/game/scripts/doll/common.rpy index 63693d1c..74c2bce2 100644 --- a/game/scripts/doll/common.rpy +++ b/game/scripts/doll/common.rpy @@ -76,7 +76,7 @@ init -1 python: icon_threadlock = False layers_extra = {"extra", "outline", "overlay"} - layers_special = {"skin", "mask", "wind_mask"} + layers_special = {"skin", "mask", "wind_mask", "zorder"} layers_additional = {"back", "front"} blacklist_toggles = ("hair", "glasses", "pubes", "piercing", "makeup", "tattoo", "earrings") diff --git a/game/scripts/doll/main.rpy b/game/scripts/doll/main.rpy index 7649707c..148e8f56 100644 --- a/game/scripts/doll/main.rpy +++ b/game/scripts/doll/main.rpy @@ -83,9 +83,13 @@ init python: clothing.get_armfix(), ]) + sprites.extend(clothing.get_zlayers()) + if clothing.mask: masks.append((clothing.mask, zorder-1)) + print sprites + sprites.sort(key=itemgetter(1)) masks.sort(key=itemgetter(1)) diff --git a/game/scripts/doll/outfits.rpy b/game/scripts/doll/outfits.rpy index b7e6ec1e..449bd10b 100644 --- a/game/scripts/doll/outfits.rpy +++ b/game/scripts/doll/outfits.rpy @@ -56,6 +56,8 @@ init python: i.get_armfix(mannequin=True), ]) + sprites.extend(i.get_zlayers()) + if i.mask: masks.append((i.mask, i.zorder-1))