Unknown POI listed as MAP_PIN_TYPE_POI_SEEN
I'm currently updating the Destinations addon for Murkmire, and unknown points of interest were broken by this update. The addon used to check for them like this:
Lua Code:
Since 4.2.0 this no longer works, as poiType is now always MAP_PIN_TYPE_POI_SEEN, even if they are not shown to the player. Why was this changed? Does anyone know of a good new way to check for unknown POIs? |
The new signature for that function is:
GetPOIMapInfo(zoneIndex, poiIndex) return normalizedX, normalizedZ, poiPinType, icon, isShownInCurrentMap, linkedCollectibleIsLocked, isDiscovered, isNearby isDiscovered and isNearby were added. Now instead of obfuscating POIs you haven't seen, we let the API know about it (where it is, which icon, etc) and we provide whether or not it's discovered and whether or not it's nearby to determine whether or not we want to show it on the map. For the purposes of addons, you can make your own determinations about what POIs you show and how (primarily using isShownInCurrentMap, isDiscovered, and isNearby), but you no longer need to cache off your own position and icon information. If the zoneIndex and poiIndex are good, you should no longer be getting back INVALID for the poiPinType. To mirror the old behavior, in the past if isDiscovered was false and isNearby was false, poiPinType would have been INVALID. Lua Code:
|
Thanks for the information Dan!
|
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:
I tried a series of method calls with most throwing null or undefined errors. Lua Code:
Lua Code:
Lua Code:
Lua Code:
The last thing I tried was the popular LibMapPins library. The Library does receive the required data. via Lua Code:
However, I do not see undiscovered pins on the map. That's where I get lost. Any ideas on what I'm missing? |
Not abke to help here but please do not override the functions of the game! It will break other addons if your addon does not ##OptionallDependsOn: addonName!
Please use Zo_PreHook instead and return false to call the original function, or true to end after your preehook code was run and the original function does not need to be run anymore. |
Quote:
|
Quote:
|
All times are GMT -6. The time now is 03:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI