mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
api: add flag to save scale on position save
This commit is contained in:
+4
-1
@@ -592,13 +592,16 @@ end
|
|||||||
-- [ Save Movable ]
|
-- [ Save Movable ]
|
||||||
-- Save the positions of a Frame.
|
-- Save the positions of a Frame.
|
||||||
-- 'frame' [frame] the frame that should be saved.
|
-- 'frame' [frame] the frame that should be saved.
|
||||||
function pfUI.api.SaveMovable(frame)
|
function pfUI.api.SaveMovable(frame, scale)
|
||||||
local anchor, _, _, xpos, ypos = frame:GetPoint()
|
local anchor, _, _, xpos, ypos = frame:GetPoint()
|
||||||
C.position[frame:GetName()] = C.position[frame:GetName()] or {}
|
C.position[frame:GetName()] = C.position[frame:GetName()] or {}
|
||||||
C.position[frame:GetName()]["xpos"] = round(xpos)
|
C.position[frame:GetName()]["xpos"] = round(xpos)
|
||||||
C.position[frame:GetName()]["ypos"] = round(ypos)
|
C.position[frame:GetName()]["ypos"] = round(ypos)
|
||||||
C.position[frame:GetName()]["anchor"] = anchor
|
C.position[frame:GetName()]["anchor"] = anchor
|
||||||
C.position[frame:GetName()]["parent"] = frame:GetParent() and frame:GetParent():GetName() or nil
|
C.position[frame:GetName()]["parent"] = frame:GetParent() and frame:GetParent():GetName() or nil
|
||||||
|
if scale then
|
||||||
|
C.position[frame:GetName()]["scale"] = frame:GetScale()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- [ Update Movable ]
|
-- [ Update Movable ]
|
||||||
|
|||||||
Reference in New Issue
Block a user