Destinations custom pin problem
I guess I have been staring at this problem for too long as I can't see the problem. Hope some here can help :)
I am trying to add a custom pin for unknown wayshrines with a nearby guild trader using this code: Lua Code:
Lua Code:
What am I doing wrong? |
It seems that this will work only for the first item in the data table. No matter if condition is true or false, in both cases is called "break" to end the for loop.
If I understand correctly, you want special icons for undiscovered wayshrines that are somewhere on your list. 1) If you are using different pin type for selected wayshrines, you will need to modify CreateMapPins function - check if POI is wayshrine (if poiTypeId == 1 then) and then check if wayshrine is on your list and then select correct pin type the new pin. 2) If you are using the same pin type but you want different texture, you will need change pin layout - instead of texture path use function(pin) which returns texture path. To this function add check if that wayshrine is on your list and then return icon which you want to use. As I can see in Destinations, you are changing pin texture using the LMP:SetLayoutKey(..). It works well if you want to change texture for all pins. But it can cause unexpected results if you are changing textures just for selected pins - for example pins can have wrong textures on minimap. I recommend using function in the pin layout or two different pin types. How function works is described in comments in LinMapPins-1.0.lua, or you can take a look to the LoreBooks code. |
Quote:
I think I have found a solution that works, although it still uses the SetLayoutKey(..) (at least for me). I am gonna do a bit more testing then I'll release it. |
All times are GMT -6. The time now is 07:43 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI