local names = {
["Mouse Button 4"] = "m4",
["Mouse Button 5"] = "m5",
["Middle Mouse"] = "mM",
["Mouse Wheel Down"] = "DWN",
["Mouse Wheel Up"] = "UP",
["`"] = "-",
}
local function Updatehotkey(self, actionButtonType)
local hotkey = self.HotKey
local text = hotkey:GetText()
hotkey:SetText(names[text] or text)
end
for i = 1, NUM_ACTIONBAR_BUTTONS do
hooksecurefunc(_G["ActionButton"..i], "UpdateHotkeys", Updatehotkey)
end
local names = {
["Mouse Button 4"] = "m4",
["Mouse Button 5"] = "m5",
["Middle Mouse"] = "mM",
["Mouse Wheel Down"] = "DWN",
["Mouse Wheel Up"] = "UP",
["`"] = "-",
}
local bars = {
"ActionButton",
"MultiBarBottomLeftButton",
"MultiBarBottomRightButton",
"MultiBarLeftButton",
"MultiBarRightButton",
}
local function Updatehotkey(self, actionButtonType)
local hotkey = self.HotKey
local text = hotkey:GetText()
hotkey:SetText(names[text] or text)
end
for _, bar in pairs(bars) do
for i = 1, NUM_ACTIONBAR_BUTTONS do
hooksecurefunc(_G[bar..i], "UpdateHotkeys", Updatehotkey)
end
end
Hey,
Im trying to get my addon/script working again that changes my keybind names but i cant get it to work . Maybe some1 here can figure it out.
local function updatehotkey(self, actionButtonType)
local hotkey = _G[self:GetName() .. 'HotKey']
local text = hotkey:GetText()
text = string.gsub(text, '(Mouse Button 4)', 'm4')
text = string.gsub(text, '(Mouse Button 5)', 'm5')
text = string.gsub(text, '(Middle Mouse)', 'mM')
text = string.gsub(text, '(Mouse Wheel Down)', 'DWN')
text = string.gsub(text, '(Mouse Wheel Up)', ' UP')
text = string.gsub(text, '(`)', '-')
hotkey:SetText(text)
end
hooksecurefunc("ActionButton_UpdateHotkeys", updatehotkey)
ActionBarButtonEventsFrame:GetScript("OnEvent")(ActionBarButtonEventsFrame, "UPDATE_BINDINGS")
Thanks in advance
Thnx for the reply but that doesnt work either :(
You need to elaborate more than that
I used your text instead of mine in the addon.
Or what do i need to do with it ?
It works for me, check if you have any errors with BugSack
otherwise idk
OKe great i got it to work now, is there any chance u know why it does a-... instead of a-m4 ?
also a-` instead of a--
That part seems to work fine for me
DO you use the blizzard action bar?
well yes