function ClickFunc(self, event)
    if event.Type == 'MouseEnter' then
        if self.tooltipKey and not self.tooltip then
            self.tooltip = ToolTip.CreateExtendedToolTip(self, TooltipInfo[self.tooltipKey].title, TooltipInfo[self.tooltipKey].description)
            LayoutHelpers.LeftOf(self.tooltip, self)
            
            local createDelay = Prefs.GetOption('tooltip_delay') or 0
            
            -- AZ ADDITION
            -- Eradicate fade-in and add in the delay from prefs.
            if not createDelay then
	            self.tooltip:SetAlpha(1, true)
	        else
				local totalTime = 0
				self.tooltip:SetAlpha(0, true)
				self.tooltip:SetNeedsFrameUpdate(true)
				self.tooltip.OnFrame = function(self, deltaTime)
					if(totalTime > createDelay) then
						self:SetAlpha(1, true)
						self:SetNeedsFrameUpdate(false)
					end
					totalTime = totalTime + deltaTime
				end
			end
        end
    elseif event.Type == 'MouseExit' then
        if self.tooltip then
            self.tooltip:Destroy()
            self.tooltip = nil
        end
        self.curIndex = 1
    elseif event.Type == 'ButtonPress' then
        if self.units then
            if not self.units[self.curIndex] then
                self.curIndex = 1
            end
            if event.Modifiers.Left then
                local selectUnits = {self.units[self.curIndex]}
                if event.Modifiers.Shift then
                    selectUnits = GetSelectedUnits() or {}
                    table.insert(selectUnits, self.units[self.curIndex])
                end
                SelectUnits(selectUnits)
            elseif event.Modifiers.Right then
                if event.Modifiers.Shift then
                    local selection = GetSelectedUnits() or {}
                    table.insert(selection, self.units[self.curIndex])
                    UISelectAndZoomTo(self.units[self.curIndex])
                    SelectUnits(selection)
                else
                    UISelectAndZoomTo(self.units[self.curIndex])
                end
            end
            self.curIndex = self.curIndex + 1
        end
        return true
    elseif event.Type == 'ButtonDClick' then
        if self.units then
            if not self.units[self.curIndex] then
                self.curIndex = 1
            end
            if event.Modifiers.Left then
                local selectUnits = self.units
                if event.Modifiers.Shift then
                    selectUnits = GetSelectedUnits() or {}
                    for _, unit in self.units do
                        table.insert(selectUnits, unit)
                    end
                end
                SelectUnits(selectUnits)
            elseif event.Modifiers.Right then
                if event.Modifiers.Shift then
                    local selection = GetSelectedUnits() or {}
                    for _, unit in self.units do
                        table.insert(selection, unit)
                    end
                    UISelectAndZoomTo(self.units[self.curIndex])
                    SelectUnits(selection)
                else
                    UISelectAndZoomTo(self.units[self.curIndex])
                    SelectUnits(self.units)
                end
            end
            self.curIndex = self.curIndex + 1
        end
        return true
    end
end