View Single Post
07-26-15, 11:25 PM   #11
Jasmer
A Flamescale Wyrmkin
 
Jasmer's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 122
Okay, tested Resike's code on a fresh start. I'm on a live realm, no PTR, in Shadowmoon Valley, tested on my hunter. Pet frame and ToT frame stayed put in several little fights. Didn't try LFD or anything, though. So far so good, though, and I think I like this method a little better.

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", PlayerFrame, "CENTER", -60, 100)
  11.     self:SetMovable(false)
  12.     moving = nil
  13. end)
  14. PetFrame:SetPoint("CENTER", PlayerFrame, "CENTER", -60, 100)
  15.  
  16. hooksecurefunc(TargetFrameToT, "SetPoint", function(self)
  17.     if moving then
  18.         return
  19.     end
  20.     moving = true
  21.     self:SetMovable(true)
  22.     self:SetUserPlaced(true)
  23.     self:ClearAllPoints()
  24.     self:SetPoint("CENTER", TargetFrame, "CENTER", 60, 100)
  25.     self:SetMovable(false)
  26.     moving = nil
  27. end)
  28. TargetFrameToT:SetPoint("CENTER", TargetFrame, "CENTER", 60, 100)

Here's what it looks like, and it's working fine.



Thanks again guys!
  Reply With Quote