From 37ed706a266580e29f31917c3e5e7c615fd8e9cb Mon Sep 17 00:00:00 2001 From: Flamanis Date: Tue, 11 Apr 2023 17:36:12 -0500 Subject: [PATCH] Only SetScript and HookScript on intialization of plugin frames --- core/plugins.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/plugins.lua b/core/plugins.lua index 522d2479..c534cb88 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -647,14 +647,17 @@ local on_hide = function(self) DetailsPluginContainerWindow.ClosePlugin() end - - function f.RefreshFrame (frame) - frame:EnableMouse(false) - frame:SetSize(f.FrameWidth, f.FrameHeight) + + local setup_frame_functions = function(frame) frame:SetScript("OnMouseDown", nil) frame:SetScript("OnMouseUp", nil) --frame:SetScript("OnHide", on_hide) frame:HookScript ("OnHide", on_hide) + end + + function f.RefreshFrame (frame) + frame:EnableMouse(false) + frame:SetSize(f.FrameWidth, f.FrameHeight) frame:ClearAllPoints() PixelUtil.SetPoint(frame, "topleft", f, "topleft", 0, 0) frame:Show() @@ -715,6 +718,7 @@ --format the plugin main frame f.RefreshFrame(frame) + setup_frame_functions(frame) --save the callback function for when clicking in the button from the options panel pluginObject.__OnClickFromOptionsCallback = callback