Contained in /sdcard/menu.lol

BUKKIT definition

  • count - Number of menu items contained in the BUKKIT
  • top - Index of first item to display in the list
  • selected - Index of currently selected item
  • label - BUKKIT of menu labels
  • callback - BUKKIT of menu callbacks
  • preview - BUKKIT of paths to preview images (must be in RAW format and 220x176)

Helpers

  • create_menu YR <menu> MKAY - Menu BUKKIT constructor
  • add_item_to_menu YR <menu> AN YR <label> AN YR <callback> AN YR <preview> MKAY - Add a menu item to the menu BUKKIT

Execution

Run do_menu passing the BUKKIT. The function will block until the menu quits which is usually triggered by the user. When an item is selected the associated callback will be run.

Return Value

None.

Example

  FREND "/sdcard/include.lol"
  FREND "/sdcard/menu.lol"

  HOW IZ I first_item_cb
    VISIBLE "First Item Selected"
  IF U SAY SO

  HOW IZ I second_item_cb
    VISIBLE "Second Item Selected"
  IF U SAY SO

  I HAS A menu ITZ A BUKKIT
  I IZ create_menu YR menu MKAY
  I IZ add_item_to_menu YR menu AN YR "Bling" AN YR menu_bling AN YR "/sdcard/bling/hypnotoad1.preview" MKAY
  I IZ add_item_to_menu YR menu AN YR "Settings" AN YR menu_settings AN YR "/sdcard/bling/settings.preview" MKAY

  I IZ do_menu YR menu MKAY

Contained in /sdcard/popup.lol

BUKKIT definition

  • title - Text to put in the title bar - careful, limited space
  • body - Text to put in the body. This will be scrollable
  • left - Text to put in the left button.
  • Right - Text to put in the right button.

Execution

Run do_popup passing the BUKKIT. The function will block until the user selects an option (left or right).

Return Value

The text in the button selected by the user.

Example

 HAI 100
  FREND "/sdcard/include.lol"
  FREND "/sdcard/popup.lol"

  I HAS A popup ITZ A BUKKIT
  popup HAS A title ITZ "Popup Test"
  popup HAS A body ITZ "This is a test of the popup in LULZCODE."
  popup HAS A left ITZ "Cancel"
  popup HAS A right ITZ "Ok"
  VISIBLE "Popup result = " I IZ do_popup YR popup MKAY
KTHXBYE

Title Bar

Run do_title_bar passing a short label to render. This will render to the gfx buffer but not push. Use LOLOLOL when done rendering the UI.

The location of the line in the title bar is globally stored in title_bar_height variable.

Global Colors

Contained in /sdcard/include.lol

  • Black: DARK
  • White: LIGHT
  • Blue: `BLUEISH
  • Green: GREENISH
  • Red: REDISH
  • Yellow: YELLOWISH
  • DEFCON Green: HACKER_GREEN
  • DEFCON Red: HACKER_RED
  • DEFCON Gray: HACKER_GRAY
  • DEFCON Blue: HACKER_BLUE