View Single Post
07-25-15, 07:22 PM   #7
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Jasmer View Post
I fixed it! Turns out TargetFrameToT wasn't the source of the taint once I removed
Lua Code:
  1. TargetFrameToT.SetPoint = function() end

However, I kept getting taint issues pointing to that frame. I removed similar lines from all my other frames and used SetMovable and SetUserPlaced. Everything seems to work, with one catch. My pet frame resets to default position unless I add

Lua Code:
  1. PetFrame.SetPoint = function() end

No taint log so far, ToT frame stays where I placed it in combat, so far so good. Does anyone know a better way to keep my pet frame stationary? I tried SetMovable and SetUserPlaced, they didn't work, PetFrame kept resetting. It's working fine with SetPoint = function() end, so far at least, but if this is something that causes taint I'd like a better way to lock my pet frame in place.
Hook it, as Seerah mentioned:

Lua Code:
  1. local moving
  2. hooksecurefunc(PetFrame, "SetPoint", function(self)
  3.     if moving then
  4.         return
  5.     end
  6.     moving = true
  7.     self:SetMovable(true)
  8.     self:SetUserPlaced(true)
  9.     self:ClearAllPoints()
  10.     self:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
  11.     self:SetMovable(false)
  12.     moving = nil
  13. end)
  14. PetFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)

The big advantage of the SetUserPlaced call if the frame is supported, then you can clear/move protected frames even in combat.

There is also a similar hack with secure frames, where you can resize them in combat while StartSizing is active.

Last edited by Resike : 07-25-15 at 07:26 PM.
  Reply With Quote