I am working on an addon which will work with the framework which Shinni and several other talented coders have already refined. I am new to writing in lua but I'm drudging through it by trial and error. In a test piece of code I'm working on, I've started with the callback which Shinni used in HarvestMap to create the tooltip. I am wanting to add an Icon to the top left corner of that tooltip. I'm actually not having a problem with that... the problem is that once the icon is there... it's there on all custom map pins. My question is how can I either detect when the InformationTooltip has closed (is there an event I'm missing) or is there some way that I can have it only work for my set of pins? Below is the code snippint I'm using.
Code:
Test.tooltipCreator = {
creator = function( pin )
if Test.iconControl == nil then
Test.iconControl = WINDOW_MANAGER:CreateControl("Test_Tooltip_Icon", InformationTooltip, CT_TEXTURE)
end
InformationTooltip:AddControl(Test.iconControl, 1, true)
Test.iconControl:SetTexture("Test/Icons/Test.dds")
Test.iconControl:SetHidden(false)
Test.iconControl:SetDimensions(64, 64)
Test.iconControl:ClearAnchors()
Test.iconControl:SetAnchor(CENTER, InformationTooltip, TOPLEFT, 0, 0)
for _, name in ipairs(pin.m_PinTag[3]) do
InformationTooltip:AddLine( name )
end
end,
tooltip = InformationTooltip
}