init python: _config.developer = True def _ZLZK_UGU_aaa(): x, y = renpy.display.draw.get_mouse_pos() layers = [ 'screens' ] tree = renpy.display.render.screen_render.main_displayables_at_point(x, y, layers) items = _list() for depth, width, height, d in tree: if isinstance(d, renpy.display.screen.ScreenDisplayable): s = "_".join(d.screen_name) items.append((s, s)) if not items: renpy.invoke_in_new_context(renpy.call_screen, "_ZLZK_info", "No screens") return if len(items) == 1: choice = items[0][1] else: choice = renpy.invoke_in_new_context(renpy.display_menu, items, scope={ 'title': "Pick screen name" }, screen="_ZLZK_choice") if choice: renpy.invoke_in_new_context(renpy.call_screen, "_ZLZK_add_screen_name", choice) def _sub_caption(s, i): if len(s) <= i: return s return s[:(i-1)] + "..." def _ZLZK_UGU_ccc(screen_name): return for underlay in _config.underlay: if isinstance(underlay, renpy.Keymap): underlay.keymap['_ZLZK_UGU_bbb'] = _ZLZK_UGU_aaa _config.keymap['_ZLZK_UGU_bbb'] = [ 'shift_K_u' ] break screen _ZLZK_info(message): style_prefix "confirm" frame: vbox: xalign .5 yalign .5 spacing 45 label message: style "confirm_prompt" xalign 0.5 hbox: xalign 0.5 spacing 50 textbutton _("Dismiss") action Return(False) key "game_menu" action Return(False) screen _ZLZK_add_screen_name(name): default screen_name = name style_prefix "confirm" frame: vbox: xalign .5 yalign .5 spacing 45 label "Add screen name to the config": style "confirm_prompt" xalign 0.5 input value ScreenVariableInputValue('screen_name', default=True, returnable=False): xalign 0.5 hbox: xalign 0.5 spacing 50 textbutton _("Confirm") action Function(_ZLZK_UGU_ccc, screen_name), Return(True) textbutton _("Reset") action SetScreenVariable('screen_name', name) textbutton _("Cancel") action Return(False) key "game_menu" action Return(False) screen _ZLZK_choice(items, title="", page_size=6, caption_size=36): default il = len(items) default cp = 1 # Current Page python: pp = cp - 1 # Prev Page np = cp + 1 # Next Page ss = page_size * pp # Slice Start se = page_size * cp # Slice End if se > il: se = None vbox: xsize 800 xalign 0.5 yalign 0.5 first_spacing 20 spacing 5 fixed: xfill True ysize 40 if title: frame: xalign 0.5 text _sub_caption(title, caption_size): xalign 0.5 color '#fff' fixed: xfill True ysize 300 vbox: xalign 0.5 spacing 5 for i in items[ss:se]: textbutton i.caption: action i.action xfill True ysize 40 xalign 0.5 yalign 0.5 text_xalign 0.5 text_color '#aaa' text_hover_color "#fff" #text_insensitive_color "#666" fixed: xfill True ysize 40 hbox: xalign 0.5 spacing 5 if il > page_size: textbutton ("<[[Prev Page]"): action SetScreenVariable('cp', pp) sensitive (cp > 1) ysize 40 yalign 0.5 xalign 0.5 text_xalign 0.5 text_color '#aaa' text_hover_color "#fff" text_insensitive_color "#666" textbutton ("<[[Return]>"): action Return("") ysize 40 yalign 0.5 xalign 0.5 text_xalign 0.5 text_color '#aaa' text_hover_color "#fff" #text_insensitive_color "#666" if il > page_size: textbutton ("[[Next Page]>"): action SetScreenVariable('cp', np) sensitive (se != None) ysize 40 yalign 0.5 xalign 0.5 text_xalign 0.5 text_color '#aaa' text_hover_color "#fff" text_insensitive_color "#666"