Compare commits

...

2 Commits

Author SHA1 Message Date
dfd7972752 Avoid using a weak name link 2024-04-04 22:51:02 +02:00
1e8f1ebfb8 Use a dict to store the dolls
the existing variable was a set, all the existing use cases still work (contains tests, iteration, turning into lists...)
2024-04-04 22:50:01 +02:00
2 changed files with 6 additions and 8 deletions

View File

@ -79,7 +79,7 @@ python early hide:
return (who, action) return (who, action)
def execute(self): def execute(self):
print(f"{self}") print(self)
who, action = self who, action = self
chibi = DollChibi.instance[who] chibi = DollChibi.instance[who]
getattr(chibi, action) getattr(chibi, action)
@ -101,7 +101,7 @@ python early hide:
who, action = self who, action = self
chibi = DollChibi.instances[who] chibi = DollChibi.instances[who]
doll = getattr(store, who) doll = states.dolls[who]
layers = ( layers = (
l[0] for pose in chibi.poses.keys() l[0] for pose in chibi.poses.keys()

View File

@ -1,3 +1,5 @@
define renpy.store.states.dolls = {}
init python: init python:
class Doll(DollMethods): class Doll(DollMethods):
# 0 - 50 = Skin/Body Layers # 0 - 50 = Skin/Body Layers
@ -77,15 +79,11 @@ init python:
self.build_image() self.build_image()
# Add doll name to global doll states store renpy.store.states.dolls[name] = self
try:
renpy.store.states.dolls.add(name)
except AttributeError:
renpy.store.states.dolls = {name}
def generate_hash(self): def generate_hash(self):
clothes_hash = str([x[0]._hash for x in self.states.values() if istype(x[0], (DollCloth, DollClothDynamic, DollMakeup)) and x[2]]) clothes_hash = str([x[0]._hash for x in self.states.values() if istype(x[0], (DollCloth, DollClothDynamic, DollMakeup)) and x[2]])
salt = str( [self.name, self.pose, str(self.body._hash), str(self.face._hash), str(self.cum._hash), clothes_hash] ) salt = str([self.name, self.pose, str(self.body._hash), str(self.face._hash), str(self.cum._hash), clothes_hash])
return hash(salt) return hash(salt)
def show(self, force=False, ignore_skipping=False): def show(self, force=False, ignore_skipping=False):