View Single Post
08-06-20, 04:38 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Unfortunately the Update function and the others, do most if not all of the functionality they need in there with no external function calls at the end of the function I can hook into instead.

for reference these are the errors I have been getting
Before Changes : Interface\\AddOns\\nUI\\Bars\\nUI_Button.lua:225: hooksecurefunc(): ActionButton_Update is not a function
After Changes : Interface\\AddOns\\nUI\\Bars\\nUI_ButtonBar.lua:697: attempt to call method 'initActionButton' (a nil value)



This might be my lack of lua knowledge but I tried the following. It gets rid of the initial errors but introduced a few more and apparently made no difference. I even tried the suggestion made for another similar scenario here : https://www.wowinterface.com/forums/...ad.php?t=56515 with no joy. The same result when I tried the way that worked elsewhere .. https://www.wowinterface.com/forums/...ad.php?t=56578.

I created a function HookButtonFunctions(button) that is called as soon as nUI starts to create a button for each bar.

And I adjusted all the hooksecurefunc entries from ActionButton_xxxx ones to self.xxxx and also tried self:xxx and wrapped the HookButtonFunctions function above around them all. But neither must work as it makes the initial createBar function now fail as it no longer exists.


So .. if Blizzard has now made each button a mixin so that now you have mixin:Update, mixin:OnUpdate etc funcitons that need to be overridden would I used self.Update or self:Update etc to hook them ?

Here is an example of two of the smaller functions
Lua Code:
  1. function HookButtonFunctions(self)
  2.     --hooksecurefunc( "ActionButton_OnUpdate",
  3.     hooksecurefunc(self:OnUpdate,
  4.         function( self, elapsed )
  5.             if self and nUI_ButtonMap[self] then
  6.                 if nUI_ButtonMap[self].onUpdate( self, elapsed ) then
  7.                     nUI_ButtonMap[self].updateUsable( self );
  8.                 end
  9.             end
  10.         end
  11.     );
  12.  
  13.     --hooksecurefunc( "ActionButton_UpdateUsable",
  14.     hooksecurefunc(self:UpdateUsable,
  15.         function( self )
  16.             if self and nUI_ButtonMap[self] then
  17.                 nUI_ButtonMap[self].updateUsable( self );
  18.             end
  19.         end
  20.     );
  21. end
__________________

Last edited by Xrystal : 08-06-20 at 04:58 AM.
  Reply With Quote