Quantcast
Download
(4 Kb)
Download
Updated: 10/01/21 09:52 AM
Pictures
File Info
Compatibility:
Deadlands (7.2.5)
Greymoor (6.0.5)
Updated:10/01/21 09:52 AM
Created:04/09/14 06:55 PM
Monthly downloads:108,982
Total downloads:1,786,587
Favorites:1,399
MD5:
CustomCompassPins  Popular! (More than 5000 hits)
Version: 1.32
by: Shinni, Garkin
This Library allows addons to add custom pins to the compass.

How to use:

First you have to add the pinType:
Lua Code:
  1. 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:
Lua Code:
  1. function( pinManager )
  2.     for _, pin in pairs( pins ) do
  3.         pinManager:CreatePin( pinType, pinTag, pin.x, pin.y )
  4.     end
  5. 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 behind the player.
sizeCallback a function which receives the pin, the angle between the player and the pin, the normalized angle (-1 = left border of the compass, 1 = right border of the compass, 0 = center of the compass), normalizedDistance (0 = same position as player, 1 = pin is at maxDistance)
This function can modify the size of the pin via pin:SetDimension(width, height)
If no function is given, the pin has a size of 32x32 and will become smaller if abs(normalizedAngle) > 0.25
additionalLayout another table with 2 components, each one needs to be a function.
The first one receives the same parameters as the sizeCallback function. It can be used to implement additional visual effects. eg: you could do something like pin:SetColor(1,0,0,1) to make the pin red.
The second function receives only a pin as parameter. As the pins are pooled (saved to be used again), the additional modifications of the pin need to be cleared again. So in the previous example this function should call pin:SetColor(1,1,1,1) to make the pin white again.

The pin object
a pin has the following attributes:
pin.xLoc x coordinate
pin.yLoc y coordinate
pin.pinType the pinType
pin.pinTag the pinTag
As the pin is the first given parameter in the layout callback functions, you can pass any data to these functions via the pinTag (eg an alternate texture that is different from the one specified in the layout table)

important functions
pin:SetAlpha(value) 1 = pin is opaque, 0 = pin is transparent. Usefull for fadeout effects.
pin:SetHidden(bool) if bool is true, the pin is invisible
pin:SetDimensions(width, height) sets the width and height of the pin (usefull if you want to implement your own a zoom effect near the border or something like that)
pin:SetColor(r, g, b, a) changes the pins color. you can create some kind of highlighting effect with this.
pin:GetNamedChild( "Background" ) returns the texture control.
v 1.32
- fixed lua error that occurs on deadlands PTS

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)
- compass distance is now scaled with the mapsize (approximate)

v1.13
- when creating and removing a lot of pins the pinTypes could mix up, resulting in incompabilities of different addons

v1.12
- only create controls when needed

v1.11
- fixed an error where one addon could accidentally delete the pins of other addons.

v1.1
- released
Optional Files (0)


Archived Files (19)
File Name
Version
Size
Uploader
Date
1.31
4kB
Shinni
05/25/20 11:47 AM
1.30
4kB
Shinni
03/26/20 12:18 PM
1.29
4kB
Shinni
10/23/18 05:15 PM
1.29
4kB
Shinni
03/23/16 11:05 AM
1.28.1
4kB
Shinni
03/10/16 12:18 PM
1.26
4kB
Garkin
06/25/14 07:39 AM
1.25
4kB
Garkin
06/12/14 04:42 AM
1.24
4kB
Garkin
06/07/14 08:15 AM
1.23
4kB
Garkin
06/07/14 07:17 AM
1.20
3kB
Garkin
05/29/14 06:16 PM
1.19
3kB
Garkin
05/14/14 05:11 PM
1.18
3kB
Garkin
05/13/14 09:31 PM
1.17
3kB
Garkin
05/11/14 05:50 AM
1.16
3kB
Garkin
05/09/14 07:04 AM
1.15
3kB
Garkin
05/07/14 08:09 PM
1.14
3kB
Shinni
04/26/14 02:58 PM
1.13
3kB
Shinni
04/26/14 02:31 PM
1.13
2kB
Shinni
04/09/14 08:27 PM
1.1
2kB
Shinni
04/09/14 06:55 PM


Post A Reply Comment Options
Unread 09/21/21, 10:21 AM  
Marazota
AddOn Author - Click to view AddOns

Forum posts: 232
File comments: 1405
Uploads: 2
errors on PTS

Code:
bad argument #1 to 'pairs' (table/struct expected, got nil)
stack traceback:
[C]: in function 'pairs'
/EsoUI/Libraries/Utility/ZO_ObjectPool.lua:187: in function 'ZO_ObjectPool:ReleaseAllObjects'
|caaaaaa<Locals> self = [table:1]{defaultAngle = 1} </Locals>|r
user:/AddOns/CustomCompassPins/CustomCompassPins.lua:231: in function 'CompassPinManager:RemovePins'
|caaaaaa<Locals> self = [table:1] </Locals>|r
user:/AddOns/CustomCompassPins/CustomCompassPins.lua:120: in function 'COMPASS_PINS:RefreshPins'
|caaaaaa<Locals> self = [table:2]{distanceCoefficient = 2.4494897427832, version = 1.31, defaultFOV = 1.8849555921539} </Locals>|r
user:/AddOns/CustomCompassPins/CustomCompassPins.lua:84: in function 'callback'
|caaaaaa<Locals> currentMap = "cyrodiil/eastelsweyrgate_base..." </Locals>|r
/EsoUI/Libraries/Utility/ZO_CallbackObject.lua:107: in function 'ZO_CallbackObjectMixin:FireCallbacks'
|caaaaaa<Locals> self = [table:3]{fireCallbackDepth = 1}, eventName = "CustomCompassPins_MapChanged", registry = [table:4]{}, callbackInfoIndex = 1, callbackInfo = [table:5]{3 = F}, callback = user:/AddOns/CustomCompassPins/CustomCompassPins.lua:81, deleted = F </Locals>|r
user:/AddOns/CustomCompassPins/CustomCompassPins.lua:76: in function 'layoutCallback'
|caaaaaa<Locals> currentMap = "cyrodiil/eastelsweyrgate_base..." </Locals>|r
/EsoUI/Ingame/Map/WorldMap.lua:1478: in function 'ZO_WorldMapPins:RefreshCustomPins'
|caaaaaa<Locals> self = [table:6]{m_NextControlId = 0, nextCustomPinType = 230, m_NextFree = 18}, pinTypeId = 230, pinData = [table:7]{pinTypeString = "CustomCompassPins_MapChangeDet...", enabled = T} </Locals>|r
/EsoUI/Ingame/Map/WorldMap.lua:3842: in function 'ZO_WorldMap_UpdateMap'
|caaaaaa<Locals> mapTitle = "Eastern Elsweyr Gate" </Locals>|r
(tail call): ?
/EsoUI/Ingame/Map/WorldMap.lua:6553: in function 'ZO_WorldMapManager:SetToMode'
|caaaaaa<Locals> self = [table:8]{antiquityDigSiteAnimationState = 1, inSpecialMode = F, mode = 2, autoNavigationState = 1}, mode = 2, transientModeData = [table:9]{}, initialNormalizedZoom = 0, smallMap = F, layout = [table:10]{offsetX = 0, paddingX = 0, paddingY = 0, offsetY = 0} </Locals>|r
/EsoUI/Ingame/Map/WorldMap.lua:6470: in function 'ZO_WorldMapManager:SetUserMode'
|caaaaaa<Locals> self = [table:8], mode = 2 </Locals>|r
/EsoUI/Ingame/Map/WorldMap.lua:5306: in function 'OnAddOnLoaded'
|caaaaaa<Locals> eventCode = 65536, addOnName = "ZO_Ingame", defaults = [table:11]{userMode = 2}, smallCustom = [table:12]{keepSquare = T, point = 128, width = 488, relPoint = 128, x = 0, mapSize = 2, y = 0, height = 550}, uiWidth = 1920, uiHeight = 1080 </Locals>|r
Report comment to moderator  
Reply With Quote
Unread 05/01/21, 05:23 AM  
MrPikPik
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 21
Uploads: 20
Small oversight

Hello, I found some small oversight that would make pins shoot outside the compass frame if the (undocumented?) layout.maxAngle property has been set to values greater than 1.
I was using setting this property in order to display a pin at all times if the player is in range.

The fix for this issue would be changing line 294 in CompassPinManager:Update() method from
Lua Code:
  1. pin:SetAnchor(CENTER, PARENT, CENTER, 0.5 * PARENT:GetWidth() * normalizedAngle, 0)
to
Lua Code:
  1. pin:SetAnchor(CENTER, PARENT, CENTER, 0.5 * PARENT:GetWidth() * zo_clamp(normalizedAngle, -1, 1), 0)

I really would appreciate this being added

Kind regards
MrPikPik
Report comment to moderator  
Reply With Quote
Unread 04/27/21, 09:57 AM  
MakemSalty_ZOID

Forum posts: 0
File comments: 1
Uploads: 0
So confused

How do I add Pin type. The description was very confusing. Some of us aren't coders. Can someone just tell me in simple form how to activate this addon
Report comment to moderator  
Reply With Quote
Unread 01/04/21, 08:58 AM  
Duramar

Forum posts: 0
File comments: 3
Uploads: 0
hi! any information concerning the Markarth update?
Report comment to moderator  
Reply With Quote
Unread 09/25/20, 06:03 AM  
Diggs

Forum posts: 0
File comments: 2
Uploads: 0
Missing Download 1.31

The change log says there is a version 1.31 but, 1.30 is the last one posted for download. Game says I need to update this dependency but, it's not available.
Report comment to moderator  
Reply With Quote
Unread 05/29/20, 12:08 AM  
Lenox

Forum posts: 8
File comments: 28
Uploads: 0
CustomCompassPins seems to be exactly what I want, but it's a library and not an add-on, and I don't know how to work with those (maybe I can learn?!). What's the best way for me to add an Outlaws Refuge to my compass? Or other similar locations that aren't on the compass by default? If there is an add-on that is recommended, can someone give me a name? All I've been able to find are full compass and map replacements, as well as mini-map add-ons. And while those options are great and I have tried some, they're not what I'm looking for.
__________________
Orc StamKnight - lvl 38
cp 485:
Redguard StamSorc
Argonian HealPlar
Khajiit MagBlade
Nord TankCro
Report comment to moderator  
Reply With Quote
Unread 12/30/19, 05:21 PM  
Edorenel
 
Edorenel's Avatar

Forum posts: 0
File comments: 12
Uploads: 0
Question A Wee Question

Will this add-on update to The Elder Scrolls Online v5.2.11 (or 5.2.5, according to some of the current, most popular add-ons)?
__________________
“Tomorrow may be hell, but today was a good writing day, and on the good writing days nothing else matters.” - Neil Gaiman


Like my writings/drawings? Support me on Ko-Fi!
Official Website: Edorenel
Report comment to moderator  
Reply With Quote
Unread 12/24/19, 11:46 AM  
Shrinkwrap

Forum posts: 1
File comments: 15
Uploads: 0
Update?

Can we get a Dragon update please? Thank you
Report comment to moderator  
Reply With Quote
Unread 06/11/19, 06:46 AM  
Gandalf
 
Gandalf's Avatar

Forum posts: 28
File comments: 92
Uploads: 0
The manifest file should be changed to:

## APIVersion: 100027
## IsLibrary: true

doing so means to increase the AddOnVersion as well

Additional comments:
  • Introducing LibStub to a Library that never had dependencies to LibStub is not good idea.
    Especially since the community is in the process to get rid of LibStub at all
  • Why introducing an additional folder level? Having the addon file and the manifest together is simple
    and clean, isn't it?
Last edited by Gandalf : 06/11/19 at 06:47 AM.
Report comment to moderator  
Reply With Quote
Unread 05/28/19, 09:28 AM  
TehChad1988

Forum posts: 0
File comments: 4
Uploads: 0
Current?

Is this even current in game it says this is out of date Minion doesn't update and theres nothing in this thread stating otherwise.
Report comment to moderator  
Reply With Quote
Unread 05/26/19, 10:17 AM  
Growlf1

Forum posts: 3
File comments: 46
Uploads: 0
Problem with CustomCompassPins solved.

The Addon/ Library didn't activate himself after installing via Minion (like every other addon does).
Never had the idea that this happens ...
Report comment to moderator  
Reply With Quote
Unread 05/20/19, 11:26 PM  
Shadowshire

Forum posts: 1
File comments: 383
Uploads: 0
Exclamation Custom Compass Pins

Is Custom Compass Pins useable as a stand-alone add-on? If so, what are its features?

Originally Posted by Baertram
You should add the new tag ##IsLibrary: true to the txt file as well so the ingame addon manager recognizes it as library.

And somehow this lib is not found on Minion! Maybe change the category.
Are you saying that you forgot to add that tag to the "txt file" so that it will recognized by the ESO game client as a "library"?

(Venting follows): When the add-on developers -- you among them! -- started to require players to download and install "library" files to be used by add-ons, they explicitly stated that EACH AND EVERY "library" package would begin its name with the prefix "Lib". Although, since then I have seen one that starts with "lib" (some "C-head" who despises upper-case letters, I suppose).

So why isn't the name of this library "LibCustomCompassPins"?? What will happen if I rename the folder to start with "Lib" -- assuming, of course, that it doesn't. It would not be the first time that the online ESOUI name for an addon is not identical to the name of the folder in /Addons.

Some library developers apparently add a hyphen followed by a version number. For example, in the TESO /Addons folder I find: LibAddonMenu-2.0, LibFilters-2.0, LibFilters-3.0, LibMainMenu-2.0, and LibMediaProvider-1.0r10. I don't know whether that will ever cause problems, but, if and when it does, the developers will expect the players to resolve them, right?

Please understand that we are willing to follow rules, but it is perfectly reasonable to expect the developers to follow the same rules which they expect us to follow. Enough said, I hope.
__________________
---- Shadowshire ..... nil carborundum illegitimi
Report comment to moderator  
Reply With Quote
Unread 05/20/19, 07:21 PM  
Growlf1

Forum posts: 3
File comments: 46
Uploads: 0
Destinations don't works

Destinations needs CustomCompassPins to work. I installed it via Minion, but ingame the file is furtherly declared as missed.
So Destinations don't works.

BTW: after typing ##IsLibrary: true everywhere in the .txt file Destinations has all depencies in white in character menu, but not ingame!
Last edited by Growlf1 : 05/20/19 at 07:32 PM.
Report comment to moderator  
Reply With Quote
Unread 05/20/19, 01:06 PM  
Marazota
AddOn Author - Click to view AddOns

Forum posts: 232
File comments: 1405
Uploads: 2
Originally Posted by Baertram
You should add the new tag ##IsLibrary: true to the txt file as well so the ingame addon manager recognizes it as library.

And somehow this lib is not found on Minion! Maybe change the category.
i just installed it by minion
Report comment to moderator  
Reply With Quote
Unread 05/20/19, 11:42 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 3718
File comments: 4534
Uploads: 68
You should add the new tag ##IsLibrary: true to the txt file as well so the ingame addon manager recognizes it as library.

And somehow this lib is not found on Minion! Maybe change the category.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: