aboutsummaryrefslogtreecommitdiff
path: root/stand/lua
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-06-11 01:32:18 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-06-11 01:32:18 +0000
commite21e1dbe0c68256d3a214e547541315a6194fa56 (patch)
tree350e4dbbf3f1f836dc18f0aaaba422d75979a7fb /stand/lua
parentf86d65170b22eddddaf4693d4dfeb3e99e3a2023 (diff)
Notes
Diffstat (limited to 'stand/lua')
-rw-r--r--stand/lua/drawer.lua27
1 files changed, 25 insertions, 2 deletions
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index d2283d20dbdc..5f0b020cef11 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -51,6 +51,22 @@ local function menuEntryName(drawing_menu, entry)
return entry.name
end
+local function getBranddef(brand)
+ if brand == nil then
+ return nil
+ end
+ -- Look it up
+ local branddef = drawer.branddefs[brand]
+
+ -- Try to pull it in
+ if branddef == nil then
+ try_include('brand-' .. brand)
+ branddef = drawer.branddefs[brand]
+ end
+
+ return branddef
+end
+
local function getLogodef(logo)
if logo == nil then
return nil
@@ -79,6 +95,8 @@ fbsd_brand = {
none = {""}
-- Module exports
+drawer.default_brand = 'fbsd'
+
drawer.menu_name_handlers = {
-- Menu name handlers should take the menu being drawn and entry being
-- drawn as parameters, and return the name of the item.
@@ -315,8 +333,13 @@ function drawer.drawbrand()
local y = tonumber(loader.getenv("loader_brand_y")) or
drawer.brand_position.y
- local graphic = drawer.branddefs[loader.getenv("loader_brand")] or
- fbsd_brand
+ local branddef = getBranddef(loader.getenv("loader_brand"))
+
+ if branddef == nil then
+ branddef = getBranddef(drawer.default_brand)
+ end
+
+ local graphic = branddef.graphic
x = x + drawer.shift.x
y = y + drawer.shift.y