Quantcast
Download
(19 Kb)
Download
Updated: 02/13/17 12:57 PM
Pictures
File Info
Compatibility:
Homestead (2.7)
Updated:02/13/17 12:57 PM
Created:06/27/14 12:58 PM
Monthly downloads:68
Total downloads:3,255
Favorites:15
MD5:
LibGPS2
Version: r11
by: sirinsidiator, votan
Have you ever tried to save or send a position on the map with your addon? You might have noticed that this is not as easy as it sounds.
This library efficiently converts a position on any map into a global position that you can save or share. This is made possible by measuring maps once when they are encountered for the first time during a play session and only doing simple calculations afterwards.
Starting with r6 LibMapPing is a required dependency for LibGPS and has to be loaded before LibGPS.

Quick Start
Add the necessary statements in your addon manifest to load the files:
Code:
## OptionalDependsOn: LibStub LibMapPing LibGPS

libs/LibStub/LibStub.lua
libs/LibMapPing/LibMapPing.lua
libs/LibGPS/LibGPS.lua
In order to use the library you have to get an instance from LibStub:
Code:
local gps = LibStub("LibGPS2")
Next you can convert a position on the currently active map into a global position on the Tamriel map by calling LocalToGlobal.
For example you can convert the local player position into a global position with the following line of code:
Code:
local x, y, zoneMapIndex = gps:LocalToGlobal(GetMapPlayerPosition("player"))
The resulting x and y can be saved, sent or whatever else you want to do with it.
The call to LocalToGlobal will also return a mapIndex which represents the parent zone of the currently opened map.
NOTE: The zoneMapIndex can be different for the same position depending on the map the user has opened.
NOTE: For some locations the global coordinates can be outside the bounds for normalized coordinates, for example Coldharbour has negative x coordinates as it is to the left of Tamriel in the global coordinate space.

After you have loaded or received a global position you just need to call GlobalToLocal to get the position on the current map.
Code:
local x, y = gps:GlobalToLocal(x, y)
API Reference
Here is a complete list of the functionality that is provided by LibGPS2:

IsReady
Returns true as long as the player exists.
Code:
lib:IsReady()
IsMeasuring
Returns true if the library is currently doing any measurements.
Code:
lib:IsMeasuring()
ClearMapMeasurements
Removes all cached measurement values.
Code:
lib:ClearMapMeasurements()
ClearCurrentMapMeasurements
Removes the cached measurement values for the map that is currently active.
Code:
lib:ClearCurrentMapMeasurements()
GetCurrentMapMeasurements
Returns a table with the measurement values for the active map or nil if the measurements could not be calculated for some reason.
The table contains scaleX, scaleY, offsetX, offsetY and zoneMapIndex.
scaleX and scaleY are the dimensions of the active map on the Tamriel map.
offsetX and offsetY are the offset of the top left corner on the Tamriel map.
zoneMapIndex is the mapIndex of the parent zone of the current map.
Code:
table measurements = lib:GetCurrentMapMeasurements()
GetCurrentMapParentZoneIndices *new in r10*
Returns the mapIndex and zoneIndex of the parent zone for the currently set map.
Code:
number mapIndex, number zoneIndex = lib:GetCurrentMapParentZoneIndices()
CalculateCurrentMapMeasurements
Calculates the measurements for the current map and all parent maps.
This method does nothing if there is already a cached measurement for the active map.
Returns a boolean to indicate if the measurement was successful and a SetMapResultCode indicating if the map has changed independently of the actual result of the measurement.
Code:
boolean isSuccess, SetMapResultCode result = lib:CalculateCurrentMapMeasurements()
LocalToGlobal
Converts the given map coordinates on the current map into coordinates on the Tamriel map.
Returns x and y on the world map and the mapIndex of the parent zone
or nil if the measurements of the active map are not available.
Code:
number x, number y, number zoneMapIndex = lib:LocalToGlobal(number x, number y)
GlobalToLocal
Converts the given global coordinates into a position on the active map.
Returns x and y on the current map or nil if the measurements of the active map are not available.
Code:
number x, number y = lib:GlobalToLocal(number x, number y)
ZoneToGlobal
Converts the given map coordinates on the specified zone map into coordinates on the Tamriel map.
This method is useful if you want to convert global positions from LibGPS version 1 into the new format.
Returns x and y on the world map or nil if the measurements of the zone map are not available.
Code:
number x, number y = gps:ZoneToGlobal(number zoneMapIndex, number x, number y)
PanToMapPosition
This function zooms and pans to the specified position on the active map.
Code:
lib:PanToMapPosition(number x, number y)
SetPlayerChoseCurrentMap
This function sets the current map as player chosen so it won't snap back to the previous map.
Code:
lib:SetPlayerChoseCurrentMap()
MapZoomInMax
Repeatedly calls ProcessMapClick on the given global position starting on the Tamriel map until nothing more would happen.
Returns SET_MAP_RESULT_FAILED, SET_MAP_RESULT_MAP_CHANGED or SET_MAP_RESULT_CURRENT_MAP_UNCHANGED depending on the result of the API calls.
Code:
SetMapResultCode result = lib:MapZoomInMax(number x, number y)
PushCurrentMap
This function stores information about how to return to the current map on a stack.
Code:
lib:PushCurrentMap()
PopCurrentMap
Switches to the last map that was put on the stack.
Returns SET_MAP_RESULT_FAILED, SET_MAP_RESULT_MAP_CHANGED or SET_MAP_RESULT_CURRENT_MAP_UNCHANGED depending on the result of the API calls.
Code:
SetMapResultCode result = lib:PopCurrentMap()
OnLibGPS2MeasurementChanged
This callback is fired on the global CALLBACK_MANAGER when a map measurement begins or ends and passes the same value as lib:IsMeasuring().
If you have a custom handler for player waypoints in EVENT_MAP_PING you may want to ignore these events while a measurement is active.
Tip: Since r6 the waypoint handling is managed by LibMapPing, which you should take a look into as it offers many useful features for working with map pings.
Code:
CALLBACK_MANAGER:RegisterCallback(lib.LIB_EVENT_STATE_CHANGED, function(boolean isMeasuring) end)
version 2.0 r11 - votan
  • Fixed issue, which was fixed in rev9 and lost in rev10, again. e.g. "Show on Map"
  • Update API version in manifest
  • Make use of new API functions to get pin manager and pan to location.

version 2.0 r10 - sirinsidiator
  • added new method GetCurrentMapParentZoneIndices
  • update API version in manifest

version 2.0 r9 - votan
  • Fixed issue with maps like "Blackwood Borderlands".
  • update API version in manifest

version 2.0 r8 - sirinsidiator
  • updated LibMapPing to r5
  • update API version in manifest

version 2.0 r7.1 - sirinsidiator
  • fixed issue in PopCurrentMap where it would throw an error on some maps

version 2.0 r7a - sirinsidiator
  • updated the bundled LibMapPing to r4
  • no other changes

version 2.0 r7 - sirinsidiator
  • fixed player waypoints not showing on the map in some cases
  • removed some compatibility code for old API

version 2.0 r6 - sirinsidiator
  • Prepared library for API version 100014
  • Improved measurement algorithm for better addon compatibility
  • Added LibMapPing to handle silent setting of map pings
    • Note: This is a required dependency and you need to include it in your addon and load it before LibGPS
  • Added two new functions PushCurrentMap and PopCurrentMap to handle returning to a previous map

version 2.0 r5.4 - votan
  • Fixed muting waypoint click sound can get stucked. (you need to place the waypoint more times until it is working again)
  • Hooked ProcessClick to get map measurement while clicking down to a (sub-)zone already.

version 2.0 r5.3 - votan
  • Restore player waypoint correctly. Broken since ESO 2.2.5???

version 2.0 r5.2 - votan
  • New functions IsReady() and IsMeasuring()
  • Earlier initialization: LibGPS is ready at player activation.

version 2.0 r5.1 - votan
  • New origin map location detection does not use localized names (GetMapName, GetPlayerLocationName) anymore. Instead working with SetMapToPlayerLocation. Thanks to circonian for inspiring idea.

version 2.0 r5 - votan
  • Origin map location detection: isPlayerLocation uses in-string search and exception list.
  • Hook all SetMapTo* functions, for a deterministic last action
Both changes hopefully fixing problems with dungeons.

version 2.0 r4.3 - votan
  • Fixed map measurement for dungeons like "The Harborage".
  • Removed code for API 100011.

version 2.0 r4.2 - votan
  • Fix for recent changes to EVENT_MAP_PING behavior. (Update 7)

version 2.0 r4.1 - votan
  • Fixed minor bug with Transitus Shrine of alliance base: Depending on when LibGPS does its measurement, you got locked to the alliance base subzone, because map navigation is disabled while interacting with a Transitus Shrine.

version 2.0 r4 - votan
  • ESO 2.1 API 100012 ready
  • Event name is public now: lib.LIB_EVENT_STATE_CHANGED
  • Fixing issue if near a wayshrine sub-zone: Map was not detected as current player location
  • For devs: new switch to enable debug: lib.debugMode = 1

version 2.0 r3 - votan
  • Rewrote calculation of map measurements to get rid of using zo_callLater to prevend timing issues
  • Introduced new event callback to get notified when measurement starts and ends

version 2.0.1 - sirinsidiator
features
  • updated to latest API version

version 2.0 - sirinsidiator
features
  • rewrote calculation of map measurements to be more robust and efficient fixing many cases where calculations where not working as intended
  • changed library to use real global positions (tamriel coordinates)
  • added counter measure against a bug in the game where the waypoint is lost when entering or leaving some dungeons
  • fixed libGPS interfering with manually changing the map to one that has not been measured yet
  • changed how the waypoint sounds are muted to prevent the whole UI from being muted permanently in some cases
  • added error messages with attached debug information that can be copied to clipboard
  • split off CalculateCurrentMapMeasurements function from GetCurrentMapMeasurements
  • added ZoneToGlobal function to convert from old global coordinates to new format
  • added ClearCurrentMapMeasurements function to clear measurements of only the current map
  • added PanToMapPosition function which allows to pan to any position on the current map
  • added MapZoomInMax function which zooms in as far as possible (map wise) for a given global position
  • added SetPlayerChoseCurrentMap function which allows you to set the current map as player chosen, thus preventing the map from automatically snapping back.

version 1.0.1 - sirinsidiator
features
  • renamed zoneIndex to mapIndex to avoid confusion (thanks Garkin)
Optional Files (0)


Archived Files (21)
File Name
Version
Size
Author
Date
r10
19kB
sirinsidiator
01/28/17 01:49 PM
r9
18kB
sirinsidiator
09/30/16 11:04 AM
r8
19kB
sirinsidiator
07/14/16 02:47 PM
r7.1
18kB
sirinsidiator
04/24/16 12:55 PM
r7a
18kB
sirinsidiator
03/19/16 09:00 AM
r7
18kB
sirinsidiator
03/14/16 10:45 AM
r6
18kB
sirinsidiator
02/20/16 11:43 AM
2.0 r5.4
11kB
sirinsidiator
12/06/15 02:53 PM
2.0 r5.3
11kB
sirinsidiator
11/25/15 03:10 PM
2.0 r5.2
11kB
sirinsidiator
11/08/15 09:24 AM
2.0 r5.1
11kB
sirinsidiator
10/01/15 10:56 AM
2.0 r5
11kB
sirinsidiator
09/19/15 07:39 AM
2.0 r4.3
10kB
sirinsidiator
09/06/15 01:39 AM
2.0 r4.2
10kB
sirinsidiator
08/30/15 12:13 PM
2.0 r4.1
10kB
sirinsidiator
08/21/15 11:03 AM
2.0 r4
10kB
sirinsidiator
08/13/15 01:05 PM
2.0 r3
8kB
sirinsidiator
04/23/15 12:33 PM
2.0.1
7kB
sirinsidiator
08/06/14 09:14 AM
2.0
7kB
sirinsidiator
07/30/14 01:58 PM
1.0.1
3kB
sirinsidiator
06/28/14 06:44 AM
1.0
3kB
sirinsidiator
06/27/14 12:58 PM


Post A Reply Comment Options
Unread 11/11/16, 05:03 AM  
QuadroTony
Banned
 
QuadroTony's Avatar
AddOn Author - Click to view AddOns

Forum posts: 828
File comments: 3958
Uploads: 3
Originally Posted by QuadroTony
With this library enabled in ANY addons quest's "Show on map" option (drop down menu) is non-functional FOR QUESTS in Dungeons. It will show your position instead AT first ATTEMPT.
http://www.esoui.com/forums/showthre...8707#post28707
any ETA on fix? or this addon abandoned?
__________________
Report comment to moderator  
Reply With Quote
Unread 10/26/16, 04:11 AM  
QuadroTony
Banned
 
QuadroTony's Avatar
AddOn Author - Click to view AddOns

Forum posts: 828
File comments: 3958
Uploads: 3
Originally Posted by sirinsidiator
Unfortunately there is no way to switch to just any map in the game. You can only show maps that can be reached via the following functions:
  • SetMapToQuestCondition
  • SetMapToQuestZone
  • SetMapToPlayerLocation
  • SetMapToMapListIndex
  • ProcessMapClick
  • SetMapFloor
Which means you cannot open a dungeon map while outside of that specific dungeon.
but Show On Map menu of a quest can show you location of a dungeon, even if you are at overland
__________________
Last edited by QuadroTony : 10/26/16 at 04:14 AM.
Report comment to moderator  
Reply With Quote
Unread 10/26/16, 04:09 AM  
QuadroTony
Banned
 
QuadroTony's Avatar
AddOn Author - Click to view AddOns

Forum posts: 828
File comments: 3958
Uploads: 3
With this library enabled in ANY addons quest's "Show on map" option (drop down menu) is non-functional FOR QUESTS in Dungeons. It will show your position instead AT first ATTEMPT.
http://www.esoui.com/forums/showthre...8707#post28707
__________________
Last edited by QuadroTony : 10/26/16 at 06:46 AM.
Report comment to moderator  
Reply With Quote
Unread 10/25/16, 01:13 PM  
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 235
Uploads: 12
Originally Posted by sirinsidiator
Originally Posted by Mitsarugi
Originally Posted by votan
Originally Posted by Mitsarugi
How should i proceed to Jump to a specific map and location?
For example a Dungeon Map while being anywhere?
Hi Mitsarugi,

are you talking about jumping via fast travel or changing the current world map to show the dungeon?
Yes i would like to see the map for a certain location, like the Quest Pins (Show on map) do.
if you open the map it will show where you currently are, i would like to browse the maps that are ingame so that other addons that add stuff to those maps would work on them, and i would be able to use the map Window to be shown in my addon as the Minimap addon uses it at a smaller size too.
(Want to use it in my Atlas addon)
Unfortunately there is no way to switch to just any map in the game. You can only show maps that can be reached via the following functions:
  • SetMapToQuestCondition
  • SetMapToQuestZone
  • SetMapToPlayerLocation
  • SetMapToMapListIndex
  • ProcessMapClick
  • SetMapFloor
Which means you cannot open a dungeon map while outside of that specific dungeon.
Ok thank you thats what i wanted to know
__________________
@xMitsarugix - (EU server)
Report comment to moderator  
Reply With Quote
Unread 10/25/16, 06:04 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 917
File comments: 554
Uploads: 27
Originally Posted by Mitsarugi
Originally Posted by votan
Originally Posted by Mitsarugi
How should i proceed to Jump to a specific map and location?
For example a Dungeon Map while being anywhere?
Hi Mitsarugi,

are you talking about jumping via fast travel or changing the current world map to show the dungeon?
Yes i would like to see the map for a certain location, like the Quest Pins (Show on map) do.
if you open the map it will show where you currently are, i would like to browse the maps that are ingame so that other addons that add stuff to those maps would work on them, and i would be able to use the map Window to be shown in my addon as the Minimap addon uses it at a smaller size too.
(Want to use it in my Atlas addon)
Unfortunately there is no way to switch to just any map in the game. You can only show maps that can be reached via the following functions:
  • SetMapToQuestCondition
  • SetMapToQuestZone
  • SetMapToPlayerLocation
  • SetMapToMapListIndex
  • ProcessMapClick
  • SetMapFloor
Which means you cannot open a dungeon map while outside of that specific dungeon.
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
Last edited by sirinsidiator : 10/25/16 at 06:05 AM.
Report comment to moderator  
Reply With Quote
Unread 10/25/16, 04:50 AM  
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 235
Uploads: 12
Originally Posted by votan
Originally Posted by Mitsarugi
How should i proceed to Jump to a specific map and location?
For example a Dungeon Map while being anywhere?
Hi Mitsarugi,

are you talking about jumping via fast travel or changing the current world map to show the dungeon?
Yes i would like to see the map for a certain location, like the Quest Pins (Show on map) do.
if you open the map it will show where you currently are, i would like to browse the maps that are ingame so that other addons that add stuff to those maps would work on them, and i would be able to use the map Window to be shown in my addon as the Minimap addon uses it at a smaller size too.
(Want to use it in my Atlas addon)
__________________
@xMitsarugix - (EU server)
Report comment to moderator  
Reply With Quote
Unread 10/25/16, 01:29 AM  
votan
 
votan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 390
File comments: 665
Uploads: 20
Originally Posted by Mitsarugi
How should i proceed to Jump to a specific map and location?
For example a Dungeon Map while being anywhere?
Hi Mitsarugi,

are you talking about jumping via fast travel or changing the current world map to show the dungeon?
__________________
@votan73 (EU - megaserver)
Report comment to moderator  
Reply With Quote
Unread 10/24/16, 05:40 PM  
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 235
Uploads: 12
How should i proceed to Jump to a specific map and location?
For example a Dungeon Map while being anywhere?
__________________
@xMitsarugix - (EU server)
Report comment to moderator  
Reply With Quote
Unread 09/30/16, 11:09 AM  
votan
 
votan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 390
File comments: 665
Uploads: 20
I hopefully could fix the issue reported by @Ayantir and @ForgottenLight.

LibGPS rev9.
__________________
@votan73 (EU - megaserver)
Last edited by votan : 09/30/16 at 11:09 AM.
Report comment to moderator  
Reply With Quote
Unread 09/29/16, 07:12 AM  
ForgottenLight
 
ForgottenLight's Avatar
AddOn Author - Click to view AddOns

Forum posts: 31
File comments: 110
Uploads: 11
Found error in location Blackwood Borderlands (quest A ghost from the past, Dark Brotherhood)
Lua Code:
  1. user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:700: attempt to index a nil value
  2. stack traceback:
  3.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:700: in function 'lib:PopCurrentMap'
  4.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:524: in function 'lib:CalculateMapMeasurements'
  5.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:333: in function 'NewSetMapToPlayerLocation'
  6.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:434: in function 'Initialize'
  7.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:723: in function '(main chunk)'

/script d(GetCurrentMapZoneIndex()) = 4294967296
/script d(GetMapInfo()) = Tamriel / 3 / 0 / 0
/script d(GetCurrentMapIndex()) = nil
Report comment to moderator  
Reply With Quote
Unread 08/06/16, 07:54 AM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 899
File comments: 1391
Uploads: 30
Lua Code:
  1. user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:700: attempt to index a nil value
  2. stack traceback:
  3.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:700: in function 'lib:PopCurrentMap'
  4.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:524: in function 'lib:CalculateMapMeasurements'
  5.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:333: in function 'NewSetMapToPlayerLocation'
  6.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:434: in function 'Initialize'
  7.     user:/AddOns/LoreBooks/libs/LibGPS/LibGPS.lua:723: in function '(main chunk)'

/script d(GetCurrentMapZoneIndex()) = 347
/script d(GetMapInfo()) = Tamriel^M / 3 / 0 / 0
/script d(GetCurrentMapIndex()) = nil
__________________
Obsessive Compulsive Coder

My little french Guild: Cercle de l'Eveil
Report comment to moderator  
Reply With Quote
Unread 04/28/16, 01:08 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 917
File comments: 554
Uploads: 27
No idea yet why it happens, but it certainly should not be that way. Is this happening on live or pts?
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
Report comment to moderator  
Reply With Quote
Unread 04/28/16, 05:12 AM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 899
File comments: 1391
Uploads: 30
I looked a bit more, my analyzis was a bit false..

It's the function

Lua Code:
  1. GPS:GlobalToLocal(pinData.x, pinData.y)

which broke the thing. After using it, GetMapContentType() inherits of the values of the upper map.



My code runs 3 times (I have X callbacks bind to this code depending on filters user activated).

1st run :

before : ok
after : ok

2nd run

before : nok
after : nok

3rd run :

before : nok
after : nok

If I comment GPS:GlobalToLocal(pinData.x, pinData.y), all is okay.

I tried to do a
Lua Code:
  1. GPS:PushCurrentMap()
  2.  
  3. ...
  4.  
  5.     GPS:PopCurrentMap()
but it don't work.

The strange thing is after the first run, all is still okay.
__________________
Obsessive Compulsive Coder

My little french Guild: Cercle de l'Eveil
Last edited by Ayantir : 04/28/16 at 05:16 AM.
Report comment to moderator  
Reply With Quote
Unread 04/28/16, 04:44 AM  
votan
 
votan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 390
File comments: 665
Uploads: 20
Originally Posted by Ayantir
Originally Posted by votan
mapIndex is nil, if it is not one of the 29 "main" locations from the Locations tab.
Use GetCurrentZoneIndex() This works in cities, too.
I do know this, but GPS:GetCurrentMapMeasurements() returns the correct mapIndex everywhere when GetCurrentMapIndex() is nil .. except on the first visit of a dungeon inside a city

And I do not want to use GetCurrentZoneIndex() because of the city problem.

ex: I'm in Wayrest, no mapIndex, so let's use it's zoneIndex. I build all the pins of the zoneIndex (Wayrest), now my character moves to Stormhaven.. I don't have any data, because the only one I have is the Wayrest one.

I could build a translation table of zoneIndex -> mapIndex if this bug cannot be fixed, but I would like to avoid.

Even more my main problem is the function GetMapContentType() which returns the incorrect value due to this problem.
Ahh. I see. I misunderstood the problem
I wonder if it would work with rev 6, before LibMapPing. If so, we may have some hints.
/edit 2:
What if you do this:
Lua Code:
  1. local mapIndex = GetCurrentMapIndex()
  2. local usePrecalculatedCoords = true
  3. if not mapIndex then
  4.     usePrecalculatedCoords = false
  5.    
  6.     -- This triggers measurement and brings you back to where the player is
  7.         if SetMapToPlayerLocation() == SET_MAP_RESULT_MAP_CHANGED then
  8.             CALLBACK_MANAGER:FireCallbacks("OnWorldMapChanged")
  9.         end
  10.  
  11.     local measurements = GPS:GetCurrentMapMeasurements()
  12.     mapIndex = measurements.mapIndex
  13. end
  14.  
  15. local mapContentType = GetMapContentType()
__________________
@votan73 (EU - megaserver)
Last edited by votan : 04/28/16 at 05:07 AM.
Report comment to moderator  
Reply With Quote
Unread 04/28/16, 04:09 AM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 899
File comments: 1391
Uploads: 30
Originally Posted by votan
mapIndex is nil, if it is not one of the 29 "main" locations from the Locations tab.
Use GetCurrentZoneIndex() This works in cities, too.
I do know this, but GPS:GetCurrentMapMeasurements() returns the correct mapIndex everywhere when GetCurrentMapIndex() is nil .. except on the first visit of a dungeon inside a city

And I do not want to use GetCurrentZoneIndex() because of the city problem.

ex: I'm in Wayrest, no mapIndex, so let's use it's zoneIndex. I build all the pins of the zoneIndex (Wayrest), now my character moves to Stormhaven.. I don't have any data, because the only one I have is the Wayrest one.

I could build a translation table of zoneIndex -> mapIndex if this bug cannot be fixed, but I would like to avoid.

Even more my main problem is the function GetMapContentType() which returns the incorrect value due to this problem.
__________________
Obsessive Compulsive Coder

My little french Guild: Cercle de l'Eveil
Last edited by Ayantir : 04/28/16 at 04:11 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.