mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 02:16:02 +00:00
unlock: reset frame position on middle click
This commit is contained in:
+16
-1
@@ -479,6 +479,14 @@ function pfUI.api.UpdateMovable(frame)
|
||||
table.insert(pfUI.movables, name)
|
||||
end
|
||||
|
||||
if not frame.posdata then
|
||||
frame.posdata = { scale = frame:GetScale(), pos = {} }
|
||||
|
||||
for i=1,frame:GetNumPoints() do
|
||||
frame.posdata.pos[i] = { frame:GetPoint(i) }
|
||||
end
|
||||
end
|
||||
|
||||
if pfUI_config["position"][frame:GetName()] then
|
||||
if pfUI_config["position"][frame:GetName()]["scale"] then
|
||||
frame:SetScale(pfUI_config["position"][frame:GetName()].scale)
|
||||
@@ -488,6 +496,13 @@ function pfUI.api.UpdateMovable(frame)
|
||||
frame:ClearAllPoints()
|
||||
frame:SetPoint("TOPLEFT", pfUI_config["position"][frame:GetName()].xpos, pfUI_config["position"][frame:GetName()].ypos)
|
||||
end
|
||||
elseif frame.posdata and frame.posdata.pos[1] then
|
||||
frame:ClearAllPoints()
|
||||
frame:SetScale(frame.posdata.scale)
|
||||
|
||||
for id, point in pairs(frame.posdata.pos) do
|
||||
frame:SetPoint(unpack(point))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -862,4 +877,4 @@ function pfUI.api.GetColorGradient(perc, ...)
|
||||
end
|
||||
return pfUI.api.GetColorGradient(perc,unpack(color_tuples))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user