Originally Posted by Jasmer
I fixed it! Turns out TargetFrameToT wasn't the source of the taint once I removed
Lua Code:
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:
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:
local moving
hooksecurefunc(PetFrame, "SetPoint", function(self)
if moving then
return
end
moving = true
self:SetMovable(true)
self:SetUserPlaced(true)
self:ClearAllPoints()
self:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
self:SetMovable(false)
moving = nil
end)
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.