All pastes #84265 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-07-10 19:35 UTC
rendered paste body

--[[---------------------------------------------------------------------------------
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