Mirror of Erised

* Added 'seen' flag to show newly added stories
* Added 'played' flag to show stories that have already been played.
This commit is contained in:
LoafyLemon 2022-06-03 17:41:46 +01:00
parent 108475316d
commit 3fcb80bcfa
2 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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