标签归档:快捷键

如何隐藏动作条上的文本/快捷键

消息源:Hiding macro text & hotkeys

插件版本,同时隐藏 HotKey(快捷键)和 Name(宏名称):

local noop = function() end
hooksecurefunc("ActionButton_Update", function(btn)
    local hotkey = _G[btn:GetName().."HotKey"]
    hotkey:SetText("")
    hotkey.Show = noop
    hotkey:Hide()
end)

hooksecurefunc("ActionButton_Update", function(btn)
    local name = _G[btn:GetName().."Name"]
    name:Hide()
end)

下面有人提供了宏的版本,只隐藏快捷键,方法更简单,把 alpha 值改为 0 即可:

/run for i=1,12 do _G["ActionButton"..i.."HotKey"]:SetAlpha(0)end

不过上述都只隐藏主动作条,我来优化一下,隐藏所有动作条的快捷键:

/run local r={"MultiBarBottomLeft", "MultiBarBottomRight", "Action", "MultiBarLeft", "MultiBarRight"} for b=1,#r do for i=1,12 do _G[r[b].."Button"..i.."HotKey"]:SetAlpha(0) end end

隐藏所有动作条的宏名称:

/run local r={"MultiBarBottomLeft", "MultiBarBottomRight", "Action", "MultiBarLeft", "MultiBarRight"} for b=1,#r do for i=1,12 do _G[r[b].."Button"..i.."Name"]:SetAlpha(0) end end