View Single Post
02-21-24, 12:09 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,938
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:
  1. for i=1, NUM_PET_ACTION_SLOTS, 1 do
  2.         local button = PetActionBar.actionButtons[i]);
  3.                 hooksecurefunc(button, "SetHotKeys",function()
  4.                     local hotkey = self.HotKey;
  5.                      -- do your hotkey additions here
  6.                 end)
  7.     end

Lua Code:
  1. for i, actionButton in pairs(ActionBar.actionButtons) do
  2.        hooksecurefunc(actionButton,"UpdateHotKeys",function()
  3.           local hotkey = self.HotKey;
  4.           -- do your hotkey additions here
  5.        end
  6.     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:
  1. for i=1, NUM_ACTIONBAR_SLOTS, 1 do
  2.         local button = _G["ActionButton" .. i]);
  3.                 hooksecurefunc("ActionButton_UpdateHotkeys",function(self)
  4.                     local hotkey = self.HotKey;
  5.                      -- do your hotkey additions here
  6.                 end)
  7.     end

Lua Code:
  1. for i=1, NUM_PET_ACTION_SLOTS, 1 do
  2.         local button = _G["PetActionButton" .. i]);
  3.                 hooksecurefunc("PetActionButton_SetHotKeys",function(self)
  4.                     local hotkey = _G[self:GetName().."HotKey"];
  5.                      -- do your hotkey additions here
  6.                 end)
  7.     end

Give those a go and let us know if they work as expected for you.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote