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:30,187
Total downloads:2,676,361
Favorites:1,918
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 03/26/16, 01:55 PM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1019
File comments: 1531
Uploads: 31
Maybe LibStub this library and remove the COMPASS_PINS from the _G table but returns the object for next version ?

It will require few addons to slightly rewrite the code, but won't break old ones.
Report comment to moderator  
Reply With Quote
Unread 04/10/16, 05:38 PM  
Wandamey
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Hi Shinni,

I found out that one of the test you make to know if the map has changed : around line 95 :

Lua Code:
  1. if newState == SCENE_HIDING then
  2.     if(SetMapToPlayerLocation() == SET_MAP_RESULT_MAP_CHANGED) then
  3.         CALLBACK_MANAGER:FireCallbacks("OnWorldMapChanged")
  4.     end
  5. end

SetMapToPlayerLocation() that simple call screws the conditional of fading/animated framents on this scene (and the next one), forcing the use of a delay to "almost" get the expected result. (fragment still appear where they dont belong at startup etc... yourself commented about that in true exploration)

I think there was a change around IC release, and at that point true exploration using this same test every seconds screwed the map refresh a lot too. Remember when there was a lot of issues in september? Since then, all authors using this Library (and potentially other libs using this the same way) have delayed their functions and now it's almost an invisible issue. I'm sorry to ask, but i've tried with this part commented and saw only a fair amount of improvements with my addons/maps refreshes and 0 drawback, could you just get rid of this part? it seems completely unnecessary.

I have no prove that this is the root of the problem or just a link in the chain, but what i'm sure of it's that i've lost my headache when i commented it. Now i can use my animated fragments and see them behave exactly how i expected them to behave. So, if you wanna check this, it'd be cool.

Thanks in advance.
Last edited by : 04/10/16 at 05:38 PM.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 10/23/18, 06:06 PM  
Marazota
AddOn Author - Click to view AddOns

Forum posts: 260
File comments: 1521
Uploads: 2
hey please rename addon and add Lib to the begining, so when searching in minion by Lib keyword we will able to find it
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: 4991
File comments: 6046
Uploads: 78
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
Unread 05/20/19, 01:06 PM  
Marazota
AddOn Author - Click to view AddOns

Forum posts: 260
File comments: 1521
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, 07:21 PM  
Growlf1

Forum posts: 3
File comments: 50
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, 11:26 PM  
Shadowshire

Forum posts: 1
File comments: 402
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.
Report comment to moderator  
Reply With Quote
Unread 05/26/19, 10:17 AM  
Growlf1

Forum posts: 3
File comments: 50
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/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 06/11/19, 06:46 AM  
Gandalf
 
Gandalf's Avatar
AddOn Author - Click to view AddOns

Forum posts: 28
File comments: 105
Uploads: 1
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 12/24/19, 11:46 AM  
Shrinkwrap

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

Can we get a Dragon update please? Thank you
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)?
Report comment to moderator  
Reply With Quote
Unread 05/29/20, 12:08 AM  
Lenox

Forum posts: 15
File comments: 29
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.
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 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
Post A Reply



Category Jump: