Thread Tools Display Modes
08-29-24, 02:15 PM   #1
Shixin
A Murloc Raider
Join Date: Jul 2011
Posts: 5
addon error BackpackTokenFrame_Update

Trying to fix an addon that calls for secure func "BackpackTokenFrame_Update", and I cannot find anything about where Blizz removed/replaced it. Anyone know anything?

Error:
Message: Interface/AddOns/Broker_Wallet/Broker_Wallet.lua line 87:
hooksecurefunc(): BackpackTokenFrame_Update is not a function
Debug:
[string "=[C]"]: hooksecurefunc()
[string "@Interface/AddOns/Broker_Wallet/Broker_Wallet.lua"]:87: in main chunk
Locals:
Chat AI gave me this snippet, but I don't want to kill functionality (addon=broker for currency)
Lua Code:
  1. local function SafeHookFunction(funcName, hookFunc)
  2.     if _G[funcName] then
  3.         hooksecurefunc(funcName, hookFunc)
  4.     else
  5.         print("Error: Function '" .. funcName .. "' does not exist.")
  6.     end
  7. end
  8.  
  9. SafeHookFunction("BackpackTokenFrame_Update", function()
  10.     -- Your hook code here
  11. end)
  Reply With Quote
08-29-24, 02:45 PM   #2
Shixin
A Murloc Raider
Join Date: Jul 2011
Posts: 5
Ok, Elv on the game forums pointed out that it was replaced with a mixin.

https://github.com/Gethe/wow-ui-sour...kenUI.lua#L301

So, is it just a matter of replacing

hooksecurefunc( "BackpackTokenFrame_Update", Wallet.BackpackUpdate)

with

hooksecurefunc( "TokenFrameMixin:Update", Wallet.BackpackUpdate)
  Reply With Quote
08-29-24, 02:54 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 6,007
You could try

hooksecurefunc(TokenFrame,"Update",function()

end)

Where you first mention the frame that is using the mixin, then the function the mixin has.

Or .. hooksecurefunc(TokenFrame,"Update",Wallet.BackpackUpdate)
Where Wallet.BackpackUpdate is your function to execute after the Blizzard function is complete
__________________


All Level 70 Characters:
Demon Warlock
Resto Druid
Disc Priest
Resto Shaman
Survival Hunter
Augment Evoker
Frost Mage
Vengence Demon Hunter
Rogue ( was subtlety )

Brewmaster Monk (TR)
Prot Paladin (TR)
Blood Death Knight ( TR)

As you can see I am missing a warrior

And .. I don't have all the allied races covered. Time Runner time when it happens again

  Reply With Quote
08-29-24, 03:23 PM   #4
Shixin
A Murloc Raider
Join Date: Jul 2011
Posts: 5
Originally Posted by Xrystal View Post
hooksecurefunc(TokenFrame,"Update",Wallet.BackpackUpdate)
That seems to have done the trick, thanks!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » addon error BackpackTokenFrame_Update


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off