api: allow movables to not have a parent frame

This commit is contained in:
shagu
2020-04-03 00:26:12 +02:00
parent 2a36162d95
commit a7000449e9
+1 -3
View File
@@ -565,8 +565,6 @@ function pfUI.api.LoadMovable(frame, init)
if pfUI_config["position"][frame:GetName()] then
if pfUI_config["position"][frame:GetName()]["parent"] then
frame:SetParent(_G[pfUI_config["position"][frame:GetName()]["parent"]])
else
frame:SetParent(UIParent)
end
if pfUI_config["position"][frame:GetName()]["scale"] then
@@ -597,7 +595,7 @@ function pfUI.api.SaveMovable(frame)
C.position[frame:GetName()]["xpos"] = round(xpos)
C.position[frame:GetName()]["ypos"] = round(ypos)
C.position[frame:GetName()]["anchor"] = anchor
C.position[frame:GetName()]["parent"] = frame:GetParent():GetName()
C.position[frame:GetName()]["parent"] = frame:GetParent() and frame:GetParent():GetName() or nil
end
-- [ Update Movable ]