Code: Select all
screen gallery:
tag menu
add "pink2.png"
$start = gallery_page * maxperpage
$end = min(start + maxperpage - 1, len(gallery_items) - 1)
#grid for images
grid maxnumx maxnumy:
xfill True
yfill True
for i in range(start, end + 1):
$gallery_items[i].refresh_lock()
if gallery_items[i].is_locked:
add gallery_items[i].locked:
xalign 0.5
yalign 0.5
else:
imagebutton idle gallery_items[i].thumb:
action Show("gallery_closeup", gallery_items[i].images)
xalign 0.5
yalign 0.5
for i in range(end - start + 1, maxperpage):
null
#grid for info
grid maxnumx maxnumy:
xfill True
yfill True
for i in range(start, end + 1):
hbox:
spacing maxthumbx - 70
xalign 0.5
yalign 0.1
$total = gallery_items[i].num_images()
$partial = gallery_items[i].num_unlocked
text gallery_items[i].name
text "[partial]/[total]"
for i in range(end - start + 1, maxperpage):
null
#previous/next buttons
if gallery_page > 0:
textbutton "Previous":
action SetVariable("gallery_page", gallery_page - 1)
xalign 0.1
yalign 0.98
if (gallery_page + 1) * maxperpage < len(gallery_items):
textbutton "Next":
action SetVariable("gallery_page", gallery_page + 1)
xalign 0.9
yalign 0.98
#return button
textbutton "Back to Main Menu":
action Return()
xalign 0.5
yalign 0.98
screen gallery_closeup(images):
add images[closeup_page] at truecenter
if closeup_page > 0:
textbutton "Previous":
action SetVariable("closeup_page", closeup_page - 1)
xalign 0.1
yalign 0.98
background "black.png"
if closeup_page < len(images) - 1:
textbutton "Next":
action SetVariable("closeup_page", closeup_page + 1)
xalign 0.9
yalign 0.98
background "black.png"
textbutton "Return":
action [SetVariable("closeup_page", 0), Hide("gallery_closeup", dissolve)]
xalign 0.5
yalign 0.98
background "black.png"
Code: Select all
imagebutton idle gallery_items[i].thumb:
action Show("gallery_closeup", gallery_items[i].images)
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/gallery.rpy", line 1, in execute
screen gallery:
File "game/gallery.rpy", line 10, in execute
grid maxnumx maxnumy:
File "game/gallery.rpy", line 14, in execute
for i in range(start, end + 1):
File "game/gallery.rpy", line 16, in execute
if gallery_items[i].is_locked:
File "game/gallery.rpy", line 21, in execute
imagebutton idle gallery_items[i].thumb:
Exception: Not a displayable: None
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
$ ui.interact()
File "C:\renpy-6.99.5-sdk\renpy\ast.py", line 797, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\renpy-6.99.5-sdk\renpy\python.py", line 1448, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
$ ui.interact()
File "C:\renpy-6.99.5-sdk\renpy\ui.py", line 277, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\renpy-6.99.5-sdk\renpy\display\core.py", line 2296, in interact
scene_lists.replace_transient()
File "C:\renpy-6.99.5-sdk\renpy\display\core.py", line 674, in replace_transient
self.remove(layer, tag)
File "C:\renpy-6.99.5-sdk\renpy\display\core.py", line 961, in remove
self.hide_or_replace(layer, remove_index, "hide")
File "C:\renpy-6.99.5-sdk\renpy\display\core.py", line 885, in hide_or_replace
d = oldsle.displayable._hide(now - st, now - at, prefix)
File "C:\renpy-6.99.5-sdk\renpy\display\screen.py", line 430, in _hide
self.update()
File "C:\renpy-6.99.5-sdk\renpy\display\screen.py", line 565, in update
self.screen.function(**self.scope)
File "game/gallery.rpy", line 1, in execute
screen gallery:
File "game/gallery.rpy", line 10, in execute
grid maxnumx maxnumy:
File "game/gallery.rpy", line 14, in execute
for i in range(start, end + 1):
File "game/gallery.rpy", line 16, in execute
if gallery_items[i].is_locked:
File "game/gallery.rpy", line 21, in execute
imagebutton idle gallery_items[i].thumb:
File "C:\renpy-6.99.5-sdk\renpy\ui.py", line 914, in _imagebutton
**properties)
File "C:\renpy-6.99.5-sdk\renpy\display\behavior.py", line 843, in __init__
hover_ = renpy.easy.displayable(hover_image),
File "C:\renpy-6.99.5-sdk\renpy\easy.py", line 129, in displayable
raise Exception("Not a displayable: %r" % (d,))
Exception: Not a displayable: None