Advertisement
Guest User

RenPy Labels

a guest
Feb 5th, 2015
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. def show_labels(prefix = u""):
  2.     labels = [
  3.         lbn
  4.         for lbn in renpy.get_all_labels().get_rollback()
  5.         if lbn.lower().startswith(prefix)
  6.         ]
  7.     xadjustment = ui.adjustment()
  8.     yadjustment = ui.adjustment()
  9.     while True:
  10.         ui.frame()
  11.         ui.vbox()
  12.         layout.label(_(u"Labels which starts with " + prefix), None)
  13.         ui.textbutton(_(u"Close"), clicked=ui.returns(False), size_group="labels")
  14.         ui.side(['c', 'b', 'r'], spacing=5)
  15.         vp = ui.viewport(xadjustment=xadjustment, yadjustment=yadjustment, mousewheel=True)
  16.         ui.vbox()
  17.         for lbn in labels:
  18.             ui.button(clicked=ui.returns(lbn), size_group="labels", xminimum=1.0)
  19.             ui.text(lbn, style="button_text", xalign=0.0)
  20.         ui.close()
  21.         ui.bar(adjustment=xadjustment, style='scrollbar')
  22.         ui.bar(adjustment=yadjustment, style='vscrollbar')
  23.         ui.close()
  24.         ui.close()
  25.         rv = ui.interact()
  26.         if rv is False:
  27.             return
  28.         renpy.jump(rv)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement