i am trying to make an endings screen for my renpy game. i want the endings screen to be like the lily's day off endings screen where you can click on an ending you got and it will jump to that ending so you can replay it. i am currently trying to get this to work with a vpgrid.
any help is appreciated!
default persistent.endings = ["Ending 1", "Ending 2"]
## dont disable this, it will cause glitches
define config.allow_underfull_grids = True
screen endings():
tag menu
vpgrid:
xalign 0.5
yalign 0.5
cols 1
spacing 10
mousewheel True
for t in persistent.endings:
# here is supposed to be code that makes a new button for every item in the persistent.endings list
textbutton _("Return"):
yalign 1.0
xalign 0.0
action Return()
So. that's not really how you wanted to do this. I'll say that you probably don't want a vpgrid unless you have so many endings that it won't fit on one screen - if you have only a few, a vbox is fine.
You also probably want a different structure to indicate which endings are unlocked.
define endings = [
( "ending_1", _("A New Day")),
( "ending_2", _("The End of All Things")),
]
screen endings():
tag menu
use game_menu(_("Endings")):
vbox:
for flag, label in all_endings:
if getattr(persistent, flag):
text "[label]"
else:
text _("(Ending Locked)")
# i replaced "all_endings" with "endings"
for flag, label in endings:
if getattr(persistent, flag):
textbutton "[label]" action Call(label)
else:
textbutton _("(Ending Locked)")