View Single Post
07-19-12, 10:53 AM   #3
ballagarba
A Fallenroot Satyr
 
ballagarba's Avatar
Join Date: Mar 2009
Posts: 22
Originally Posted by Torhal View Post
You didn't try using hooksecurefunc() by chance, did you?
Yeah I did:

Originally Posted by ballagarba View Post
3. Now I tried to save the position of StanceButton1 before StanceBar_Update() moves it, and do a hooksecurefunc('StanceBar_Update', ...) and move it back. Also taints, apparently, you can't do StanceButton1:ClearAllPoints() from inside that hook (WTF?):

lua Code:
  1. local point, relativeTo, relativePoint, xOffset, yOffset = StanceButton1:GetPoint()
  2. hooksecurefunc('StanceBar_Update', function()
  3.     if (GetNumShapeshiftForms() == 1) then
  4.         StanceButton1:ClearAllPoints()
  5.         StanceButton1:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset)
  6.     end
  7. end
However, I don't see how that would work seeing as when the hook runs I have no idea of knowing what StanceButton1 had for position before the original function (StanceBar_Update()) moved it. I could just move it, but the point is that I want it to be user placed, so I can't move it programmatically like that unless I could somehow fetch that information from layout-local.txt.