View Single Post
09/22/20, 04:44 PM   #5
QuantumPie
AddOn Author - Click to view addons
Join Date: Sep 2019
Posts: 32
Originally Posted by Baertram View Post
Wouldn't this just be MAP_PIN_TYPE_PLAYER, MAP_PIN_TYPE_GROUP_LEADER or MAP_PIN_TYPE_GROUP again?

Or what unitTag do you need, and whatfor do you need it?
The unittag for your (the player) is always "player". And the unitTags of the group members will be always the suffix "group" with the suffix n (number 1 to n where n = GetGroupSize()).
The group leader's tag can be achieve via GetGroupLeaderUnitTag()
Ideally the unit tag for group[n] so I can get the display name of that unit. For the functions for texture and color I was getting the users display name from the pins unit tag and checking if a table had that username as a key with custom textures and colors. I'm trying to do something similar for size.

Lua Code:
  1. local function GetUnitTag(pin)
  2.     local unitTag = pin:GetUnitTag()
  3.     if unitTag then g_activeGroupPins[unitTag] = pin end
  4.     return unitTag
  5. end
  6.  
  7. function addon:ApplySettings()
  8.     local group = ZO_MapPin.PIN_DATA[MAP_PIN_TYPE_GROUP]
  9.  
  10.     group.texture = addon.IconFromNamee
  11.     group.tint = addon.TintFromName
  12.  
  13.     self:ColorUpdate(true)
  14. end
  15.  
  16.  
  17. function addon.IconFromName(pin)
  18.     if not pin then return "" end
  19.     local unitTag = GetUnitTag(pin)
  20.     if not unitTag then return "" end
  21.  
  22.     AddOverlayIcon(pin, unitTag)
  23.     local name = GetUnitDisplayName(unitTag)
  24.     local info = addon.account.name[name]
  25.     if info ~= nil then
  26.         return info.icon
  27.     end
  28.     return "/esoui/art/mappins/ui-worldmapgrouppip.dds"
  29. end
  Reply With Quote