1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| local function SetActionBarFont() for i = 1, 12 do local actionButtonHotKey = _G["ActionButton" .. i .. "HotKey"] if actionButtonHotKey then actionButtonHotKey:SetFont(STANDARD_TEXT_FONT, 8, "OUTLINE") end
local actionButtonMacro = _G["ActionButton" .. i .. "Name"] if actionButtonMacro then actionButtonMacro:SetFont(STANDARD_TEXT_FONT, 8, "OUTLINE") end end
for i = 1, 12 do local hotkeyFrames = { "MultiBarBottomLeftButton" .. i .. "HotKey", "MultiBarBottomRightButton" .. i .. "HotKey", "MultiBarRightButton" .. i .. "HotKey", "MultiBarLeftButton" .. i .. "HotKey" }
for _, frameName in ipairs(hotkeyFrames) do local hotkeyFrame = _G[frameName] if hotkeyFrame then hotkeyFrame:SetFont(STANDARD_TEXT_FONT, 8, "OUTLINE") end end end end
local function SimplifyHotkeyText(hotkey) if hotkey and hotkey:GetText() then local replace = string.gsub local text = hotkey:GetText()
text = replace(text, "(s%-)", "S") text = replace(text, "(a%-)", "A") text = replace(text, "(c%-)", "C") text = replace(text, "(Mouse Button )", "M") text = replace(text, "(鼠标中键)", "M3") text = replace(text, "(鼠标按键4)", "M4") text = replace(text, "(鼠标按键5)", "M5") text = replace(text, "(鼠标滚轮向上滚动)", "MU") text = replace(text, "(鼠标滚轮向下滚动)", "MD") text = replace(text, "(数字键盘)", "N") text = replace(text, "Capslock", "CK") text = replace(text, "(Page Up)", "PU") text = replace(text, "(Page Down)", "PD") text = replace(text, "(空格键)", "SpB") text = replace(text, "(Insert)", "Ins") text = replace(text, "(Home)", "Hm") text = replace(text, "(Delete)", "Del")
hotkey:SetText(text) end end
local function UpdateHotkeys(self) local hotkey = _G[self:GetName() .. "HotKey"] SimplifyHotkeyText(hotkey) end
local Event = CreateFrame("Frame", nil, UIParent) Event:RegisterEvent("PLAYER_LOGIN") Event:SetScript("OnEvent", function(self, event, ...) if event == "PLAYER_LOGIN" then SetActionBarFont()
hooksecurefunc("ActionButton_UpdateHotkeys", UpdateHotkeys) end end)
|