Move the static values to a defined constant

That way it's not saved and it can be upgraded from version to version
This commit is contained in:
Gouvernathor 2024-04-05 23:26:55 +02:00
parent 0d8e91b5a5
commit 42d2a17a6a
1 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,6 @@
# will be populated by the chibi inits
define __poses = {}
init 5 python:
class DollChibi(renpy.Displayable):
@ -21,7 +24,10 @@ init 5 python:
if doll is None:
doll = states.dolls[name]
self.char = doll
self.poses = poses or {}
__poses[name] = {}
if poses is not None:
self.poses.update(poses)
# Animation
self.anim_frames = None
@ -42,6 +48,11 @@ init 5 python:
self.instances[name] = self
# no setter, on purpose
@property
def poses(self):
return __poses[self.name]
def register(self, pose, frames, size):
self.poses[pose] = (frames, size)