init 999 python: import re Replay.locked = property(lambda _: False, lambda *_: None) REPLAY_GALLERY_SCREENS = {screen for screen in renpy.display.screen.screens_by_name if screen.endswith(u"gallery") and screen not in {"replay_gallery", u"cg_gallery"}} | {"phonehamster", "phonereplay"} REPLAY_RE = re.compile(r"^C\dS\d|seen$") persistent.true = True class PersistentPatch: true = True def __init__(self, condition): self.condition = condition def __getattr__(self, name): if self.condition(name): return True return getattr(persistent, name) seen_persistent = PersistentPatch(REPLAY_RE.search) met_persistent = PersistentPatch(lambda name: name.endswith("met")) class PatchedContext(renpy.sl2.slast.SLContext): def __init__(self, *args, **kwargs): super(PatchedContext, self).__init__(*args, **kwargs) screen_name = renpy.display.screen.current_screen().screen_name[0] if screen_name in REPLAY_GALLERY_SCREENS: self.scope["persistent"] = seen_persistent elif screen_name == "replay_gallery": self.scope["persistent"] = met_persistent renpy.sl2.slast.SLContext = PatchedContext cg_thumbnails = [] for variable, image, screen, thb, thumb, wal in CG_List: cg_thumbnails.append(("true", image, screen, thb, thumb)) cg_phonethumbs = [] for variable, image, screen, thumb, thb, wal in CG_List: cg_phonethumbs.append(("true", image, screen, thumb, thb, wal))