View Single Post
09-01-12, 02:48 AM   #1
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
DurabilityFrame SetPoint Hook to reparent

So, previous in 4.3 I was using a simple hooksecurefunc to "SetPoint" for the DurabilityFrame to allow me to set a custom point for the frame.

For some reason unknown to me this method no longer works and there has been 0 changes to the durability frame.

My Code:
Lua Code:
  1. local function UpdatePoint()
  2.     DurabilityFrame:ClearAllPoints()
  3.     DurabilityFrame:SetPoint("TOPRIGHT",Minimap,"BOTTOMLEFT",-20,-20)
  4. end
  5.  
  6. hooksecurefunc(DurabilityFrame,"SetPoint",function(self,_,parent)
  7.     if (parent == "MinimapCluster") or (parent == _G["MinimapCluster"]) then
  8.         UpdatePoint()
  9.     end
  10. end)
  11.  
  12. tinsert(TUSUI.Updaters, UpdatePoint)

Can anyone point me as to what is preventing me from updating the point correctly?

Edit: Just to make this clear, the function UpdatePoint() is getting called and my global table insert is just to make sure it gets called again after my addon is loaded.

Last edited by suicidalkatt : 09-02-12 at 04:54 AM.
  Reply With Quote