From 42ecc26547b57a24effb9648599905942206500f Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Mon, 15 Dec 2008 23:28:15 +0000 Subject: [PATCH] * Added cases for the On handlers in UpdatePlugin, so we can set them whenever they are changed --- NinjaPanel.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/NinjaPanel.lua b/NinjaPanel.lua index b9d7a85..2401d90 100644 --- a/NinjaPanel.lua +++ b/NinjaPanel.lua @@ -170,6 +170,21 @@ function NinjaPanel:UpdatePlugin(event, name, key, value, dataobj) self:UpdateButtonWidth(button) elseif key == "icon" then button.icon:SetTexture(value) + -- TODO: Clean this up + elseif key == "OnTooltipShow" and type(value) == "function" then + button:SetScript("OnEnter", Button_OnEnter) + button:SetScript("OnLeave", Button_OnLeave) + elseif key == "OnEnter" and type(value) == "function" then + -- Set the OnEnter script + button:SetScript("OnEnter", value) + elseif key == "OnEnter" then + button:SetScript("OnEnter", Button_OnEnter) + elseif key == "OnLeave" and type(value) == "function" then + button:SetScript("OnLeave", value) + elseif key == "OnLeave" then + button:SetScript("OnEnter", Button_OnLeave) + elseif key == "OnClick" then + button:SetScript("OnClick", value) end -- Update the icon coordinates if either the icon or the icon coords were -- 1.7.9.5