stand/lua: Allow MENU_RETURN items to have a func, fix escape to prompt
This commit is contained in:
parent
4571b2776f
commit
ef62584580
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329413
@ -161,6 +161,9 @@ menu.welcome = {
|
|||||||
name = function()
|
name = function()
|
||||||
return color.highlight("Esc").."ape to loader prompt";
|
return color.highlight("Esc").."ape to loader prompt";
|
||||||
end,
|
end,
|
||||||
|
func = function()
|
||||||
|
loader.setenv("autoboot_delay", "NO")
|
||||||
|
end,
|
||||||
alias = {core.KEYSTR_ESCAPE}
|
alias = {core.KEYSTR_ESCAPE}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -301,6 +304,10 @@ function menu.run(m)
|
|||||||
-- recurse
|
-- recurse
|
||||||
cont = menu.run(sel_entry.submenu());
|
cont = menu.run(sel_entry.submenu());
|
||||||
elseif (sel_entry.entry_type == core.MENU_RETURN) then
|
elseif (sel_entry.entry_type == core.MENU_RETURN) then
|
||||||
|
-- allow entry to have a function/side effect
|
||||||
|
if (sel_entry.func ~= nil) then
|
||||||
|
sel_entry.func();
|
||||||
|
end
|
||||||
-- break recurse
|
-- break recurse
|
||||||
cont = false;
|
cont = false;
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user