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:29,103
Total downloads:2,665,128
Favorites:1,911
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 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 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 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 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: 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/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/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, 01:06 PM  
Marazota
AddOn Author - Click to view AddOns

Forum posts: 257
File comments: 1519
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: 4963
File comments: 6032
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 10/23/18, 06:06 PM  
Marazota
AddOn Author - Click to view AddOns

Forum posts: 257
File comments: 1519
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 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 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 09/01/15, 08:45 PM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 832
File comments: 1097
Uploads: 33
Re: Error, IC

Originally Posted by Sinful Soul
Skyshard, Lorebooks, Destinations, and every addon that uses this one is bugged because of this add-on now

When dying in IC I get this:


EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:40: attempt to index a nil value
stack traceback:
EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:40: in function 'ZO_WorldMapFilterPanel_Shared:GetPinFilter'
EsoUI/Ingame/Map/Keyboard/WorldMapFilters_Keyboard.lua:83: in function 'WorldMapFilterPanel:LoadInitialState'
EsoUI/Ingame/Map/Keyboard/WorldMapFilters_Keyboard.lua:19: in function 'WorldMapFilterPanel:SetMapMode'
EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:118: in function 'OnMapChanged'
EsoUI/Libraries/Utility/ZO_CallbackObject.lua:111: in function 'ZO_CallbackObject:FireCallbacks'
user:/AddOns/Destinations/Libs/CustomCompassPins/CustomCompassPins.lua:94: in function 'callback'
EsoUI/Libraries/Utility/ZO_CallbackObject.lua:111: in function 'ZO_CallbackObject:FireCallbacks'
EsoUI/Libraries/ZO_Scene/ZO_Scene.lua:248: in function 'ZO_Scene:SetState'
EsoUI/Libraries/ZO_Scene/ZO_SceneManager.lua:183: in function 'ZO_SceneManager:HideScene'
EsoUI/Libraries/ZO_Scene/ZO_SceneManager.lua:238: in function 'ZO_Sc

The same "user:/AddOns/" bit shows for Skyshards, Lorebooks and so on.
Actually this is not error caused by CustomCompassPins library, it is caused by some addon which wants to access worldmap pin filters.

For example any addon with old version LibMapPins can show this error when you're on Imperial City map. You can try to install the latest version of LibMapPins as a stand alone addon, or update LibMapPins in addons which were not updated yet (like Lost Treasure, PublicDungeonChampions, CraftingStations etc.).
Report comment to moderator  
Reply With Quote
Unread 09/01/15, 05:31 PM  
Sinful Soul

Forum posts: 1
File comments: 176
Uploads: 0
Error, IC

Skyshard, Lorebooks, Destinations, and every addon that uses this one is bugged because of this add-on now

When dying in IC I get this:


EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:40: attempt to index a nil value
stack traceback:
EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:40: in function 'ZO_WorldMapFilterPanel_Shared:GetPinFilter'
EsoUI/Ingame/Map/Keyboard/WorldMapFilters_Keyboard.lua:83: in function 'WorldMapFilterPanel:LoadInitialState'
EsoUI/Ingame/Map/Keyboard/WorldMapFilters_Keyboard.lua:19: in function 'WorldMapFilterPanel:SetMapMode'
EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:118: in function 'OnMapChanged'
EsoUI/Libraries/Utility/ZO_CallbackObject.lua:111: in function 'ZO_CallbackObject:FireCallbacks'
user:/AddOns/Destinations/Libs/CustomCompassPins/CustomCompassPins.lua:94: in function 'callback'
EsoUI/Libraries/Utility/ZO_CallbackObject.lua:111: in function 'ZO_CallbackObject:FireCallbacks'
EsoUI/Libraries/ZO_Scene/ZO_Scene.lua:248: in function 'ZO_Scene:SetState'
EsoUI/Libraries/ZO_Scene/ZO_SceneManager.lua:183: in function 'ZO_SceneManager:HideScene'
EsoUI/Libraries/ZO_Scene/ZO_SceneManager.lua:238: in function 'ZO_Sc

The same "user:/AddOns/" bit shows for Skyshards, Lorebooks and so on.
Report comment to moderator  
Reply With Quote
Unread 05/01/15, 04:29 PM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1019
File comments: 1531
Uploads: 31
I had this error tonight, I coulnd't say if it's CompassPin or Core UI :

Lua Code:
  1. 2015-05-01T22:10:00.290+01:00 |cff0000Lua Error: EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:40: attempt to index a nil value
  2. stack traceback:
  3.     EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:40: in function 'ZO_WorldMapFilterPanel_Shared:GetPinFilter'
  4.     EsoUI/Ingame/Map/WorldMapFilters.lua:83: in function 'WorldMapFilterPanel:LoadInitialState'
  5.     EsoUI/Ingame/Map/WorldMapFilters.lua:19: in function 'WorldMapFilterPanel:SetMapMode'
  6.     EsoUI/Ingame/Map/WorldMapFilters_Shared.lua:111: in function 'OnMapChanged'
  7.     EsoUI/Libraries/Utility/ZO_CallbackObject.lua:104: in function 'ZO_CallbackObject:FireCallbacks'
  8.     user:/AddOns/SkyShards/Libs/CustomCompassPins/CustomCompassPins.lua:94: in function 'callback'
  9.     EsoUI/Libraries/Utility/ZO_CallbackObject.lua:104: in function 'ZO_CallbackObject:FireCallbacks'
  10.     EsoUI/Libraries/ZO_Scene/ZO_Scene.lua:248: in function 'ZO_Scene:SetState'
  11.     EsoUI/Libraries/ZO_Scene/ZO_SceneManager.lua:160: in function 'ZO_SceneManager:HideScene'
  12.     EsoUI/Libraries/ZO_Scene/ZO_SceneManager.lua:224: in function 'ZO_SceneManager:Show'|r

To reproduce :

- Go in Cyrodiil, in a locked campaign
- Die in Cyro
- Crash game
- Relog, you'll be tp near the wayshrine of your last location
- Try to display map, I think I dezoomed (changed map with right click), the error happends twice (I reloadUI, same issue).

I've also filled a bug to ZOS, because with this scenario, I cannot rez. The only possible rez is in Cyrodiil Keeps, and because I'm in the "Pve world" , i cannot do it. (Here I 'am on Malabal Tor, a friend rezzed me, that was the only solution).


Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: