Hey @ all!
I try to alter the keybind text with this small function:
Lua Code:
local replace = string.gsub
D.Keybind = function(self, actionButtonType)
local HotKey = _G[self:GetName().."HotKey"]
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, KEY_BUTTON3, "M3")
Text = replace(Text, KEY_PAGEUP, "PU")
Text = replace(Text, KEY_PAGEDOWN, "PD")
Text = replace(Text, KEY_SPACE, "SpB")
Text = replace(Text, KEY_INSERT, "Ins")
Text = replace(Text, KEY_HOME, "Hm")
Text = replace(Text, KEY_DELETE, "Del")
Text = replace(Text, KEY_NUMPADDECIMAL, "Nu.")
Text = replace(Text, KEY_NUMPADDIVIDE, "Nu/")
Text = replace(Text, KEY_NUMPADMINUS, "Nu-")
Text = replace(Text, KEY_NUMPADMULTIPLY, "Nu*")
Text = replace(Text, KEY_NUMPADPLUS, "Nu+")
Text = replace(Text, KEY_NUMLOCK, "NuL")
Text = replace(Text, KEY_MOUSEWHEELDOWN, "MWD")
Text = replace(Text, KEY_MOUSEWHEELUP, "MWU")
if HotKey:GetText() == _G["RANGE_INDICATOR"] then
HotKey:SetText("")
else
HotKey:SetText(Text)
end
end
hooksecurefunc("ActionButton_UpdateHotkeys", D.Keybind)
I know I had the correct update-function from the blizzardcode but the hotkeys won't change. I had already Mouse Button 4, a-Mouse Button 4 and so on. Is there a possibly an error I overlooked? A friend of mine used the same code and there it works fine. Currently I am a little perplexed