I haven't tested these but, looking at the Blizzard Dragonflight code ( 10.2.5 ) these lines should work for the main action bar and pet action bar for retail wow.
Lua Code:
for i=1, NUM_PET_ACTION_SLOTS, 1 do
local button = PetActionBar.actionButtons[i]);
hooksecurefunc(button, "SetHotKeys",function()
local hotkey = self.HotKey;
-- do your hotkey additions here
end)
end
Lua Code:
for i, actionButton in pairs(ActionBar.actionButtons) do
hooksecurefunc(actionButton,"UpdateHotKeys",function()
local hotkey = self.HotKey;
-- do your hotkey additions here
end
end
If you are working on Classic versions of wow (1.14.4 and 3.4.3) then it looks like the following could be done instead. Again, untested.
Lua Code:
for i=1, NUM_ACTIONBAR_SLOTS, 1 do
local button = _G["ActionButton" .. i]);
hooksecurefunc("ActionButton_UpdateHotkeys",function(self)
local hotkey = self.HotKey;
-- do your hotkey additions here
end)
end
Lua Code:
for i=1, NUM_PET_ACTION_SLOTS, 1 do
local button = _G["PetActionButton" .. i]);
hooksecurefunc("PetActionButton_SetHotKeys",function(self)
local hotkey = _G[self:GetName().."HotKey"];
-- do your hotkey additions here
end)
end
Give those a go and let us know if they work as expected for you.