View Single Post
10/26/18, 09:20 PM   #5
Hydra9268
 
Hydra9268's Avatar
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 33
For the past few days, I've reviewed this change and remain at a loss.

The Zygor devs coded their Addon to automatically call GetPOIMapInfo whenever the map opens or changes, so the data appears to initialize at call-time. I believe this negates the need to create the map pins like how other Addons do it. (example from ChronicCollector.lua)



Here's their code from Zygor's pointer.lua file with my edits based on Dan's reply:

Lua Code:
  1. _GetPOIMapInfo_ORIG_ZGV = GetPOIMapInfo
  2. function GetPOIMapInfo( map, id, truthful )
  3.  
  4.     if truthful then
  5.         return _GetPOIMapInfo_ORIG_ZGV( map, id )
  6.     end
  7.    
  8.     local normalizedX, normalizedY, poiPinType, icon, isShownInCurrentMap, linkedCollectibleIsLocked, isDiscovered, isNearby = _GetPOIMapInfo_ORIG_ZGV( map, id )
  9.  
  10.     if icon:find("icon_missing") then
  11.         icon = ZGV.DIR.."/Arrows/Stealth/cbni0-o1egp.dds"
  12.     end
  13.  
  14.     if poiPinType == not (isDiscovered or isNearby) then
  15.         poiPinType = MAP_PIN_TYPE_INVALID
  16.     else
  17.         poiPinType = MAP_PIN_TYPE_POI_SEEN
  18.     end
  19.  
  20.     LMP:CreatePin( poiPinType, "pin-"..id, normalizedX, normalizedY )
  21.  
  22.     return normalizedX, normalizedY, poiPinType, icon, isShownInCurrentMap, linkedCollectibleIsLocked, isDiscovered, isNearby
  23. end

I tried a series of method calls with most throwing null or undefined errors.

Lua Code:
  1. ZO_WorldMapPins:CreatePin(poiPinType, id, normalizedX, normalizedY)
Lua Code:
  1. CreateSinglePOIPin( map, id)
Lua Code:
  1. g_mapPinManager:CreatePin(poiPinType, "testing", normalizedX, normalizedY)
Lua Code:
  1. ZO_MapLocations:AddLocation( map )

The last thing I tried was the popular LibMapPins library. The Library does receive the required data.


via
Lua Code:
  1. LMP:CreatePin( poiPinType, "pin-"..id, normalizedX, normalizedY )


However, I do not see undiscovered pins on the map. That's where I get lost. Any ideas on what I'm missing?

Last edited by Hydra9268 : 10/26/18 at 09:34 PM.
  Reply With Quote