Skin menu dividers: CreateMenuDivider draws a 1px border-colored line; use it in the radar menu

This commit is contained in:
Brues
2026-10-31 21:04:11 -05:00
parent e38d028677
commit 5476a28982
2 changed files with 20 additions and 1 deletions
+19
View File
@@ -86,6 +86,25 @@ do
end
end
-- [ CreateMenuDivider ]
-- Adds a divider to a pfUIMenuStyleMixin menu: a 1px line in the border
-- color in place of the stock divider art. The style itself cannot do this,
-- as menu entries draw their own art.
-- 'description' [table] the menu description to add the divider to
-- returns: [table] the divider's element description
do
local function SkinDivider(frame)
frame.divider:SetHeight(1)
frame.divider:SetColorTexture(GetStringColor(pfUI_config.appearance.border.color))
end
function pfUI.api.CreateMenuDivider(description)
local divider = description:CreateDivider()
divider:AddInitializer(SkinDivider)
return divider
end
end
-- [ pfUIDropdownTemplate ]
-- Mixin of the template in ui-widgets.xml: a dropdown that shows its selection
-- as text, with pfUI's arrow box at the right.
+1 -1
View File
@@ -85,7 +85,7 @@ pfUI:RegisterModule("radar", function ()
for _, yards in ipairs(RANGES) do
rootDescription:CreateRadio(yards .. " yd", IsRange, SetRange, yards)
end
rootDescription:CreateDivider()
CreateMenuDivider(rootDescription)
rootDescription:CreateButton(HIDE, function() radar:Hide() end)
end