Filter API
addon.filters
each filter stores everything about itself in this table
addon.filters[FILTER]:AddItem(link, index)
feeds items into the filter so it knows about them
addon.filters[FILTER]:ClearAll()
removes all item info from the filter (is called at merchant close)
addon.filters[FILTER]:isFilterd(link, index)
checks to see if the current item should be displayed or filtered out
addon.filters[FILTER]:ResetFilter()
resets the filter to show all items again (is also called at merchant close)
addon.filters[FILTER]:GetDropdown()
called when the dropdown is opened. here each filter can register its options to the dropdown
addon.filters[FILTER]:isRelevant()
is called when the dropdown is opened needs to return true if the filter wants to appear on the dropdown. Should return false if the filter will only filter all or nothing, otherwise should return true
addon.filters[FILTER]:ShowAll()
this is called when the user wants to see everything so it needs to turn of all filtering
addon.filters[FILTER]:FilterAll()
this does the inverse of ShowAll everything should now be filtered out
addon:FilterUpdate()
gets called by the filter to let the addon know it needs to update its display
Comments