Download
(10 Kb)
Download
Updated: 01/17/24 10:28 AM
Compatibility:
Endless Archive (9.2.5)
Updated:01/17/24 10:28 AM
Created:06/04/14 06:19 PM
Monthly downloads:58,329
Total downloads:4,557,052
Favorites:1,858
MD5:
LibMapPins  Popular! (More than 5000 hits)
LibMapPins-1.0 is a library for custom map pins.

Two important Notes to mod authors

[1] No LibStub support!

Do not use LibStub to reference this library.
Code:
  local LMP = LibStub("LibMapPins-1.0")
Change code to the following
Code:
  local LMP = LibMapPins
[2] AUI support was removed in 2017 for Revision 17 by Sensi. Please remove all LibMapPin calls to AUI functions.

Previous LibMapPins code as of r17
Code:
function lib.AUI.DoesMinimapExist() end
function lib.AUI.IsMinimapEnabled() end
function lib.AUI.IsMinimapLoaded() end
function lib.AUI.AddCustomPinType() end
function lib.AUI.UpdateQueuedCustomPinTypes() end
function lib.AUI.SetQueuedCustomPinType() end
Typical example code from mods
Code:
    if LMP.AUI.IsMinimapEnabled() then
        zo_callLater(CreatePins, 50)
    else
        CreatePins()
    end
Change code to the following
Code:
    CreatePins()
How to install:
You may either embed the library in your addon and load the files from your addon manifest, or have the library installed like any other normal addon.

If you are depending on the library being installed separately and are not embedding it, then you must include this line in your addon manifest:
Code:
## DependsOn:  LibMapPins-1.0
How to use:
Add a reference to the library using:
Lua Code:
  1. local LMP = LibMapPins

Alternativly you may add a reference to the library from LibStub: (Not Recomended)
Lua Code:
  1. local LMP = LibStub("LibMapPins-1.0")

Arguments used by most of the functions:
Code:
pinType:       either pinTypeId or pinTypeString, you can use both
pinTypeString: unique string name of your choice (it will be used as a name
               for global variable)
pinTypeId:     unique number code for your pin type, return value from lib:AddPinType
               ( local pinTypeId = _G[pinTypeString] )
pinLayoutData: table which can contain the following keys:
   level =     number > 2, pins with higher level are drawn on the top of pins
               with lower level.
               Examples: Points of interest 50, quests 110, group members 130,
               wayshrine 140, player 160.
   texture =   string or function(pin). Function can return just one texture
               or overlay, pulse and glow textures.
   size =      texture will be resized to size*size, if not specified size is 20.
   tint  =     ZO_ColorDef object or function(pin) which returns this object.
               If defined, color of background texture is set to this color.
   grayscale = true/false, could be function(pin). If defined and not false,
               background texure will be converted to grayscale (http://en.wikipedia.org/wiki/Colorfulness)
   insetX =    size of transparent texture border, used to handle mouse clicks
   insetY =    dtto
   minSize =   if not specified, default value is 18
   minAreaSize = used for area pins
   showsPinAndArea = true/false
   isAnimated = true/false
Add custom pin type (group of pins):
Lua Code:
  1. lib:AddPinType(pinTypeString, pinTypeAddCallback, pinTypeOnResizeCallback, pinLayoutData, pinTooltipCreator)
  2. -- returns: pinTypeId
  3. --
  4. -- pinTypeString: string
  5. -- pinTypeAddCallback: function(pinManager), will be called every time when map
  6. --                is changed. It should create pins on the current map using the
  7. --                lib:CreatePin(...) function.
  8. -- pinTypeOnResizeCallback: (nilable) function(pinManager, mapWidth, mapHeight),
  9. --                is called when map is resized (zoomed).
  10. -- pinLayoutData:  (nilable) table, details above
  11. -- pinTooltipCreator: (nilable) etiher string to display or table with the
  12. --                following keys:
  13. --    creator =   function(pin) that creates tooltip - or I should say function
  14. --                that will be called when mouse is over the pin, it does not
  15. --                need to create tooltip.
  16. --    tooltip =   (nilable) tooltip mode,  number between 1 and 4. It is
  17. --                defined in WorldMap.lua as follows:
  18. --                local TOOLTIP_MODE = {
  19. --                   INFORMATION = 1,
  20. --                   KEEP = 2,
  21. --                   MAP_LOCATION = 3,
  22. --                   IMPERIAL_CITY = 4,
  23. --                }
  24. --    hasTooltip = (optional), function(pin) which returns true/false to
  25. --                enable/disable tooltip.
  26. --    gamepadCategory = (nilable) string
  27. --    gamepadCategoryId = (nilable) number, right now it uses one of:
  28. --                local GAMEPAD_PIN_ORDERS = {
  29. --                   DESTINATIONS = 10,
  30. --                   AVA_KEEP = 20,
  31. --                   AVA_OUTPOST = 21,
  32. --                   AVA_RESOURCE = 22,
  33. --                   AVA_GATE = 23,
  34. --                   AVA_ARTIFACT = 24,
  35. --                   AVA_IMPERIAL_CITY = 25,
  36. --                   AVA_FORWARD_CAMP = 26,
  37. --                   CRAFTING = 30,
  38. --                   QUESTS = 40,
  39. --                   PLAYERS = 50,
  40. --                }
  41. --    gamepadCategoryIcon = (nilable) texture path
  42. --    gamepadEntryName = (nilable) string
  43. --    gamepadSpacing = (nilable) boolean

Create single pin on the current map, primary use is from pinTypeAddCallback:
Lua Code:
  1. lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- pinTag:        can be anything, but I recommend using table or string with
  4. --                additional pin details. You can use it later in code.
  5. --                ( local pinTypeId, pinTag = pin:GetPinTypeAndTag() )
  6. --                Argument pinTag is used as an id for functions
  7. --                lib:RemoveCustomPin(...) and lib:FindCustomPin(...).
  8. -- locX, locY:    normalized position on the current map
  9. -- areaRadius:    (nilable)

Add filter checkboxes to the world map:
Lua Code:
  1. lib:AddPinFilter(pinType, pinCheckboxText, separate, savedVars, savedVarsPveKey, savedVarsPvpKey, savedVarsImperialPvpKey)
  2. -- Returns: pveCheckbox, pvpCheckbox
  3. -- (newly created checkbox controls for PvE and PvP context of the world map)
  4. --
  5. -- pinType:       pinTypeId or pinTypeString
  6. -- pinCheckboxText: (nilable), description displayed next to the checkbox, if nil
  7. --                pinCheckboxText = pinTypeString
  8. -- separate:      (nilable), if false or nil, checkboxes for PvE and PvP context
  9. --                will be linked together. If savedVars argument is nil, separate
  10. --                is ignored and checkboxes will be linked together.
  11. -- savedVars:     (nilable), table where you store filter settings
  12. -- savedVarsPveKey: (nilable), key in the savedVars table where you store filter
  13. --                state for PvE context. If savedVars table exists but this key
  14. --                is nil, state will be stored in savedVars[pinTypeString].
  15. -- savedVarsPvpKey: (nilable), key in the savedVars table where you store filter
  16. --                state for PvP context, used only if separate is true. If separate
  17. --                is true, savedVars exists but this argument is nil, state will
  18. --                be stored in savedVars[pinTypeString .. "_pvp"].
  19. -- savedVarsImperialPvpKey: (nilable), key in the savedVars table where you store
  20. --                filter state for Imperial City PvP context, used only if separate
  21. --                is true. If separate is true, savedVars exists but this argument
  22. --                is nil, state will be stored in savedVars[pinTypeString .. "_imperialPvP"].

Add click handlers for pins, if handler is nil, any existing handler will be removed.
Lua Code:
  1. lib:SetClickHandlers(pinType, LMB_handler, RMB_handler)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- LMB_handler:   hadler for left mouse button
  4. -- RMB_handler:   handler for right mouse button
  5. --
  6. -- handler = {
  7. --    {
  8. --       name = string or function(pin) end  --required
  9. --       callback = function(pin) end        --required
  10. --       show = function(pin) end, (optional) default is true. Callback function
  11. --                is called only when show returns true.
  12. --       duplicates = function(pin1, pin2) end, (optional) default is true.
  13. --                What happens when mouse lick hits more than one pin. If true,
  14. --                pins are considered to be duplicates and just one callback
  15. --                function is called.
  16. --       gamepadName = the same as name, but for gamepad
  17. --    },
  18. -- }
  19. -- One handler can have defined more actions, with different conditions in show
  20. -- function. First action with true result from show function will be used.
  21. -- handler = {
  22. --    {name = "name1", callback = callback1, show = show1},
  23. --    {name = "name2", callback = callback2, show = show2},
  24. --     ...
  25. -- }

Refresh pins. If pinType is nil, refreshes all custom pins:
Lua Code:
  1. lib:RefreshPins(pinType)
  2. -- pinType:       pinTypeId or pinTypeString

Check if pins are enabled:
Lua Code:
  1. lib:IsEnabled(pinType)
  2. -- returns: true/false
  3. --
  4. -- pinType:       pinTypeId or pinTypeString

Set enabled/disabled state of the given pinType and if exists, update filter checkbox on the world map:
Lua Code:
  1. lib:SetEnabled(pinType, state)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- state:         true/false, as false is considered nil, false or 0. All other
  4. --                values are true.

Enable pins of the given pinType:
Lua Code:
  1. lib:Enable(pinType)
  2. -- pinType:       pinTypeId or pinTypeString

Disable pins of the given pinType:
Lua Code:
  1. lib:Disable(pinType)
  2. -- pinType:       pinTypeId or pinTypeString

Find custom pin:
Lua Code:
  1. lib:FindCustomPin(pinType, pinTag)
  2. -- returns pin
  3. --
  4. -- pinType:       pinTypeId or pinTypeString
  5. -- pinTag:        id assigned to the pin by function lib:CreatePin(...)

Remove custom pin. If pinTag is nil, all pins of the given pinType are removed.
Lua Code:
  1. lib:RemoveCustomPin(pinType, pinTag)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- pinTag:        id assigned to the pin by function lib:CreatePin(...)


Change a single key in the pinLayoutData table:
Lua Code:
  1. lib:SetLayoutKey(pinType, key, data)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- key:           key name in pinLayoutData table
  4. -- data:          data to be stored in pinLayoutData[key]

Replace whole pinLayoutData table:
Lua Code:
  1. lib:SetLayoutData(pinType, pinLayoutData)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- pinLayoutData: table

Get a single key from the pinLayoutData table:
Lua Code:
  1. lib:GetLayoutKey(pinType, key)
  2. -- returns: pinLayoutData[key]
  3. --
  4. -- pinType:       pinTypeId or pinTypeString
  5. -- key:           key name in pinLayoutData table

Get a reference to the pinLayoutData table:
Lua Code:
  1. lib:GetLayoutData(pinType)
  2. -- returns: pinLayoutData
  3. --
  4. -- pinType:       pinTypeId or pinTypeString

Set new add callback:
Lua Code:
  1. lib:SetAddCallback(pinType, pinTypeAddCallback)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- pinTypeAddCallback: function(pinManager)

Set new OnResize callback:
Lua Code:
  1. lib:SetResizeCallback(pinType, pinTypeOnResizeCallback)
  2. -- pinType:       pinTypeId or pinTypeString
  3. -- pinTypeOnResizeCallback: function(pinManager, mapWidth, mapHeight)

Get zone and subzone derived from map texture:
Lua Code:
  1. lib:GetZoneAndSubzone(alternative, bStripUIMap, bKeepMapNum)
  2. -- You can select from 3 formats:
  3. -- 1: "zone", "subzone"                     (that's what I use in my addons)
  4. -- 2: "zone/subzone"                        (used by HarvestMap)
  5. -- If 2nd argument is nil or false, function returns first format
  6.  
  7. -- Additionally if the third argument bKeepMapNBum is true you will preserve
  8. -- the ending of the map texture.
  9. -- 3: "zone/subzone_0" or "zone", "subzone_0" (used by Destinations)

Example:
Lua Code:
  1. -- "Art/maps/skyrim/blackreach_base_0.dds",
  2. zone, subzone = LMP:GetZoneAndSubzone()
  3. -- returns skyrim, blackreach_base
  4.  
  5. -- "Art/maps/skyrim/blackreach_base_0.dds",
  6. zone, subzone = LMP:GetZoneAndSubzone(false, false, true)
  7. -- returns skyrim, blackreach_base_0
  8.  
  9. --"Art/maps/skyrim/blackreach_base_0.dds",
  10. texturename = LMP:GetZoneAndSubzone(true)
  11. -- returns skyrim/blackreach_base
  12.  
  13. -- "art/maps/murkmire/ui_map_tsofeercavern01_0.dds",
  14. texturename = LMP:GetZoneAndSubzone(true, true)
  15. -- returns murkmire/tsofeercavern01
  16.  
  17. -- "Art/maps/skyrim/blackreach_base_0.dds",
  18. texturename = LMP:GetZoneAndSubzone(true, false, true)
  19. -- returns skyrim/blackreach_base_0

Example of code is attached to the end of LibMapPins-1.0.lua or check code of SkyShards or LoreBooks.
r39

- API Bump

r38

- Pre PTS Version, API Bump

r37

- Pre PTS Version

r36

- Change to mod name in manifest file to address potential byte encoding issue for players using French Canadian OS and playing the game in English.

r35

- API Bump

r34

- Hotfix for lib variable

r33

- Removed LibStub support in accordance with other mods that have done the same such as LibAddonMenu, LibCustomMenu, and others.

r32

- API Bump
- Removed duplicate slash command
- Added check for use with LibStub

r31

- API Bump
- Address issue where Click Handlers require a specific attribute gamepadName (ZOSDanBaston)

r30

- API Bump

r29
- Add asserts when duplicate pin name used
- Add SetPinFilterHidden to hide pin filters for pve or pvp specific conetnt

r28
- Minor adjustment for mods using greyscale feature

r27 (Scootworks)
- Fix for texture name "/art/maps/guildmaps/eyevea_base_0.dds" being truncated to only "eyevea_base_0" rather then "guildmaps/eyevea_base_0"

r26 (Scootworks)
- Check for grey scale property prior to attempting to set it

r25 (Scootworks)
- Refactor code
- Removed all AUI dummy routines. They do nothing and support was removed in 2017.

r24 (Sharlikran)
- Revert to r22 because of regressions in r23

r23 (Scootworks)
- Refactor code

r22 (Scootworks)
- Add support for tool tips when using a gamepad

r21 (Scootworks, Sharlikran)
- Scootworks: Change the behavior of lib:MyPosition() for use with mods so it does not print a message to the chat window.
- Sharlikran: I do not feel lib:MyPosition() was intended to be used for this purpose as you can not provide the different arguments for GetZoneAndSubzone to produce the different map name formats.

r20 (Scootworks)
- Optimize GetZoneAndSubzone to reduce mysplit calls

r19 (Sharlikran)
- Update to GetZoneAndSubzone. No longer truncates map name in odd ways.
- Optional argument to preserve map ending such as blackreach_base_0 (Used with Destinations)
- Check Description for examples.

r18 (AM)
- removed libstub requirement (works with and without)
- added /lmppos and /lmploc
- added /mypos & /myloc if /mypos not defined
- changed /mypos to use 0.nnn decimal location co-ordinate system instead of nn.nnn

r17 (modified by Sensi)
- Removed AUI support. (It is no longer needed)

r16 (modified by Ayantir)
- Fixed tiny typo

r15 (modified by Ayantir)
- Added Battleground compatibility

r14 (modified by Sensi)
- fixed a memory leak in combination with AUI Minimap

r13 (modified by Sensi)
- updated for API to 100013 (Update 8 - Orsinium)
- add compatibility for "AUI Minimap" version 1.2
- the function "CreatePin" is only redirected when associated pin type is enabled

r12 (modified by Sensi)
- incorrect upload, do not use this version.

r11
- fixed compatibility issue with new version of AUI

r10
- updated for API to 100012 (Update 7 - Imperial City)
- updated LibStub to r4

r9
- another improvements for AUI compatibility (tanks for the code, Sensi)

r8
- fixed compatibility issue with AUI

r7
- updated for API to 100011 (Update 6)
- key "tooltip" in tooltip layout should now contain index number instead of tooltip control - Usually you will want to use number 1 for InformationTooltip.
- pinLayouData no longer supports key "color", it was replaced by "tint". Color was simple table with r,g,b,a values, tint is ZO_ColorDef object.

r6
- added scrollbox for world map filters

r5
- updated EMM minimap support for the latest beta EMM 0.9.9.3e

r4
- updated API version
- added support for beta version of EMM minimap (tested with EMM 0.9.9.3d)

r3
- updated API version
- updated LibStub to r2
- added ZOS disclosure

r2
- fixed bug in function lib:AddPinType()
- fixed a few typos in comments and in the sample code

r1
- initial release
Archived Files (39)
File Name
Version
Size
Uploader
Date
1.0 r38
10kB
Sharlikran
10/24/22 10:19 AM
1.0 r37
10kB
Sharlikran
07/31/22 09:06 AM
1.0 r36
10kB
Sharlikran
05/15/22 09:29 PM
1.0 r35
10kB
Sharlikran
04/18/22 10:55 AM
1.0 r34
10kB
Sharlikran
10/12/21 09:29 AM
1.0 r33
10kB
Sharlikran
10/10/21 09:11 PM
1.0 r32
10kB
Sharlikran
10/04/21 10:51 AM
1.0 r31
10kB
Sharlikran
05/28/21 04:21 PM
1.0 r30
10kB
Sharlikran
03/09/21 12:55 PM
1.0 r29
10kB
Sharlikran
06/23/20 09:18 AM
1.0 r28
9kB
Sharlikran
06/19/20 08:10 PM
1.0 r27
9kB
Sharlikran
06/15/20 11:05 PM
1.0 r26
9kB
Sharlikran
06/15/20 11:52 AM
1.0 r25
9kB
Sharlikran
06/14/20 09:51 AM
1.0 r24
10kB
Sharlikran
06/11/20 04:36 AM
1.0 r23
10kB
Sharlikran
06/10/20 10:41 AM
1.0 r22
10kB
Sharlikran
05/28/20 06:23 AM
1.0 r21
10kB
Sharlikran
05/19/20 11:01 PM
1.0 r20
9kB
Sharlikran
05/09/20 06:01 AM
1.0 r19
10kB
Sharlikran
05/08/20 01:29 PM
1.0 r18
9kB
AssemblerManiac
11/18/19 02:12 PM
1.0 r17
10kB
Sensi
06/10/17 09:14 PM
1.0 r17
10kB
Sensi
06/10/17 09:05 PM
1.0 r16
9kB
Ayantir
06/10/17 05:40 AM
1.0 r15
9kB
Ayantir
05/26/17 07:43 PM
1.0 r14
10kB
Sensi
01/29/16 08:09 AM
1.0 r13
10kB
Sensi
01/27/16 12:57 PM
1.0 r12
10kB
Sensi
01/26/16 03:41 PM
1.0 r11
10kB
Garkin
09/15/15 06:53 AM
1.0 r10
10kB
Garkin
08/31/15 09:00 AM
1.0 r9
10kB
Garkin
03/07/15 04:17 PM
1.0 r8
10kB
Garkin
03/05/15 11:45 AM
1.0 r7
10kB
Garkin
02/23/15 09:09 PM
1.0 r6
10kB
Garkin
10/31/14 10:34 AM
1.0 r5
9kB
Garkin
09/16/14 09:03 AM
1.0 r4
9kB
Garkin
09/16/14 08:24 AM
1.0 r3
8kB
Garkin
07/31/14 10:04 AM
1.0 r2
8kB
Garkin
06/13/14 06:04 PM
1.0 r1
8kB
Garkin
06/09/14 09:51 AM


Post A Reply Comment Options
Unread 10/10/21, 03:52 PM  
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view AddOns

Forum posts: 626
File comments: 2002
Uploads: 15
Because of the upcoming new DLC for Oblivion and because it's about time this was done anyway, LibStub support has been removed. You can read the LibStub description page yourself. It is obsolete and has been for some time.

All posts complaining about the change will be deleted because authors have known about the change for years.

If a mod you are using still relies on LibStub contact the author, uninstall the mod, or make the changes yourself.
Last edited by Sharlikran : 10/10/21 at 09:14 PM.
Report comment to moderator  
Reply With Quote
Unread 06/05/14, 02:40 AM  
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view AddOns

Forum posts: 89
File comments: 187
Uploads: 9
Just what I needed, thanks for putting it up !
Report comment to moderator  
Reply With Quote
Unread 02/23/15, 09:14 PM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 832
File comments: 1097
Uploads: 33
LibMapPins-1.0 r7

Even if patch 1.6 is not on live server yet, I have updated this library in advance.

Due to changes in WorldMap code, this version will work correctly only with Update 6, it doesn't work with Update 5.

All changes are documented in comments in library code, but the main changes are:
- key "tooltip" in tooltip layout should now contain index number instead of tooltip control - Usually you will want to use number 1 for InformationTooltip.
- pinLayouData no longer supports key "color", it was replaced by "tint". Color was simple table with r,g,b,a values, tint is ZO_ColorDef object (pinLayoutData.tint = ZO_ColorDef:New(r, g, b, a)).
Last edited by Garkin : 02/23/15 at 09:15 PM.
Report comment to moderator  
Reply With Quote
Unread 03/19/15, 09:38 AM  
Xerosigma

Forum posts: 0
File comments: 2
Uploads: 0
pinTypeId

Hey Garken,

Where can I find valid pinTypeId's? Are these the ones listed in the API?

Tried the following but didn't notice any pins being created.

Lua Code:
  1. --lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)
  2. lib:CreatePin(MAP_PIN_TYPE_KEEP_NEUTRAL, "tag", zoneX, zoneY, nil)

Thanks!
Report comment to moderator  
Reply With Quote
Unread 03/19/15, 10:00 AM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 832
File comments: 1097
Uploads: 33
Re: pinTypeId

Originally Posted by Xerosigma
Hey Garken,

Where can I find valid pinTypeId's? Are these the ones listed in the API?

Tried the following but didn't notice any pins being created.

Lua Code:
  1. --lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)
  2. lib:CreatePin(MAP_PIN_TYPE_KEEP_NEUTRAL, "tag", zoneX, zoneY, nil)

Thanks!
It depends if you are talking about custom pins or map pins defined in WorldMap. Because this library is for work with custom pins, it don't work correctly for map pins.

In your example is MAP_PIN_TYPE_KEEP_NEUTRAL, this is ID of WorldMap pin and list of this IDs is in the ESOUIDocumentationP6.txt documentation (attached to this topic).
Report comment to moderator  
Reply With Quote
Unread 03/19/15, 10:19 AM  
Xerosigma

Forum posts: 0
File comments: 2
Uploads: 0
Re: Re: pinTypeId

Originally Posted by Garkin
Originally Posted by Xerosigma
Hey Garken,

Where can I find valid pinTypeId's? Are these the ones listed in the API?

Tried the following but didn't notice any pins being created.

Lua Code:
  1. --lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)
  2. lib:CreatePin(MAP_PIN_TYPE_KEEP_NEUTRAL, "tag", zoneX, zoneY, nil)

Thanks!
It depends if you are talking about custom pins or map pins defined in WorldMap. Because this library is for work with custom pins, it don't work correctly for map pins.

In your example is MAP_PIN_TYPE_KEEP_NEUTRAL, this is ID of WorldMap pin and list of this IDs is in the ESOUIDocumentationP6.txt documentation (attached to this topic).
Okay, that explains my confusion then.

So from what I'm understanding I can create a custom PinType and Pin using your library and then use AddMapPin() (ZOS API) to set that pin?

Something like:

Lua Code:
  1. local MY_PIN = 1111
  2. lib:CreatePin(MY_PIN, "tag", zoneX, zoneY, nil)
  3. AddMapPin(MY_PIN,0,0,0)

Thanks!
Last edited by Xerosigma : 03/19/15 at 10:30 AM.
Report comment to moderator  
Reply With Quote
Unread 03/19/15, 10:36 AM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 832
File comments: 1097
Uploads: 33
Re: Re: Re: pinTypeId

Originally Posted by Xerosigma
Originally Posted by Garkin
Originally Posted by Xerosigma
Hey Garken,

Where can I find valid pinTypeId's? Are these the ones listed in the API?

Tried the following but didn't notice any pins being created.

Lua Code:
  1. --lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)
  2. lib:CreatePin(MAP_PIN_TYPE_KEEP_NEUTRAL, "tag", zoneX, zoneY, nil)

Thanks!
It depends if you are talking about custom pins or map pins defined in WorldMap. Because this library is for work with custom pins, it don't work correctly for map pins.

In your example is MAP_PIN_TYPE_KEEP_NEUTRAL, this is ID of WorldMap pin and list of this IDs is in the ESOUIDocumentationP6.txt documentation (attached to this topic).
Okay, that explains my confusion then.

So from what I'm understanding I can create a custom PinType and Pin using your library and then use AddMapPin() (ZOS API) to set that pin?

Something like:

Lua Code:
  1. local MY_PIN = 1111
  2. lib:CreatePin(MY_PIN, "tag", zoneX, zoneY, nil)
  3. AddMapPin(MY_PIN,0,0,0)

Thanks!
You should select some unique string identifier as a pin name, then call lib:AddPinType(...). It will create pinTypeId for you.

Lua Code:
  1. local LMP = LibStub("LibMapPins-1.0")
  2. local pinType = "My_unique_name"
  3.  
  4. local pinTypeId = LMP:AddPinType(pinType, pinTypeAddCallback, pinTypeOnResizeCallback, pinLayoutData, pinTooltipCreator)

Better example is attached to the end of LibMapPins-1.0.lua or you can take a look to the code of my SkyShards or LoreBooks.
Report comment to moderator  
Reply With Quote
Unread 05/15/15, 08:42 AM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1019
File comments: 1531
Uploads: 31
Hello Garkin, could you add the possibility to add map filters only in certain conditions ?
First should be pve or pvp, best should be the result of a function.

Per exemple, my addon only need it when i'm in trials and instances and I don't want to weight more the filters in other cases.

many thanks.
Report comment to moderator  
Reply With Quote
Unread 09/24/15, 12:39 AM  
svan

Forum posts: 0
File comments: 209
Uploads: 0
Hi Garkin can check my post here got weird bugs since r11.

I am testing right now but i am thinking AUI (using only minimap and buffs modules) is connected directly to those bugs.
Reported the link to AUI comments too.

http://www.esoui.com/downloads/filei...d=667#comments

Sorry for this post if the lib have nothing to do with those bugs

Cheers.

------------------------------------
Last edited by svan : 09/24/15 at 01:43 AM.
Report comment to moderator  
Reply With Quote
Unread 10/13/15, 10:20 PM  
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 129
File comments: 866
Uploads: 7
There is some sort of an issue with map being out of sync with an actual place your character is. This results in custom pins being dropped for the wrong map. I am investigating for the possible solution.
Report comment to moderator  
Reply With Quote
Unread 10/31/15, 09:57 AM  
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 53
File comments: 177
Uploads: 23
Pins not resetting

I have the same problem, often the pins aren't reset (e.g. when moving in a new map).

Here's an example:

dungeon map

zone map

world map

I've also seen it happen for Skyshards, and probably happens for other add-ons too. I don't know since when that happens (probably since a library update). The currently loaded version is 1.0r11.

I haven't seen it happen for my add-on Quest Map yet. I had to use this code since r11, which might or might not be related:

diff Code:
  1. -- This code is inside of the pinTypeAddCallback function
  2. +if LMP:IsEnabled(MY_CUSTOM_PIN_TYPE) then
  3.     LMP:CreatePin(MY_CUSTOM_PIN_TYPE, pinInfo, x, y)
  4. +end
Last edited by CaptainBlagbird : 10/31/15 at 10:00 AM.
Report comment to moderator  
Reply With Quote
Unread 02/10/16, 07:36 AM  
Kyoma
AddOn Author - Click to view AddOns

Forum posts: 125
File comments: 328
Uploads: 10
I have a question/request. Is it possible to display the filter checkbox only when in pvp and/or imperial city? Looking at the code it seems it always creates the checkboxes for pve/pvp/imperialPvp. Should I just hide them manually?
Report comment to moderator  
Reply With Quote
Unread 05/22/16, 10:24 AM  
Shinni
AddOn Author - Click to view AddOns

Forum posts: 167
File comments: 550
Uploads: 22
When i try to delete a single pin via lib:RemoveCustomPin(pinType, pinTag) it deletes all pins of the given type on the AUI minimap.
This should be fixable by calling AUI.Minimap.Pin.RemovePins instead of AUI.Minimap.Pin.RemoveCustomPinsByType in line 489.
Report comment to moderator  
Reply With Quote
Unread 05/29/16, 01:41 AM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1019
File comments: 1531
Uploads: 31
I'll have a look, Sensi looks away.
But I'm clearly not fan at all of all the AUI things in LibMapPin.

For me, it's AUI's job to be compliant with a library, not a library which need to be compliant with an addon.
That's how code works.

So I'll wait first to see if AUI will be updated for DB (because Sensi is also AUI author).
Last edited by Ayantir : 05/29/16 at 01:41 AM.
Report comment to moderator  
Reply With Quote
Unread 05/27/17, 06:04 AM  
Anceane
 
Anceane's Avatar
AddOn Author - Click to view AddOns

Forum posts: 306
File comments: 1017
Uploads: 1
word mistyped ? (meant WORD not world in my title)

WORLD_MAP_FILTERS.imeperialPvPPanel.comboBoxPool.parent

may be a imperial ?

Not sur but seems you corrected the world but left at the same time another *e*

If normal then dont mind me
Last edited by Anceane : 05/27/17 at 06:14 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: