--[[---------------------------------------------------------------------------------
This is a plugin for Clique that handles integration with Sage Unit Frames
----------------------------------------------------------------------------------]]
-- Create the object and expose the name of the mod for options setting
local Plugin = {}
Plugin.name = "Sage Unit Frames"
-- Test if we should enable
function Plugin:Test()
return SUnit_OnClick
end
function Plugin:Enable()
self:Hook("SUnit_OnClick", "OnClick")
end
function Plugin:Disable()
self:UnhookAll()
end
-- OnClick is defined by Clique if its not defined in the plugin
function Plugin:OnClick()
local unit = SUnit_GetUnit(this)
if not Clique:OnClick(button, unit) then
return self.hooks.SUnit_OnClick.orig(button)
end
end
Clique:RegisterModule(Plugin)
Plugin = nil