mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
stand/lua: Refactor brands into drawer.branddefs
This commit is contained in:
parent
bb26c57ded
commit
29aa5794d0
1 changed files with 14 additions and 3 deletions
|
|
@ -171,6 +171,15 @@ orb = {
|
|||
|
||||
none = {""};
|
||||
|
||||
drawer.branddefs = {
|
||||
["fbsd"] = {
|
||||
graphic = fbsd_logo,
|
||||
},
|
||||
["none"] = {
|
||||
graphic = none,
|
||||
},
|
||||
};
|
||||
|
||||
drawer.logodefs = {
|
||||
-- Indexed by valid values for loader_logo in loader.conf(5). Valid keys
|
||||
-- are: requires_color (boolean), logo (table depicting graphic), and
|
||||
|
|
@ -315,9 +324,11 @@ function drawer.drawbrand()
|
|||
local y = tonumber(loader.getenv("loader_brand_y")) or
|
||||
drawer.brand_position.y;
|
||||
|
||||
local logo = load("return " .. tostring(loader.getenv("loader_brand")))() or
|
||||
fbsd_logo;
|
||||
drawer.draw(x, y, logo);
|
||||
local graphic = drawer.branddefs[loader.getenv("loader_brand")];
|
||||
if (graphic == nil) then
|
||||
graphic = fbsd_logo;
|
||||
end
|
||||
drawer.draw(x, y, graphic);
|
||||
end
|
||||
|
||||
function shift_brand_text(shift)
|
||||
|
|
|
|||
Loading…
Reference in a new issue