--[[--------------------------------------------------------------------------------- This is a plugin for Clique that handles integration with ag_UnitFrames Unit Frames ----------------------------------------------------------------------------------]] -- Create the object and expose the name of the mod for options setting local Plugin = {} Plugin.name = 'ag_UnitFrames' function Plugin:Test() return aUF end function Plugin:Enable() self:Hook(aUF.aUFunit.prototype, "OnClick", "OnClick") end -- gives error: "Usage: TargetUnit("unit") function Plugin:Disable() self:UnhookAll() end function Plugin:OnClick(button) DEFAULT_CHAT_FRAME:AddMessage("HAT") end if Clique then Clique:RegisterModule(Plugin) end Plugin = nil -- self.unit is something like "party1", but never nil function aUF.aUFunit.prototype:OnClick(button) if ( button == "LeftButton" ) then TargetUnit(self.unit) end end