WorldMapTooltip has been deprecated in favor of GameTooltip #180


Closed
  • KOVIKO created this issue Mar 12, 2019

    Attempting to roll over an icon on the World Map raises the following error:

     

    Message: Interface\AddOns\GatherMate2\Display.lua:114: attempt to index local 'tooltip' (a nil value)
    Time: Tue Mar 12 19:23:37 2019
    Count: 18
    Stack: Interface\AddOns\GatherMate2\Display.lua:114: attempt to index local 'tooltip' (a nil value)
    [C]: ?
    Interface\AddOns\GatherMate2\Display.lua:114: in function <Interface\AddOns\GatherMate2\Display.lua:99>
    (tail call): ?

     

    This is because WorldMapTooltip has been deprecated and merged into GameTooltip. So, the fix is to use GameTooltip going forward.

  • KOVIKO posted a comment Mar 12, 2019

    Same goes for the reference to WorldMapTooltip in the hidePin function.

  • PerrinGaiden posted a comment Mar 14, 2019

    Can confirm.  Removing the selection for world map vs GameTooltip removes the error and allows it continue without error.

     

    local function showPin(self)
    	if (self.title) then
    		local tooltip, pinset
    
    
    		tooltip = GameTooltip
    		pinset = minimapPins
    		local x, y = self:GetCenter()
    		local parentX, parentY = UIParent:GetCenter()
    		if ( x > parentX ) then
    			tooltip:SetOwner(self, "ANCHOR_LEFT")
    		else
    			tooltip:SetOwner(self, "ANCHOR_RIGHT")
    		end
    
    		local t = db.trackColors
    		local text = format(tooltip_template, t[self.nodeType].Alpha*255, t[self.nodeType].Red*255, t[self.nodeType].Green*255, t[self.nodeType].Blue*255, self.title)
    		for id, pin in pairs(pinset) do
    			if pin:IsMouseOver() and pin.title and pin ~= self then
    				text = text .. "\n" .. format(tooltip_template, t[pin.nodeType].Alpha*255, t[pin.nodeType].Red*255, t[pin.nodeType].Green*255, t[pin.nodeType].Blue*255, pin.title)
    			end
    		end
    		tooltip:SetText(text)
    		tooltip:Show()
    	end
    end
    
    local function hidePin(self)
    		GameTooltip:Hide()
    end
    
  • nevcairiel closed issue Jun 8, 2019

To post a comment, please login or register a new account.