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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
| local function SetActionBarFont() local actionBars = { "ActionButton", "MultiBarBottomLeftButton", "MultiBarBottomRightButton", "MultiBarRightButton", "MultiBarLeftButton", }
local hotkeyFontSize = 8 local macroFontSize = 8
for _, barName in ipairs(actionBars) do for i = 1, 12 do local hotkeyFrame = _G[barName .. i .. "HotKey"] if hotkeyFrame then hotkeyFrame:SetFont(STANDARD_TEXT_FONT, hotkeyFontSize, "OUTLINE") end
local macroFrame = _G[barName .. i .. "Name"] if macroFrame then macroFrame:SetFont(STANDARD_TEXT_FONT, macroFontSize, "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 function HideActionBarArt() if MainMenuBarLeftEndCap then MainMenuBarLeftEndCap:Hide() MainMenuBarLeftEndCap.Show = function() end end if MainMenuBarRightEndCap then MainMenuBarRightEndCap:Hide() MainMenuBarRightEndCap.Show = function() end end
MainMenuBar:SetScript("OnUpdate", nil) 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)
HideActionBarArt() end end)
|