From a7000449e948aee683b44c282ca440552ac87350 Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 3 Apr 2020 00:26:12 +0200 Subject: [PATCH] api: allow movables to not have a parent frame --- api/api.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/api.lua b/api/api.lua index ca8a3a34..6f2a59f5 100644 --- a/api/api.lua +++ b/api/api.lua @@ -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 ]