Zlayers
* Implemented zorder control for specific clothing layers * Fixed Tonks' breasts missing shading.
This commit is contained in:
parent
e4c3c3e51d
commit
8994c77109
BIN
game/characters/tonks/body/breasts/normal.webp
(Stored with Git LFS)
BIN
game/characters/tonks/body/breasts/normal.webp
(Stored with Git LFS)
Binary file not shown.
@ -48,6 +48,10 @@ init python:
|
||||
|
||||
def set_layers(self):
|
||||
for x in self.layers_special:
|
||||
|
||||
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
|
||||
|
||||
@ -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 []
|
||||
|
@ -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")
|
||||
|
@ -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))
|
||||
|
||||
|
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user