Thread: some font code.
View Single Post
10-15-17, 08:30 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 309
To add/change the font heights

Code:
for i = 1, 23 do
    CHAT_FONT_HEIGHTS[i] = i+5
end

I haven't tested this for the hotkey stuff...

Code:
local FONTPATH = "Interface\\AddOn\\YOURADDON\\Media\\FONT.ttf"
local FONTSIZE = 10
local FONTFLAGS = "None"


local function UpdateHK(btn)

   if not btn then return end

   local action = btn.action
   local name = btn:GetName()
   local hk  = _G[name.."HotKey"]

   hk:SetFont(FONTPATH, FONTSIZE, FONTFLAGS)

end

local function AlterHotKeys()

   for i = 1, NUM_ACTIONBAR_BUTTONS do
      UpdateHK(_G["ActionButton"..i])
      UpdateHK(_G["MultiBarBottomLeftButton"..i])
      UpdateHK(_G["MultiBarBottomRightButton"..i])
      UpdateHK(_G["MultiBarRightButton"..i])
      UpdateHK(_G["MultiBarLeftButton"..i])
   end

end

local HKF = CreateFrame("Frame")
HKF:RegisterEvent("PLAYER_ENTERING_WORLD")
HKF:SetScript("OnEvent", AlterHotKeys)

Last edited by Tim : 10-16-17 at 03:48 AM.
  Reply With Quote