5.1.1 release #62

Merged
coolestskinnieinthejungle merged 96 commits from 5.1.1 into master 2021-07-21 18:45:22 +00:00
2 changed files with 19 additions and 5 deletions
Showing only changes of commit 1f3a04c355 - Show all commits

View File

@ -359,6 +359,8 @@ pause 1.0
"Volcaldera Bluffs."
$ unlockCg("a02")
"Weather conditions; cold as balls."
"Its my first time living close to water."

View File

@ -1,7 +1,10 @@
default persistent.cggallery = []
init python:
# GALLERY OBJECT
# Handles unlockables via ren'py
g = Gallery()
g.transition = dissolve
# CONST PARAMS
GALLERY_COLS = 3
@ -17,6 +20,13 @@ init python:
# Which page of the gallery is shown
galleryPage = 1
# Global function to unlock a cg
def unlockCg(fname):
unlocked = fname in persistent.cggallery
if not unlocked:
persistent.cggallery.append(fname)
renpy.persistent.save()
# Make a scaled cg button
# (cg: string, unlocked?: boolean): Displayable
def cg(fname, unlocked = False):
@ -33,8 +43,9 @@ init python:
if unlocked:
g.unlock(imageName)
g.condition("True")
else:
g.condition("persistent." + imageName)
g.condition("False")
galleryItems.append({
"item": imageName,
@ -58,7 +69,9 @@ init python:
for cgFile in listdir(cgDirPath):
if isfile(join(cgDirPath, cgFile)):
if (cgFile[-4:] == '.png'):
addGalleryItem(cgFile[0:-4], True)
fname = str(cgFile[0:-4])
unlocked = fname in persistent.cggallery
addGalleryItem(fname, unlocked)
# Add empty items to fill grid after last cg button
extraSpaces = GALLERY_COLS - (len(galleryItems) % GALLERY_COLS)
@ -84,7 +97,7 @@ init python:
## A screen that shows the image gallery
screen cg_gallery():
tag menu
use game_menu(_("Gallery"), scroll="viewport"):
use game_menu(_("Gallery")):
fixed:
$ pageItems = getGalleryPage(galleryPage)
@ -99,8 +112,7 @@ screen cg_gallery():
# Iterate through galleryItems and add cgs buttons
for item in pageItems:
if item["item"] == None:
# TODO: empty space
add g.make_button(pageItems[0]["item"], pageItems[0]["cg"], xalign = 0.5, yalign = 0.5)
hbox
else:
add g.make_button(item["item"], item["cg"], xalign = 0.5, yalign = 0.5)