local p,K="\073\110\116\101\114\097\099\116\105\118\101\076\097\098\101\108",21 local a=LibStub and LibStub("\065\099\101\071\085\073-\051\046\048",true)if not a or(a:GetWidgetVersion(p)or 0)>=K then return end local w,R=select,pairs local function H(p)p.obj:Fire("\079\110\069\110\116\101\114")end local function C(p)p.obj:Fire("\079\110\076\101\097\118\101")end local function c(p,K)p.obj:Fire("\079\110\067\108\105\099\107",K)a:ClearFocus()end local f={OnAcquire=function(p)p:LabelOnAcquire()p:SetHighlight()p:SetHighlightTexCoord()p:SetDisabled(false)end,SetHighlight=function(p,...)p.highlight:SetTexture(...)end,SetHighlightTexCoord=function(p,...)local K=w("\035",...)if K==4 or K==8 then p.highlight:SetTexCoord(...)else p.highlight:SetTexCoord(0,1,0,1)end end,SetDisabled=function(p,K)p.disabled=K if K then p.frame:EnableMouse(false)p.label:SetTextColor(.5,.5,.5)else p.frame:EnableMouse(true)p.label:SetTextColor(1,1,1)end end}local function U()local K=a:Create("\076\097\098\101\108")local w=K.frame w:EnableMouse(true)w:SetScript("\079\110\069\110\116\101\114",H)w:SetScript("\079\110\076\101\097\118\101",C)w:SetScript("\079\110\077\111\117\115\101\068\111\119\110",c)local U=w:CreateTexture(nil,"\072\073\071\072\076\073\071\072\084")U:SetTexture(nil)U:SetAllPoints()U:SetBlendMode("\065\068\068")K.highlight=U K.type=p K.LabelOnAcquire=K.OnAcquire for p,a in R(f)do K[p]=a end return K end a:RegisterWidgetType(p,U,K)
--[[-----------------------------------------------------------------------------
InteractiveLabel Widget
-------------------------------------------------------------------------------]]
local Type, Version = "InteractiveLabel", 21
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

-- Lua APIs
local select, pairs = select, pairs

--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
local function Control_OnEnter(frame)
	frame.obj:Fire("OnEnter")
end

local function Control_OnLeave(frame)
	frame.obj:Fire("OnLeave")
end

local function Label_OnClick(frame, button)
	frame.obj:Fire("OnClick", button)
	AceGUI:ClearFocus()
end

--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
local methods = {
	["OnAcquire"] = function(self)
		self:LabelOnAcquire()
		self:SetHighlight()
		self:SetHighlightTexCoord()
		self:SetDisabled(false)
	end,

	-- ["OnRelease"] = nil,

	["SetHighlight"] = function(self, ...)
		self.highlight:SetTexture(...)
	end,

	["SetHighlightTexCoord"] = function(self, ...)
		local c = select("#", ...)
		if c == 4 or c == 8 then
			self.highlight:SetTexCoord(...)
		else
			self.highlight:SetTexCoord(0, 1, 0, 1)
		end
	end,

	["SetDisabled"] = function(self,disabled)
		self.disabled = disabled
		if disabled then
			self.frame:EnableMouse(false)
			self.label:SetTextColor(0.5, 0.5, 0.5)
		else
			self.frame:EnableMouse(true)
			self.label:SetTextColor(1, 1, 1)
		end
	end
}

--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
	-- create a Label type that we will hijack
	local label = AceGUI:Create("Label")

	local frame = label.frame
	frame:EnableMouse(true)
	frame:SetScript("OnEnter", Control_OnEnter)
	frame:SetScript("OnLeave", Control_OnLeave)
	frame:SetScript("OnMouseDown", Label_OnClick)

	local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
	highlight:SetTexture(nil)
	highlight:SetAllPoints()
	highlight:SetBlendMode("ADD")

	label.highlight = highlight
	label.type = Type
	label.LabelOnAcquire = label.OnAcquire
	for method, func in pairs(methods) do
		label[method] = func
	end

	return label
end

AceGUI:RegisterWidgetType(Type, Constructor, Version)

