Code: Select all
init python:
def gallery_thumbnail(thumbnail_name):
return im.FactorScale(thumbnail_name, 0.2)
image_gallery = Gallery()
image_gallery.transition = dissolve
image_gallery.button("slot01")
image_gallery.condition('True')
image_gallery.image("1")
image_gallery.image("6")
image_gallery.button("slot02")
image_gallery.condition('True')
image_gallery.image("3")
image_gallery.image("6")
image_gallery.button("slot03")
image_gallery.condition('True')
image_gallery.image("4")
image_gallery.image("10")
image_gallery.button("slot04")
image_gallery.condition('True')
image_gallery.image("8")
image_gallery.image("12")
image_gallery.button("slot05")
image_gallery.condition('True')
image_gallery.image("14")
image_gallery.image("6")
image_gallery.button("slot06")
image_gallery.condition('True')
image_gallery.image("11")
image_gallery.image("9")
image_gallery.button("slot07")
image_gallery.condition('True')
image_gallery.image("7")
image_gallery.image("6")
image_gallery.button("slot08")
image_gallery.condition('True')
image_gallery.image("2")
image_gallery.image("14")
image_gallery.button("slot09")
image_gallery.condition('True')
image_gallery.image("2")
image_gallery.image("7")
image_gallery.button("slot10")
image_gallery.condition('True')
image_gallery.image("9")
image_gallery.image("12")
image_gallery.button("slot11")
image_gallery.condition('True')
image_gallery.image("12")
image_gallery.image("11")
image_gallery.button("slot12")
image_gallery.condition('True')
image_gallery.image("4")
image_gallery.image("6")
image_gallery.button("slot13")
image_gallery.condition('True')
image_gallery.image("10")
image_gallery.image("6")
image_gallery.button("slot14")
image_gallery.condition('True')
image_gallery.image("8")
image_gallery.image("14")
image_gallery_slots = []
image_gallery_slots.extend(
[
( "slot01", "Ch 1: Brad and Emily", "test/6.png" ),
( "slot02", "Ch 1: Parker and Becky", "test/3.png" ),
( "slot03", "Ch 2: Melanie\u2019s Bra", "test/10.png" ),
( "slot04", "Ch 1: Brad and Emily", "test/8.png" ),
( "slot05", "Ch 1: Parker and Becky", "test/14.png" ),
( "slot06", "Ch 2: Melanie\u2019s Bra", "test/11.png" ),
( "slot07", "Ch 1: Brad and Emily", "test/6.png" ),
( "slot08", "Ch 1: Parker and Becky", "test/2.png" ),
( "slot09", "Ch 2: Melanie\u2019s Bra", "test/7.png" ),
( "slot10", "Ch 1: Brad and Emily", "test/12.png" ),
( "slot11", "Ch 1: Parker and Becky", "test/11.png" ),
( "slot12", "Ch 2: Melanie\u2019s Bra", "test/4.png" ),
( "slot13", "Ch 2: Melanie\u2019s Bra", "test/10.png" ),
( "slot14", "Ch 1: Brad and Emily", "test/14.png" ),
#( "slot02", "Ch 1: Parker and Becky", "test/14.png" ),
])
@renpy.pure
def get_image_gallery_page_count():
return (len(image_gallery_slots) + 5) // 6
@renpy.pure
def get_image_gallery_page(page):
slots = []
first_index = (page - 1) * 6
for i in range(first_index, first_index + 6):
if i < len(image_gallery_slots):
slots.append(image_gallery_slots[i])
else:
slots.append((None, None, None))
return slots
screen gallery_buttons(data):
for (name, title, thumbnail) in data:
if name:
vbox:
$ the_button = image_gallery.make_button(name, gallery_thumbnail(thumbnail))
add the_button
if image_gallery.buttons[name].check_unlock():
text title
else:
text ""
else:
text ""
screen gallery():
tag menu
default page = 1
default total_pages = get_image_gallery_page_count()
use game_menu(_("Gallery"), scroll="viewport"):
style_prefix "gallery"
vbox:
xsize 940
ysize 500
label "Page [page]":
xalign 0.5
bottom_margin 10
grid 3 2:
style_prefix "gallery_slot"
xalign 0.5
yalign 0.5
xspacing 30
yspacing 20
use gallery_buttons(get_image_gallery_page(page))
hbox:
style_prefix "page"
anchor (0.5, 0.0)
pos (0.5, 1.0)
spacing gui.page_spacing
if page > 1:
textbutton _("<") action SetScreenVariable("page",
page - 1)
else:
textbutton _("<") action NullAction()
for i in range(1, total_pages + 1):
textbutton "[i]" action SetScreenVariable("page", i)
if page < total_pages:
textbutton _(">") action SetScreenVariable("page",
page + 1)
else:
textbutton _(">") action NullAction()
style gallery_slot_text:
size 18
xalign 0.5
yalign 0.0
style gallery_button is button:
hover_background "#fff"
style gallery_button_text:
size 24
bold True
color "#fff"
hover_color "#000"
underline True
style gallery_button_current is button
style gallery_button_current_text is gallery_button_text:
underline False
hover_color "#fff"