Bug Fixes

* Refresh image if showing on specific function calls
This commit is contained in:
LoafyLemon 2023-01-19 18:07:10 +00:00
parent 99f174cfbb
commit 2946efbd2b
2 changed files with 34 additions and 0 deletions

View File

@ -23,6 +23,7 @@ init python:
self._cum = {k: args[0] for k in self._cum}
self._cum.update(kwargs)
self.is_stale()
@functools.cache
def get_layers(self, hash):

View File

@ -131,6 +131,10 @@ init python:
self.rebuild_blacklist()
update_chibi(self.name)
self.is_stale()
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
def _equip_cloth(self, cloth, color=None):
if cloth.type in self.multislots:
@ -187,6 +191,10 @@ init python:
self.rebuild_blacklist()
update_chibi(self.name)
self.is_stale()
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
def get_equipped(self, type):
"""Takes argument containing string cloth type. Returns equipped object for cloth type."""
@ -215,6 +223,10 @@ init python:
self.clothes[arg][2] = False
update_chibi(self.name)
self.is_stale()
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
def wear(self, *args):
"""Takes argument(s) containing string cloth type(s) to put on (unhide)."""
@ -234,6 +246,10 @@ init python:
self.clothes[arg][2] = True
update_chibi(self.name)
self.is_stale()
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
def is_equipped(self, *args):
"""Takes argument containing string cloth type. Returns True if slot is occupied, False otherwise."""
@ -312,6 +328,12 @@ init python:
"""Takes integer between 0 - 359, rotates the character body colour by given amount."""
self.body.set_hue(arg)
[x[0].is_stale() for x in self.clothes.values() if x[0] and x[2]]
self.is_stale()
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
# def set_body_zorder(self, **kwargs):
# OBSOLETE! the code in scripts needs to be changed
# """Takes keyword argument(s) with the name(s) of body part(s) and integer value(s)"""
@ -322,9 +344,19 @@ init python:
"""Takes keyword argument(s) containing string name(s) of cum layers to apply or None."""
self.cum.set_cum(*args, **kwargs)
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
def set_pose(self, pose):
pose = "" if pose is None else os.path.join("poses", pose)
self.pose = pose
self.body.is_stale()
self.face.is_stale()
self.cum.is_stale()
[x[0].is_stale() for x in self.clothes.values() if x[0] and x[2]]
if renpy.showing(get_character_tag(self.name), layer=self.layer):
self.show()
def rebuild_blacklist(self):
blacklist = []
@ -430,3 +462,4 @@ init python:
path = "characters/{}/emote/{}.webp".format(self.name, emote)
self.emote = Image(path)
self.is_stale()