insets = 4, |
strata = "BACKGROUND", |
level = 2, |
--hideTracking = false, |
} |
|
local function SetPosition(frame) |
local f, fname, fdata = _G[frame], frame, db[frame] |
local f = _G[frame] |
if mover and mover:IsShown() then |
local r,_,a,x,y = mover:GetPoint() |
fdata = {["r"]=r, ["p"]=UIParent,["a"]=a,["x"]=x,["y"]=y} |
db[frame] = {["r"]=r, --["p"]=UIParent, |
["a"]=a,["x"]=x,["y"]=y} |
end |
local fdata = db[frame] |
f:ClearAllPoints() |
f:SetPoint(fdata.r, fdata.p, fdata.a, fdata.x, fdata.y) |
if not oldSetPoint[fname] then --prehook |
oldSetPoint[fname] = f.SetPoint |
f:SetPoint(fdata.r, UIParent, fdata.a, fdata.x, fdata.y) |
if not oldSetPoint[frame] then --prehook |
oldSetPoint[frame] = f.SetPoint |
f.SetPoint = function(self, a,b,c,d,e, ...) |
local a,b,c,d,e = fdata.r, fdata.p, fdata.a, fdata.x, fdata.y |
return oldSetPoint[fname](self, a,b,c,d,e, ...) |
local a,b,c,d,e = db[frame].r, UIParent, db[frame].a, db[frame].x, db[frame].y |
return oldSetPoint[frame](self, a,b,c,d,e, ...) |
end |
end |
end |