I tried using unlock conditions like this:
Code: Select all
$ persistent_unlock = True
$ persistent_unlock = False
Code: Select all
init python:
# Step 1. Create the gallery object.
g = Gallery()
# Step 2. Add buttons and images to the gallery.
# A button that contains an image that automatically unlocks.
g.button("bg logo")
g.unlock_image("bg logo")
# This button has a condition associated with it, allowing code
# to choose which images unlock.
g.button("bg ye")
g.condition("persistent.unlock_1")
g.image ("bg reader")
g.image ("bg yukihosp")
g.image("bg yukidream")
g.image("bg hug")
g.image("bg hospend")
g.image("bg towerend")
g.button("bg ue")
g.condition("persistent.unlock_2")
g.image ("bg reader")
g.image ("bg yukihosp")
g.image ("bg whitekiss")
g.image("bg hospend")
g.image ("bg karaokepic")
g.button ("bg oe")
g.condition ("persistent.unlock_3")
g.image ("bg reader")
g.image ("bg yukihosp")
g.image ("bg benchkiss")
g.image ("bg yumidream")
# The transition used when switching images.
g.transition = fade
# Step 3. The gallery screen we use.
screen gallery:
# Ensure this replaces the main menu.
tag menu
# The background.
add "gallery"
# A grid of buttons.
grid 3 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("bg logo", "icon.png", xalign=0.5, yalign=0.5)
add g.make_button("bg oe", "oe.png", xalign=0.5, yalign=0.5)
add g.make_button("bg ue", "ue.png", xalign=0.5, yalign=0.5)
add g.make_button("bg ye", "ye.png", xalign=0.5, yalign=0.5)
add g.make_button("bg logo", "icon.png", xalign=0.5, yalign=0.5)
add g.make_button("bg logo", "icon.png", xalign=0.5, yalign=0.5)
add g.make_button("bg logo", "icon.png", xalign=0.5, yalign=0.5)
add g.make_button("bg logo", "icon.png", xalign=0.5, yalign=0.5)
# The screen is responsible for returning to the main menu. It could also
# navigate to other gallery screens.
textbutton "Return" action Return() xalign 0.5 yalign 0.5