Change Log:
--------------------
v 1.31
- added name tags for Scootworks
v 1.30
- updated api version and added IsLibrary tag
v 1.29
- updated api version for those that use the lib as standalone
v 1.29 (Shinni)
- adding multiple pins with the same pinTag doesn't result in stuck pins anymore
v 1.28.1 (Shinni)
- changed how pins are indexed, individual pins can now be deleted and accessed directly
- removed a buggy background texture that would display behind the pin's real texture
- updated API version
v1.26 (Garkin)
- updated API version
- minor changes in callbacks
v1.25 (Garkin)
- changed timing of WorldMap update, so shuttering when map is closed should be less noticeable
v1.24 (Garkin)
- update from version 1.21 now should work correctly
v1.23 (Garkin)
- fixed bug introduced in 1.22, map should be updated correctly now
v1.22 (Garkin)
- fixed bug where library could have loaded pins for different map
v1.21 (Garkin)
- changed way to detect map change, it should be more efficient
- :AddCustomPin method now checks if arguments are valid
- callback has now just one argument mapName (eg. "auridon/auridon_base"):
CALLBACK_MANAGER:RegisterCallback("CustomCompassPins_MapChanged", function(mapName) end)
v1.20 (Garkin)
- updated APIversion to 100004
- changed GetDistanceCoefficient function
- changed update frequence from 10ms to 20ms.
- added callback "CustomCompassPins_MapChanged". To register for callback use:
CALLBACK_MANAGER:RegisterCallback("CustomCompassPins_MapChanged", function(zone, subzone) end)
v1.19 (Garkin)
- fixed issue with invalid map size
v1.18 (Garkin)
- another fix for refreshing pins and distance coefficient
v1.17 (Garkin)
- fixed bug with refreshing pins
v1.16 (Garkin)
- different method to detect map change, previous didn't work when player had no quests.
v1.15 (Garkin)
- fixed possible issue with distance coefficient
- added addon manifest (.txt)
- added delay to update function
v1.14 (Garkin)
- compa...
Description:
--------------------
This Library allows addons to add custom pins to the compass.
How to use:
First you have to add the pinType:
COMPASS_PINS:AddCustomPin( pinType, pinCallback, layout )
pinType is a unique string eg "MySkyshards"
pinCallback is a callback function which receives a pinManager (more further below)
layout is a table which specifies texture and other settings for the pins of this pinType
The callback function
The callback function is called everytime, the compass is refreshed.
This function creates the pins via the given pinManager (first and only parameter).
example:
function( pinManager )
for _, pin in pairs( pins ) do
pinManager:CreatePin( pinType, pinTag, pin.x, pin.y )
end
end
The pinManager has only one method: CreatePin( pinType, pinTag, xLoc, yLoc )
pinType the pinType the created pin belongs to
pinTag an unique identifier for the pin. You can pass additional attributes to the pin via the pinTag, which can later be used (see layout for more information).
xLoc, yLoc position of the pin in normalized map coordinates. (0,0 = topleft, 1,1 = bottomright)
The layout table
The layout table must have the following keys:
maxDistance the maximal distance (in normalized map units) for the pin to be visible (it will slowly fade out, when the pin gets close to the maxDistance)
texture the filepath to the texture
optional keys:
FOV the field of view in radians. eg 2pi will result in the pin being always visible, pi means the pin is visible as long it is not behin...
--------------------
v 1.31
- added name tags for Scootworks
v 1.30
- updated api version and added IsLibrary tag
v 1.29
- updated api version for those that use the lib as standalone
v 1.29 (Shinni)
- adding multiple pins with the same pinTag doesn't result in stuck pins anymore
v 1.28.1 (Shinni)
- changed how pins are indexed, individual pins can now be deleted and accessed directly
- removed a buggy background texture that would display behind the pin's real texture
- updated API version
v1.26 (Garkin)
- updated API version
- minor changes in callbacks
v1.25 (Garkin)
- changed timing of WorldMap update, so shuttering when map is closed should be less noticeable
v1.24 (Garkin)
- update from version 1.21 now should work correctly
v1.23 (Garkin)
- fixed bug introduced in 1.22, map should be updated correctly now
v1.22 (Garkin)
- fixed bug where library could have loaded pins for different map
v1.21 (Garkin)
- changed way to detect map change, it should be more efficient
- :AddCustomPin method now checks if arguments are valid
- callback has now just one argument mapName (eg. "auridon/auridon_base"):
CALLBACK_MANAGER:RegisterCallback("CustomCompassPins_MapChanged", function(mapName) end)
v1.20 (Garkin)
- updated APIversion to 100004
- changed GetDistanceCoefficient function
- changed update frequence from 10ms to 20ms.
- added callback "CustomCompassPins_MapChanged". To register for callback use:
CALLBACK_MANAGER:RegisterCallback("CustomCompassPins_MapChanged", function(zone, subzone) end)
v1.19 (Garkin)
- fixed issue with invalid map size
v1.18 (Garkin)
- another fix for refreshing pins and distance coefficient
v1.17 (Garkin)
- fixed bug with refreshing pins
v1.16 (Garkin)
- different method to detect map change, previous didn't work when player had no quests.
v1.15 (Garkin)
- fixed possible issue with distance coefficient
- added addon manifest (.txt)
- added delay to update function
v1.14 (Garkin)
- compa...
Description:
--------------------
This Library allows addons to add custom pins to the compass.
How to use:
First you have to add the pinType:
COMPASS_PINS:AddCustomPin( pinType, pinCallback, layout )
pinType is a unique string eg "MySkyshards"
pinCallback is a callback function which receives a pinManager (more further below)
layout is a table which specifies texture and other settings for the pins of this pinType
The callback function
The callback function is called everytime, the compass is refreshed.
This function creates the pins via the given pinManager (first and only parameter).
example:
function( pinManager )
for _, pin in pairs( pins ) do
pinManager:CreatePin( pinType, pinTag, pin.x, pin.y )
end
end
The pinManager has only one method: CreatePin( pinType, pinTag, xLoc, yLoc )
pinType the pinType the created pin belongs to
pinTag an unique identifier for the pin. You can pass additional attributes to the pin via the pinTag, which can later be used (see layout for more information).
xLoc, yLoc position of the pin in normalized map coordinates. (0,0 = topleft, 1,1 = bottomright)
The layout table
The layout table must have the following keys:
maxDistance the maximal distance (in normalized map units) for the pin to be visible (it will slowly fade out, when the pin gets close to the maxDistance)
texture the filepath to the texture
optional keys:
FOV the field of view in radians. eg 2pi will result in the pin being always visible, pi means the pin is visible as long it is not behin...