Python:
init python:
LAST_SAVE_REGEX = r"\d+"
def has_recent_save():
return renpy.newest_slot(LAST_SAVE_REGEX) != None
def load_most_recent_save():
filename = renpy.newest_slot(LAST_SAVE_REGEX)
if filename != None:
renpy.load(filename)
init 2 python:
def gallery_thumbnail(thumbnail_name):
return im.FactorScale(thumbnail_name, 0.2)
image_gallery = Gallery()
image_gallery.transition = dissolve
image_gallery.locked_button = "game_gui/gallery_locked_button.png"
image_gallery.button("slot01")
image_gallery.condition('renpy.seen_image("intro6")')
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro6")
image_gallery.button("slot02")
image_gallery.condition('renpy.seen_image("intro1")')
image_gallery.unlock_image("intro4")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro1")
image_gallery.button("slot03")
image_gallery.condition('renpy.seen_image("intro2")')
image_gallery.unlock_image("intro6")
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro2")
image_gallery.button("slot04")
image_gallery.condition('renpy.seen_image("intro6")')
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro6")
image_gallery.button("slot05")
image_gallery.condition('renpy.seen_image("intro1")')
image_gallery.unlock_image("intro4")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro1")
image_gallery.button("slot06")
image_gallery.condition('renpy.seen_image("intro2")')
image_gallery.unlock_image("intro6")
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro2")
image_gallery.button("slot07")
image_gallery.condition('renpy.seen_image("intro6")')
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro6")
image_gallery.button("slot08")
image_gallery.condition('renpy.seen_image("intro1")')
image_gallery.unlock_image("intro4")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro1")
image_gallery.button("slot09")
image_gallery.condition('renpy.seen_image("intro2")')
image_gallery.unlock_image("intro6")
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro2")
image_gallery.button("slot10")
image_gallery.condition('renpy.seen_image("intro6")')
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro6")
image_gallery.button("slot11")
image_gallery.condition('renpy.seen_image("intro1")')
image_gallery.unlock_image("intro4")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro2")
image_gallery.unlock_image("intro1")
image_gallery.button("slot12")
image_gallery.condition('renpy.seen_image("intro2")')
image_gallery.unlock_image("intro6")
image_gallery.unlock_image("intro1")
image_gallery.unlock_image("intro0")
image_gallery.unlock_image("intro3")
image_gallery.unlock_image("intro2")
image_gallery_slots = []
image_gallery_slots.extend(
[
( "slot01", "Ch 1: Brad and Emily", "intro/intro1.png" ),
( "slot02", "Ch 1: Parker and Becky", "intro/intro4.png" ),
( "slot03", "Ch 2: Melanie\u2019s Bra", "intro/intro6.png" ),
( "slot04", "Ch 1: Brad and Emily", "intro/intro1.png" ),
( "slot05", "Ch 1: Parker and Becky", "intro/intro4.png" ),
( "slot05", "Ch 2: Melanie\u2019s Bra", "intro/intro6.png" ),
( "slot06", "Ch 1: Brad and Emily", "intro/intro1.png" ),
( "slot07", "Ch 1: Parker and Becky", "intro/intro4.png" ),
( "slot08", "Ch 2: Melanie\u2019s Bra", "intro/intro6.png" ),
( "slot09", "Ch 1: Brad and Emily", "intro/intro1.png" ),
( "slot10", "Ch 1: Parker and Becky", "intro/intro4.png" ),
( "slot11", "Ch 2: Melanie\u2019s Bra", "intro/intro6.png" ),
( "slot12", "Ch 2: Melanie\u2019s Bra", "intro/intro6.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)
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 "" 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"