- Nov 14, 2020
- 20
- 4
Hi could someone tell why this code below isn't working? I wanted to do a scene gallery with replays of scene from the game, but I'm stuck on the unlocked image no matter what I do, it doesn't show the scene. Can someone tell me what to do to 1) unlock the scene 2) replay it?
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 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))
if renpy.seen_label(galleryItem.label):
text galleryItem.unlockedText
else:
text "???"