init python: def label_reached_callback(label,is_jumped): if not _in_replay: scene_info=None for page in gallery: for scene in page[1]: if scene["label"]==label: scene_info=scene if scene_info: scope={} for sn, d in renpy.python.store_dicts.items(): if sn!="store": continue for vn in d.ever_been_changed: if vn.startswith("__00"): continue if vn.startswith("_") and not vn.startswith("__"): continue if vn not in d: continue if vn=="nvl_list": continue val=d[vn] if val is None or isinstance(val,(bool,int,long,float,basestring,tuple)): scope[vn]=val else: if isinstance(val,list): for val_v in val: if val_v is not None and not isinstance(val_v,(bool,int,long,float,basestring,tuple)): continue if isinstance(val,dict): for val_k,val_v in val: if val_k is not None and not isinstance(val_k,(bool,int,long,float,basestring,tuple)): continue if val_v is not None and not isinstance(val_v,(bool,int,long,float,basestring,tuple)): continue scope[vn]=val scope.pop("quick_menu",None) scope.pop("walkthrough_mod_enabled",None) scope["gallery_scene_current_bg"]=renpy.get_showing_tags(sort=True) scope["gallery_scene_current_music"]=renpy.music.get_playing() setattr(persistent,"gallery_scope_"+scene_info["id"],scope) config.label_callback=label_reached_callback def unlock_gallery(scene_id): if not getattr(persistent,"gallery_unlocked_"+scene_id,False): scene_info=None for page in gallery: for scene in page[1]: if scene["id"]==scene_id: scene_info=scene renpy.notify("Gallery unlocked: {}".format(scene_info["title"])) setattr(persistent,"gallery_unlocked_"+scene_id,True) renpy.end_replay() label gallery_scene_replay: #KoGa3 scene # if isinstance(renpy.music.is_playing(channel='music'), int): $ gallery_scene_current_music = "SEN-80s-RnB-Groove-Loop.mp3" $renpy.music.play(gallery_scene_current_music,loop=True, fadein=10, if_changed=True) # python hide: # if gallery_scene_current_bg: # for img in gallery_scene_current_bg: # renpy.show(img) jump expression gallery_scene_replay_target define gallery_per_row=4 style gallery_hint: color "#FFF" hover_color "#8E4" size 24 outlines [(0,"#000")] align (0.5,0.5) text_align 0.5 screen gallery(gallery_page=0): tag menu add gui.game_menu_background add "gui/load_overlay.png" hbox: xpos 80 ypos -500 #textbutton _("Gallery") action Null imagebutton auto "gui/gallery_%s.png" action Null focus_mask True #if not main_menu: # hbox: # xalign 0.9 # yalign 0.9 # textbutton _("Exit") action Quit(confirm=not main_menu) # textbutton _(" ") action Null # textbutton _("Main Menu") action MainMenu() # textbutton _(" ") action NullAction() hbox: xalign 0.5 ypos 150 if persistent.KoGa3GalleryUnlock == True: textbutton ("Unlock: On "): text_size 30 action SetVariable("persistent.KoGa3GalleryUnlock", False) else: textbutton ("Unlock: Off "): text_size 30 action SetVariable("persistent.KoGa3GalleryUnlock", True) imagebutton idle "gui/back_idle.png" hover "gui/back_hover.png" focus_mask True style "return_button" action Return() xpos 0 yalign -7.0 #use game_menu(_("Gallery")): $scenes=gallery[gallery_page][1] $scenes=[scenes[n:n+gallery_per_row] for n in range(0,len(scenes),gallery_per_row)] #text gallery[gallery_page][0] xalign 0.5 vbox: align (0.5,0.5) for scenes_row in scenes: hbox: xalign 0.5 for scene_info in scenes_row: python: unlocked=getattr(persistent,"gallery_unlocked_"+scene_info["id"],False) scope={} if unlocked or persistent.KoGa3GalleryUnlock == True: scope.update(getattr(persistent,"gallery_scope_"+scene_info["id"],{}) or {}) scope.update(scene_info.get("scope",{})) scope["gallery_scene_replay_target"]=scene_info["label"] button: padding (20,15) if unlocked or persistent.KoGa3GalleryUnlock == True: fixed: xysize (310,170) #add "gui/buttons/slot_1.png" add Transform("gui/button/unlocked.png", size=(310,170)) add Transform(scene_info["preview"],size=(310,170)) text scene_info["title"] style "gallery_hint" hover_foreground Transform("gui/button/unlocked_active.png", align=(0.5,0.5), size=(310,170)) action Replay("gallery_scene_replay",scope=scope,locked=False) else: fixed: xysize (310,170) #add Transform(scene_info["preview"],size=(310,170)) #add "#000D" add Transform("gui/button/locked.png", size=(310,170)) #foreground Text("LOCKED",style="gallery_hint") if scene_info.get("unlock_hint"): hover_foreground Text(scene_info.get("unlock_hint"),style="gallery_hint") action NullAction() #add "gui/buttons/slot_overlay.png" hbox: align (0.5,0.938) offset (200,-32) for page_n,page in enumerate(gallery): textbutton page[0]: selected page_n==gallery_page xpadding 32 action ShowMenu("gallery",page_n)