so i make the menu list in extra ending like this (and also shown in the pict):
Code: Select all
init:
$ config.main_menu.insert(2, ('Extras', "extra", "persistent.my_extras"))
label extras:
#This part here indicates whether or not the player has unlocked the menu
if not persistent.my_bonus:
show bg black with dissolve
centered "You haven't unlocked this yet"
$ renpy.full_restart()
scene bg meadow
with dissolve
menu:
"Endings":
jump Endings
"Gallery":
jump cg_gallery_screen
"Return":
jump main_menu_screen
Code: Select all
init python:
# If persistent.endings is None (the first pass through the game), then make it a set.
if persistent.endings is None:
persistent.endings = set()
# This shows a single ending, as necessary.
def show_ending(number, name):
if name in persistent.endings:
ui.text("% 2d. %s" % (number, name))
else:
ui.text("% 2d. ???" % (number,))
# Add a button that brings people to the ending list to the main menu.
config.main_menu.insert(2, ("Endings", "endings_1", "True"))
label Endings:
scene bg cave with dissolve
$ ui.vbox()
$ ui.text("Askary Endings")
$ show_ending(1, "True Ending")
$ show_ending(2, "Bad Ending")
$ show_ending(3, "Worst Ending")
$ ui.close()
$ ui.textbutton("Return", clicked=ui.jumps("endings_return"), xalign=0.05, yalign=0.95)
$ ui.interact(suppress_overlay=True)
# Jump here to return to the main menu.
label endings_return:
jump extras
Code: Select all
init python:
gallery_cg_items = ["cg01"]
gal_rows = 2
gal_cols = 2
thumbnail_x = 200
thumbnail_y = 150
gal_cells = gal_rows * gal_cols
g_cg = Gallery()
for gal_item in gallery_cg_items:
g_cg.button(gal_item + " butt")
g_cg.image(gal_item)
g_cg.unlock(gal_item)
g_cg.transition = fade
cg_page=0
init +1 python:
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
label cg_gallery:
scene bg cave with dissolve
$ ui.vbox()
use navigation
frame background None xpos 10:
grid gal_rows gal_cols:
ypos 10
$ i = 0
$ next_cg_page = cg_page + 1
if next_cg_page > int(len(gallery_cg_items)/gal_cells):
$ next_cg_page = 0
for gal_item in gallery_cg_items:
$ i += 1
if i <= (cg_page+1)*gal_cells and i>cg_page*gal_cells:
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.jpg", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
null
frame:
yalign 0.97
vbox:
if len(gallery_cg_items)>gal_cells:
textbutton _("Next Page") action [SetVariable('cg_page', next_cg_page), ShowMenu("cg_gallery")]
What code do it really needed in order to show list of picture in 'Gallery' menu inside 'label' Extras?
And also, with the same condition in 'label' Extras, how to create a music gallery?