Not sure if this will help, I personally haven't coloured the text, but I am adjusting the font being used.
The OnClick part of my button that has the menu linked to it
Lua Code:
nUI_MenuButton:SetScript("OnClick", function(self,button,down)
if button == "LeftButton" then
Settings.OpenToCategory(addonNS.Settings.Categories["Main"].Category:GetID())
elseif button == "RightButton" then
MenuUtil.CreateContextMenu(UIParent, addonNS.Menu.Generate)
end
end)
The first part of the addonNS.Menu.Generate function that creates the menu elements. Some are directly added here but the sub menus are in their own file.
No need to return
Lua Code:
local title = rootDescription:CreateTitle(addonName .. " ( " .. nUI_Version .. " )")
addonNS.Menu.ApplyFontObject(title)
rootDescription:CreateDivider()
-- Sub Menu functions called here --
rootDescription:CreateDivider()
local control = rootDescription:CreateCheckbox("No Hud",
function()
return nUI_Options.hud_nohud
end,
function()
addonNS.onNoHud()
hudMenu:SetEnabled(not nUI_Options.hud_nohud)
end
)
addonNS.Menu.ApplyFontObject(control)
This is the first part of one of the sub menus, the button you click to access the menu and then the controls that the 'button' creates. No need to return from any functions used for each sub menu. They are linked via the root description value.
Lua Code:
local minimapMenu = rootDescription:CreateButton("Minimap")
minimapMenu:SetEnabled(nUI_Options.minimap)
addonNS.Menu.ApplyFontObject(minimapMenu)
local control = minimapMenu:CreateCheckbox("Round Map",
-- GetValue function
function()
return nUI_Options.round_map
end,
-- SetValue function
function()
addonNS.onMaskMap()
end
)
addonNS.Menu.ApplyFontObject(control)
And this is the font adjustment routine. You might need to do something similar to adjust the text.
Lua Code:
addonNS.Menu.FontObject = "Number12FontOutline"
addonNS.Menu.ApplyFontObject = function(control)
if not control then return end
control:AddInitializer(function(button, description, menu)
button.fontString:SetFontObject(addonNS.Menu.FontObject);
end)
end
Hope that helps in some form.