menu.lua (dd65496a0418d6cfa1248e41146ebe9908af015f) | menu.lua (9a28f948ee29bfea13c8f128383acc06b2819aeb) |
---|---|
1-- 2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 3-- Copyright (C) 2018 Kyle Evans <kevans@FreeBSD.org> 4-- All rights reserved. 5-- 6-- Redistribution and use in source and binary forms, with or without 7-- modification, are permitted provided that the following conditions 8-- are met: --- 61 unchanged lines hidden (view full) --- 70 if #choices > 0 then 71 caridx = (caridx % #choices) + 1 72 config.setCarouselIndex(carid, caridx) 73 entry.func(caridx, choices[caridx], choices) 74 end 75 end, 76 [core.MENU_SUBMENU] = function(current_menu, entry) 77 -- recurse | 1-- 2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 3-- Copyright (C) 2018 Kyle Evans <kevans@FreeBSD.org> 4-- All rights reserved. 5-- 6-- Redistribution and use in source and binary forms, with or without 7-- modification, are permitted provided that the following conditions 8-- are met: --- 61 unchanged lines hidden (view full) --- 70 if #choices > 0 then 71 caridx = (caridx % #choices) + 1 72 config.setCarouselIndex(carid, caridx) 73 entry.func(caridx, choices[caridx], choices) 74 end 75 end, 76 [core.MENU_SUBMENU] = function(current_menu, entry) 77 -- recurse |
78 return menu.run(entry.submenu()) | 78 return menu.run(entry.submenu) |
79 end, 80 [core.MENU_RETURN] = function(current_menu, entry) 81 -- allow entry to have a function/side effect 82 if entry.func ~= nil then 83 entry.func() 84 end 85 return false 86 end, --- 221 unchanged lines hidden (view full) --- 308 309 -- boot options 310 { 311 entry_type = core.MENU_SUBMENU, 312 name = function() 313 return "Boot " .. color.highlight("O") .. 314 "ptions" 315 end, | 79 end, 80 [core.MENU_RETURN] = function(current_menu, entry) 81 -- allow entry to have a function/side effect 82 if entry.func ~= nil then 83 entry.func() 84 end 85 return false 86 end, --- 221 unchanged lines hidden (view full) --- 308 309 -- boot options 310 { 311 entry_type = core.MENU_SUBMENU, 312 name = function() 313 return "Boot " .. color.highlight("O") .. 314 "ptions" 315 end, |
316 submenu = function() 317 return menu.boot_options 318 end, | 316 submenu = menu.boot_options, |
319 alias = {"o", "O"} 320 }, 321 }, 322} 323 324menu.default = menu.welcome 325 326function menu.run(m) --- 130 unchanged lines hidden --- | 317 alias = {"o", "O"} 318 }, 319 }, 320} 321 322menu.default = menu.welcome 323 324function menu.run(m) --- 130 unchanged lines hidden --- |