View Single Post
11/06/15, 12:10 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
A little screenshot and associated code for map tooltips :



Lua Code:
  1. pinTooltipCreator.creator = function(pin)
  2.     local pinTag = pin.m_PinTag
  3.     local title, icon, known = GetLoreBookInfo(1, pinTag[3], pinTag[4])
  4.     local collection = GetLoreCollectionInfo(1, pinTag[3])
  5.     local moreinfo = {}
  6.  
  7.     if pinTag[6] then
  8.         table.insert(moreinfo, "[" .. GetString("LBOOKS_MOREINFO", pinTag[6]) .. "]")
  9.     end
  10.     if pinTag[5] then
  11.         table.insert(moreinfo, "[" .. zo_iconFormat(GetAllianceSymbolIcon(pinTag[5]), 24, 24) .. "]")
  12.     end
  13.     if known then
  14.         table.insert(moreinfo, "[" .. GetString(LBOOKS_KNOWN) .. "]")
  15.     end
  16.    
  17.      if IsInGamepadPreferredMode() and ZO_MapLocationTooltip_Gamepad then
  18.         INFORMATION_TOOLTIP:LayoutIconStringLine(INFORMATION_TOOLTIP.tooltip, nil, zo_strformat(collection), INFORMATION_TOOLTIP.tooltip:GetStyle("mapTitle"))
  19.         INFORMATION_TOOLTIP:LayoutIconStringLine(INFORMATION_TOOLTIP.tooltip, icon, title, INFORMATION_TOOLTIP.tooltip:GetStyle("mapLocationTooltipContent"))
  20.         if #moreinfo > 0 then
  21.             INFORMATION_TOOLTIP:LayoutIconStringLine(INFORMATION_TOOLTIP.tooltip, nil, table.concat(moreinfo, " / "), INFORMATION_TOOLTIP.tooltip:GetStyle("worldMapTooltip"))
  22.         end
  23.     else
  24.         INFORMATION_TOOLTIP:AddLine(text, arrayStyle)
  25.         INFORMATION_TOOLTIP:AddLine(zo_strformat(collection), "ZoFontGameOutline", ZO_SELECTED_TEXT:UnpackRGB())
  26.         ZO_Tooltip_AddDivider(INFORMATION_TOOLTIP)
  27.         INFORMATION_TOOLTIP:AddLine(zo_iconTextFormat(icon, 32, 32, title), "", ZO_HIGHLIGHT_TEXT:UnpackRGB())
  28.         if #moreinfo > 0 then
  29.             INFORMATION_TOOLTIP:AddLine(table.concat(moreinfo, " / "), "", ZO_TOOLTIP_DEFAULT_COLOR:UnpackRGB())
  30.         end
  31.     end
  32.    
  33. end
  Reply With Quote