1
0
Fork 0
forked from len0rd/rockbox

lua add submenu module + cleanup

allows menus + submenus + context menus all with simple tables
menu_t which is a table of strings
func_t which are the corresponding functions to go with those strings

see lua_scripts/submenu_demo.lua

Change-Id: I907b74b4abef0ecbe49f181d0ced6e6d20e94de5
This commit is contained in:
William Wilgus 2021-04-27 23:12:49 -04:00 committed by William Wilgus
parent d5695822a7
commit 63b6281505
8 changed files with 478 additions and 120 deletions

View file

@ -0,0 +1,28 @@
local rbac_is_loaded = (package.loaded.actions ~= nil)
require("actions") -- Contains rb.actions & rb.contexts
-- Menu Button definitions --
local button_t = {
CANCEL = rb.actions.PLA_CANCEL,
DOWN = rb.actions.PLA_DOWN,
DOWNR = rb.actions.PLA_DOWN_REPEAT,
EXIT = rb.actions.PLA_EXIT,
LEFT = rb.actions.PLA_LEFT,
LEFTR = rb.actions.PLA_LEFT_REPEAT,
RIGHT = rb.actions.PLA_RIGHT,
RIGHTR = rb.actions.PLA_RIGHT_REPEAT,
SEL = rb.actions.PLA_SELECT,
SELREL = rb.actions.PLA_SELECT_REL,
SELR = rb.actions.PLA_SELECT_REPEAT,
UP = rb.actions.PLA_UP,
UPR = rb.actions.PLA_UP_REPEAT,
}
if not rbac_is_loaded then
rb.actions = nil
rb.contexts = nil
package.loaded.actionss = nil
end
return button_t