diff --git a/api/api.lua b/api/api.lua index 8bd1c98b..72636398 100644 --- a/api/api.lua +++ b/api/api.lua @@ -576,10 +576,7 @@ end -- 'frame' [frame] the frame that should be saved. function pfUI.api.SaveMovable(frame) local anchor, _, _, xpos, ypos = frame:GetPoint() - if not C.position[frame:GetName()] then - C.position[frame:GetName()] = {} - end - + C.position[frame:GetName()] = C.position[frame:GetName()] or {} C.position[frame:GetName()]["xpos"] = round(xpos) C.position[frame:GetName()]["ypos"] = round(ypos) C.position[frame:GetName()]["anchor"] = anchor diff --git a/modules/unlock.lua b/modules/unlock.lua index 41b1986f..4ab1af26 100644 --- a/modules/unlock.lua +++ b/modules/unlock.lua @@ -114,6 +114,15 @@ pfUI:RegisterModule("unlock", 20400, function () return frames end + local function DraggerOnUpdate() + this.text:SetAlpha(this.text:GetAlpha() -0.05) + if this.text:GetAlpha() < 0.1 then + this.text:SetText(strsub(this:GetParent():GetName(),3)) + this.text:SetAlpha(1) + this:SetScript("OnUpdate", function() return end) + end + end + local function SaveScale(frame, scale) frame:SetScale(scale) @@ -125,14 +134,7 @@ pfUI:RegisterModule("unlock", 20400, function () frame.drag.text:SetText(T["Scale"] .. ": " .. scale) frame.drag.text:SetAlpha(1) - frame.drag:SetScript("OnUpdate", function() - this.text:SetAlpha(this.text:GetAlpha() -0.05) - if this.text:GetAlpha() < 0.1 then - this.text:SetText(strsub(this:GetParent():GetName(),3)) - this.text:SetAlpha(1) - this:SetScript("OnUpdate", function() return end) - end - end) + frame.drag:SetScript("OnUpdate", DraggerOnUpdate) end local function SavePosition(frame)