From caa824cefefd6f760854c3a154a0be1046d59e6a Mon Sep 17 00:00:00 2001 From: nutbuster Date: Thu, 17 Nov 2022 15:06:57 +1100 Subject: [PATCH] Jsonified --- game/src/cg_gallery.rpy | 41 ++++++++++++++--------------------- game/src/gallery_dataset.json | 16 ++++++++++++++ 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/game/src/cg_gallery.rpy b/game/src/cg_gallery.rpy index d82a058..dd2bcf3 100644 --- a/game/src/cg_gallery.rpy +++ b/game/src/cg_gallery.rpy @@ -13,14 +13,7 @@ init 2 python: 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", "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/NotForKids!/", 'name': "Lewd", - 'eval': 'persistent.lewd == True' - } - ] + CG_PATHS = [] #path: folder, name: shows up in gallery, eval: runs eval() on string """ @@ -90,26 +83,11 @@ init 2 python: return # Call to loading the gallery - loadGallery() + #loadGallery() #renpy.start_predict_screen("cg_gallery") #sort - - # hard code the webm because renpy is really dumb and doesn't add Movies properly until much later - fang_webm = 'fang thumb' - - webm_rcg = Fixed(Color("#000"), Text("Fang", size=280, xalign=0.5, yalign=0.5), xsize=1920) - renpy.seen_label('fang_movie') - gallery_dic['Animations'] = [{ - "item": 'fang tail', - "fn": 'images/animations/fang tail.webm', - "cg": cg_('images/backgrounds/garden.jpg', None, 1920), - "ext": 'webm', - "wh": [1920, 1080] - }] - renpy.image("fang tail", Movie(loop=True,play='images/animations/fang tail.webm')) # Since we are hard-coding might as well. - #for zooming in and out zoom_arr = [0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0, 1.125, 1.25, 1.5, 1.75, 2.0] @@ -166,7 +144,7 @@ init 2 python: "wh": image_dimensions } gallery_dic[tab_name].append(item) - else: #folders + elif 'folders' in x.keys(): #folders for str in list_img: for cp in x['folders']: for ext in ACCEPTED_EXTENSIONS: @@ -182,6 +160,19 @@ init 2 python: jsonloadandpop() + # hard code the webm because renpy is really dumb and doesn't add Movies properly until much later + fang_webm = 'fang thumb' + + webm_rcg = Fixed(Color("#000"), Text("Fang", size=280, xalign=0.5, yalign=0.5), xsize=1920) + renpy.seen_label('fang_movie') + gallery_dic['Animations'] = [{ + "item": 'fang tail', + "fn": 'fang tail', + "cg": cg_('images/backgrounds/garden.jpg', None, 1920), + "ext": 'webm', + "wh": [1920, 1080] + }] + pass diff --git a/game/src/gallery_dataset.json b/game/src/gallery_dataset.json index 4269c12..a28bd5d 100644 --- a/game/src/gallery_dataset.json +++ b/game/src/gallery_dataset.json @@ -1,5 +1,21 @@ { "tabs":[ + { + "tab_name": "CG", + "folders": [ + "images/cgs/" + ] + }, + { + "tab_name": "Animations" + }, + { + "tab_name": "Lewd", + "eval": "persistent.lewd == True", + "folders": [ + "images/NotForKids!/" + ] + }, { "tab_name": "Full body Fang", "items": [