- Nov 14, 2020
- 20
- 4
Hello everyone,
I have a small issue, I have in gallery a screen in which you can select a specific character and then you can see the unlocked scenes with this character - and here is my issue - when I click return in the scene gallery of any specific character, I get thrown back to the main menu, when I would like to go back just one step - to the gallery character selection. Can somebody help me with that? Here is my whole code for the gallery:
I have a small issue, I have in gallery a screen in which you can select a specific character and then you can see the unlocked scenes with this character - and here is my issue - when I click return in the scene gallery of any specific character, I get thrown back to the main menu, when I would like to go back just one step - to the gallery character selection. Can somebody help me with that? Here is my whole code for the gallery:
Code:
init python:
galleryItems = []
class GalleryItem:
def __init__(self, char, label, lockedImage, unlockedImage, unlockedText, scope=None):
self.char = char
self.label = label
self.lockedImage = lockedImage
self.unlockedImage = unlockedImage
self.unlockedText = unlockedText
if scope is None: self.scope = {}
else: self.scope = scope
galleryItems.append(self)
def updateScope(newScope):
rv = scopeDict.copy()
rv.update(newScope)
return rv
## GALLERY ITEMS HERE
# GalleryItem("CHARACTER", "LABEL", "LOCKED_IMAGE", "UNLOCKED_IMAGE", "UNLOCKED_TEXT", SCOPE)
GalleryItem("Ashira", "ashirasex1", "PatreonAshiraBlack.jpg", "Day1AshiraApartment.jpg", "Ashira's Apartment Day 1")
GalleryItem("Alero", "myLabel", "PatreonAleroBlack.jpg", "Day1AshiraAleroPool.jpg", "Ashira and Alero Swimming Pool Day 1")
default scopeDict = {}
define galleryMenu = [
# ["CHARACTER", "IDLE_IMAGE", "HOVER_IMAGE"]
["Ashira", "PatreonAshiraQualityFull1.jpg", "patreonashiraqualityfullhovered.jpg"],
["Alero", "PatreonAleroQualityFull1.jpg", "patreonaleroqualityfullhovered.jpg"],
["Naomi", "PatreonNaomiQualityFull1.jpg", "patreonnaomiqualityfullhovered.jpg"],
["Nix", "PatreonNixQualityFull1.jpg", "patreonnixqualityfullhovered.jpg"],
["Odessa", "PatreonOdessaQualityFull1.jpg", "patreonodessaqualityfullhovered.jpg"],
["Vanessa", "PatreonVanessaQualityFull1.jpg", "patreonvanessaqualityfullhovered.jpg"]
]
screen scene_gallery():
tag menu
use game_menu(_("Scene Gallery"), scroll="viewport"):
grid 2 3:
spacing 10
for char in galleryMenu:
imagebutton:
idle char[1]
hover char[2]
focus_mask True
action Show("scene_selection", character=char[0])
screen scene_selection(character):
tag menu
use game_menu(_("Scene Gallery"), scroll="viewport"):
hbox:
box_wrap True
spacing 10
for galleryItem in galleryItems:
if galleryItem.char == character:
vbox:
imagebutton:
idle galleryItem.unlockedImage
insensitive galleryItem.lockedImage
action Replay(galleryItem.label, scope=updateScope(galleryItem.scope), locked=False)
if renpy.seen_label(galleryItem.label):
text galleryItem.unlockedText
else:
text "???"
textbutton "Return" action Show("scene_gallery")