mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-01 08:26:57 +00:00
Skin menu dividers: CreateMenuDivider draws a 1px border-colored line; use it in the radar menu
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user