View Single Post
07-31-18, 11:47 AM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by kurapica.igas View Post
Lua Code:
  1. for k, v in pairs(BattlefieldMapFrame.dataProviders) do
  2.     if k.Label then
  3.         local ft = { k.Label.Name:GetFont() }
  4.         k.Label.Name:SetFont(ft[1], ft[2] * 0.5, ft[3])
  5.        
  6.         local ft = { k.Label.Description:GetFont() }
  7.         k.Label.Description:SetFont(ft[1], ft[2] * 0.5, ft[3])
  8.     end
  9. 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:
  1. for k, v in pairs(BattlefieldMapFrame.dataProviders) do
  2.     if k.Label and k.setAreaLabelCallback then
  3.         local font, size, flags = k.Label.Name:GetFont()
  4.         k.Label.Name:SetFont(font, size * 0.5, flags)
  5.  
  6.         local font, size, flags = k.Label.Description:GetFont()
  7.         k.Label.Description:SetFont(font, size * 0.5, flags)
  8.     end
  9. 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.

Last edited by p3lim : 07-31-18 at 11:49 AM.
  Reply With Quote