init 1: screen gallery(start=0): modal True tag menu $ num = 8 $ end = start+num $ gallery = Gallery([k for k, v in sorted(Pictures.__dict__.items()) if isinstance(v, Picture)]) $ pics = gallery.pics[start:end] $ pics += [None] * (num-len(pics)) $ money = "${}".format(mc.inventory.money) if hasattr(renpy.store, "mc") else "" default description = Tooltip("") use popup(left_button=(money, None), page_num=end / num, prev_action=Show("gallery", None, start-num) if start > 0 else None, next_action=Show("gallery", None, end) if len(gallery.pics) > end else None): style_prefix "popup_purple" grid 4 2: spacing 8 for idx, pic in enumerate(pics): button: xsize 230 ysize 135 padding (1, 1) if not pic is None: if pic.replay is None: action ShowTransient("gallery_fullscreen", None, start+idx) else: action Function(renpy.call_replay, pic.replay, {'mods': pic.mods}) hovered description.Action(pic.description) add im.Scale(ImageReference(pic.image), 228, 133) frame: style "popup_purple_description" style_prefix "popup_purple_description" text description.value add KonamiListener('konami_code') screen gallery_fullscreen(idx): $ gallery = Gallery(persistent.gallery) $ img = gallery.pics[idx].image $ prev = idx > 0 $ next = idx+1 < len(gallery.pics) $ prev_action = ShowTransient("gallery_fullscreen", None, idx-1) if prev else None $ next_action = ShowTransient("gallery_fullscreen", None, idx+1) if next else None modal True key "K_ESCAPE" action Hide("gallery_fullscreen") key "mouseup_3" action Hide("gallery_fullscreen") if not prev_action is None: key "mousedown_4" action prev_action key "mousedown_6" action prev_action if not next_action is None: key "mousedown_5" action next_action key "mousedown_7" action next_action frame: xfill True yfill True background "gui gallery_background" add img imagebutton: style_prefix "gallery_prev" yfill True padding (38, 0, 137, 0) idle "gui gallery_prev" hover "gui gallery_prev_hover" action prev_action imagebutton: style_prefix "gallery_next" yfill True padding (137, 0, 38, 0) xalign 1. idle "gui gallery_next" hover "gui gallery_next_hover" action next_action imagebutton: style_prefix "gallery_exit" padding (37, 29, 26, 29) xalign 1. idle "gui gallery_exit" hover "gui gallery_exit_hover" action Hide("gallery_fullscreen")