Thread Tools Display Modes
12/21/14, 08:34 AM   #1
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Map filter check?

Is there no event for map filter toggle in the API?
I can't find one...

I am asking as I use a bunch of custom pins in one of my addons, and instead of adding a PinFilter for every single one, then I would like to combine some of them under a SINGLE filter.
  Reply With Quote
12/21/14, 08:57 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by SnowmanDK View Post
Is there no event for map filter toggle in the API?
I can't find one...

I am asking as I use a bunch of custom pins in one of my addons, and instead of adding a PinFilter for every single one, then I would like to combine some of them under a SINGLE filter.
There is no such event.

If I'm not mistaken, you are adding filters using the LinMapPins library, so take a look how it works - functions lib:AddPinFilter(...), lib:SetEnabled(...) and lib.OnMapChanged() in LibMapPins-1.0.lua.
I'm not really confident that it really works as it should be working. If you find any bugs, let me know.
  Reply With Quote
12/21/14, 09:10 AM   #3
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by Garkin View Post
There is no such event.

If I'm not mistaken, you are adding filters using the LinMapPins library, so take a look how it works - functions lib:AddPinFilter(...), lib:SetEnabled(...) and lib.OnMapChanged() in LibMapPins-1.0.lua.
I'm not really confident that it really works as it should be working. If you find any bugs, let me know.
Well I have been trying to use lib:SetEnabled(...) and libisable(...) to force pins to deactivate, but they don't react to me clicking the filter.

Sounds to me like I have to make a mess of the filters list to make it possible to toggle all the pins I use.
I was just hoping I could avoid that as I think it would clutter up the filters list

I don't want to make a timed check to see if every filter is on or off, as I know it would be VERY bad for performance.
  Reply With Quote
12/21/14, 09:13 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
LibMapPins creates one filter per pinType (category). So if you don't want to create filters by yourself, just merge more pins to one pinType. If you want different textures for each pin of the same pinType, in layout use function which will return correct texture. I have done the same in LoreBooks.
  Reply With Quote
12/21/14, 10:18 AM   #5
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by Garkin View Post
LibMapPins creates one filter per pinType (category). So if you don't want to create filters by yourself, just merge more pins to one pinType. If you want different textures for each pin of the same pinType, in layout use function which will return correct texture. I have done the same in LoreBooks.
Earlier I did something like this:
Lua Code:
  1. local TYPE = pinData[ACHDataIndex.TYPE]
  2.         if TYPE == 20 then
  3.             pinType = PINS_AYLEID
  4.         elseif TYPE == 21 then
  5.             pinType = PINS_WWVAMP
  6.         end
  7.         LMP:CreatePin(pinType, {OtherTypeName}, pinData[ACHDataIndex.X], pinData[ACHDataIndex.Y])
But that caused issues with things like zrMiniMap.

I'll snoop around in your code
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Map filter check?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off