View Single Post
11-12-14, 11:17 PM   #13
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
If anyone else is looking for a way to add tokens/currency to Inventorian Phanx put this together.

Lua Code:
  1. local Inventorian = LibStub("AceAddon-3.0"):GetAddon("Inventorian")
  2.  
  3. local function TokenUpdate()
  4.     if GetNumWatchedTokens() > 0 then
  5.         BackpackTokenFrame:SetParent(Inventorian.bag)
  6.         BackpackTokenFrame:ClearAllPoints()
  7.         BackpackTokenFrame:SetPoint("TOPRIGHT", Inventorian.bag, "BOTTOMRIGHT", 0, 4)
  8.         BackpackTokenFrame:Show()
  9.     end
  10. end
  11.  
  12. hooksecurefunc(Inventorian, "OnEnable", function(self)
  13.    hooksecurefunc(self.bag, "Show", TokenUpdate)
  14.    hooksecurefunc("ManageBackpackTokenFrame", TokenUpdate)
  15. end)
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison

Last edited by jeruku : 11-13-14 at 09:25 PM. Reason: Bad code is bad code.
  Reply With Quote