From 3fcb80bcfa83bc7f39987f6e25869c89e79f3726 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Fri, 3 Jun 2022 17:41:46 +0100 Subject: [PATCH] Mirror of Erised * Added 'seen' flag to show newly added stories * Added 'played' flag to show stories that have already been played. --- game/scripts/minigames/mirror/classes.rpy | 4 ++++ game/scripts/minigames/mirror/menu.rpy | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/game/scripts/minigames/mirror/classes.rpy b/game/scripts/minigames/mirror/classes.rpy index 9bcbfcb8..9bce2cdb 100644 --- a/game/scripts/minigames/mirror/classes.rpy +++ b/game/scripts/minigames/mirror/classes.rpy @@ -38,6 +38,8 @@ init 5 python: self.req = self.validate_req(req) self.authors = authors self.tags = tags + self.seen = False + self.played = False mirror.add(self) @@ -65,6 +67,8 @@ init 5 python: return req def play(self): + self.played = True + if self.label: renpy.call_replay(self.label) diff --git a/game/scripts/minigames/mirror/menu.rpy b/game/scripts/minigames/mirror/menu.rpy index 6f5e8d75..57df38fa 100644 --- a/game/scripts/minigames/mirror/menu.rpy +++ b/game/scripts/minigames/mirror/menu.rpy @@ -38,6 +38,7 @@ label mirror_menu(xx=150, yy=90): if _choice[0] == "select": $ current_item = _choice[1] + $ current_item.seen = True elif _choice[0] == "category": $ current_category = _choice[1] @@ -152,13 +153,18 @@ screen mirror_menuitem(xx, yy): style_prefix "mirror" for ev in menu_items: $ authors = ", ".join(ev.authors) + $ is_unlocked = ev.is_unlocked() button: ysize 30 selected_background Transform(gui.format("interface/achievements/{}/highlight.webp"), ysize=26) selected (current_item == ev) - sensitive ev.is_unlocked() + sensitive is_unlocked xfill True action Return(["select", ev]) + if is_unlocked and not ev.seen: + text "NEW" style "wardrobe_item_caption" anchor (1.0, 1.0) align (1.0, 1.0) offset (-5, -5) + if ev.played: + add "interface/topbar/icon_check.webp" anchor (1.0, 1.0) align (1.0, 1.0) offset (-5, -5) zoom 0.7 vbox: text ev.name text "By {}".format(authors) size 10