View Single Post
07-29-14, 02:15 AM   #6
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
I'm using this little snippet in my UI that you may find useful:

Code:
local nfns, font, size = NumberFontNormalSmall
font, size = NumberFontNormalSmall:GetFont()
nfns:SetFont(font, size, 'OUTLINE')
nfns:SetShadowColor(0, 0, 0, 0)

local gsub = string.gsub

hooksecurefunc('ActionButton_UpdateHotkeys', function(self)
    local hotkey = _G[self:GetName()..'HotKey']
    local text = hotkey:GetText()

    text = gsub(text, '(s%-)', '|cFFFFDF00s|r')
    text = gsub(text, '(a%-)', '|cFFFFDF00a|r')
    text = gsub(text, '(c%-)', '|cFFFFDF00c|r')
    text = gsub(text, '(st%-)', '|cFFFFDF00c|r') -- german control 'Steuerung'

    for i = 1, 30 do
        text = gsub(text, _G['KEY_BUTTON'..i], '|cFFFFDF00m|r'..i)
    end

    for i = 1, 9 do
        text = gsub(text, _G['KEY_NUMPAD'..i], '|cFFFFDF00n|r'..i)
    end

    text = gsub(text, KEY_NUMPADDECIMAL, '|cFFFFDF00n|r.')
    text = gsub(text, KEY_NUMPADDIVIDE, '|cFFFFDF00n|r/')
    text = gsub(text, KEY_NUMPADMINUS, '|cFFFFDF00n|r-')
    text = gsub(text, KEY_NUMPADMULTIPLY, '|cFFFFDF00n|r*')
    text = gsub(text, KEY_NUMPADPLUS, '|cFFFFDF00n|r+')

    text = gsub(text, KEY_MOUSEWHEELUP, '|cFFFFDF00m|rU')
    text = gsub(text, KEY_MOUSEWHEELDOWN, '|cFFFFDF00m|rD')
    text = gsub(text, KEY_NUMLOCK, 'NL')
    text = gsub(text, KEY_PAGEUP, 'PU')
    text = gsub(text, KEY_PAGEDOWN, 'PD')
    text = gsub(text, KEY_SPACE, '_')
    text = gsub(text, KEY_INSERT, 'Ins')
    text = gsub(text, KEY_HOME, 'Hm')
    text = gsub(text, KEY_DELETE, 'Del')

    hotkey:SetText(text)
end)
  Reply With Quote