Originally Posted by kurapica.igas
Lua Code:
for k, v in pairs(BattlefieldMapFrame.dataProviders) do if k.Label then local ft = { k.Label.Name:GetFont() } k.Label.Name:SetFont(ft[1], ft[2] * 0.5, ft[3]) local ft = { k.Label.Description:GetFont() } k.Label.Description:SetFont(ft[1], ft[2] * 0.5, ft[3]) end end
I may add a scale modifier in the EFBM addon in next version. Since they are created in the EBFM.
|
Almost, you'll want to make sure that the Label is indeed the AreaLabel one, as more providers have a .Label member.
Also, that is a very wasteful use of tables.
Slightly improved:
Lua Code:
for k, v in pairs(BattlefieldMapFrame.dataProviders) do
if k.Label and k.setAreaLabelCallback then
local font, size, flags = k.Label.Name:GetFont()
k.Label.Name:SetFont(font, size * 0.5, flags)
local font, size, flags = k.Label.Description:GetFont()
k.Label.Description:SetFont(font, size * 0.5, flags)
end
end
As a sidenote, there are discussions on how to improve hooking into the providers of a canvas-based map frame, and one of the suggested solutions is being able to query by mixin name. Feel free to chime in with alternate suggestions.