Add back in Animations

This commit is contained in:
Nutbuster 2021-07-18 13:16:11 +10:00
parent 6b86285683
commit e8b907fe1d
1 changed files with 15 additions and 14 deletions

View File

@ -7,11 +7,11 @@ init python:
DEFAULT_WIDTH_SCALE_RATIO = round(float(PREFERRED_WIDTH) / float(1920), 4)
DEFAULT_HEIGHT_SCALE_RATIO = round(float(PREFERRED_HEIGHT) / float(1080), 4)
NOT_UNLOCKED_COVER = im.FactorScale("gui/gallery/unlocked_cg_button_cover.png", DEFAULT_WIDTH_SCALE_RATIO, DEFAULT_HEIGHT_SCALE_RATIO)
ACCEPTED_EXTENSIONS = ["jpg", "png"]
ACCEPTED_EXTENSIONS = ["jpg", "webm"]
CG_PATHS = [
#CG doesn't really make sense
{ 'path': "images/cgs/", 'name': "CG", 'eval': None },
#{ 'path': "images/animations/", 'name': "Animations", 'eval': None },
{ 'path': "images/animations/", 'name': "Animations", 'eval': None },
{ 'path': "images/NotForKids!/", 'name': "Lewd",
'eval': 'persistent.lewd == True'
}
@ -49,19 +49,20 @@ init python:
# Add each image to the gallery
for str in list_img:
for cp in CG_PATHS:
path = cp['path']
_str = path+str+"."+ACCEPTED_EXTENSIONS[0]
if renpy.loadable(_str): #brute force
image = renpy.image_size(Image(_str))
for ext in ACCEPTED_EXTENSIONS:
path = cp['path']
_str = path+str+"."+ext
if renpy.loadable(_str): #brute force
image = renpy.image_size(Image(_str))
# Create an object in g:Gallery, add to galleryItems
# (imageName: string; ext: string; w: float; h: float) -> None
gallery_dic[cp['name']] += [{
"item": str,
"fn": _str,
"cg": cg(_str, ACCEPTED_EXTENSIONS[0], image[0], image[1]),
"ext": ACCEPTED_EXTENSIONS[0]
}]
# Create an object in g:Gallery, add to galleryItems
# (imageName: string; ext: string; w: float; h: float) -> None
gallery_dic[cp['name']] += [{
"item": str,
"fn": _str,
"cg": cg(_str, ext, image[0], image[1]),
"ext": ext
}]
return
# (xy) -> { x: float; y: float }