I don't have much time & I am leaving for thanksgiving soon and will be gone for a week. I didn't find anything else wrong, but if all else fails...this may or may not be a better way to do it, just giving options.
I know this is not what your asking, but you could just filter the items yourself, eliminating libFitlers. I haven't used itemSaver or Advanced Filters so this may or may not cover everything you need to do in your addons.
Creating filters is not very hard, it can be done with 1 function & 1 line of code to change the filter. This is how the game does its filtering, I did it in an addon. The only problem I see is that since Advanced Filters is using libFilter & you would not be, Advanced filters might not filter your stuff correctly...but that could easily be solved. I wrote my own filter library (um never released it though wasn't really designed to track stuff for other addons also, maybe I will change that and release it when I get back next week).
Anyhow if your interested or for anyone else reading this creating filters is pretty easy. All you have to do is create a tabFilter & put it into the inventories tabFilter table, then call that inventories ChangeFilter(tabData) passing in your tabFitler....thats it.
Note: this has some extra code you would not need since you do not need a physical button...but advanced filters would so although some of this code (namely all of the parameters) are not used, I left some of the code from my addon in there to give everyone ideas on what you could do with it.
Warning: Spoiler
Lua Code:
-- callback function (for a button press, but were just going to call it manually) to handle the tab switch
-- this is what changes what you see...filters the inventory
local function HandleTabSwitch(tabData)
PLAYER_INVENTORY:ChangeFilter(tabData)
end
-- just a local table to hold my filters, because when you want to change the filter you need access
-- to the tabFilter you created so we need to store it somewhere.
local tTabFilters = {}
-- you don't need these parameters thats what I used in an addon...but i left them there to give an
-- example of how you could call this to create different tabs.
-- normal, presesed, highlight, is for if you add a physical button
-- hidden columns is to hide things like sell price armor value exc..
-- tooltip is to display a tooltip when they hoover over a button
-- but were not adding a physical button so we really dont need them here.
local function CreateNewTabFilterData(filterType, inventoryType, normal, pressed, highlight, hiddenColumns, sToolTip)
-- don't need these thats what I used in my addon
-- local isHiddenTab = type(filterType) == "function"
--local filterString = isHiddenTab and "" or sToolTip
-- you dont want a button so its always hidden, always true
local isHiddenTab = true -- meaning there is no tab button in the inventory window
local filterType = ITEMFILTERTYPE_ARMOR -- put whatever filter number you want visible
-- this is the actual tab filter data were creating
local tabData =
{
-- Custom data
filterType = filterType, -- This is for armor, check /zgoo on an item, dataEntry, data, filterData
inventoryType = INVENTORY_BANK, -- pass in a parameter to set your inventory
hiddenColumns = {}, -- what columns you want hidden
-- activeTabText is the text you see in the inventory like "ALL" when you press the all button
activeTabText = "Hidden text", -- not visible, but something needs to be here
-- tooltip is the tooltip text you see when you hoover your mouse over the button tab
tooltip = "", -- we dont have a physcial button so we dont need it
-- Menu bar data
hidden = isHiddenTab, -- is the tab (button) hidden
descriptor = filterType, -- same as filterType
normal = "", -- normal button texture, but we dont want a button
pressed = "", -- pressed button texture, but we dont want a button
highlight = "", -- highlight texture, but we dont want a button
callback = HandleTabSwitch, -- Callback function to handle the tabSwitch when the button is pressed you dont really need this, just call the ChangeFilter on your own
}
-- insert the tabFilter into the corresponding inventory tabFilters table
table.insert(PLAYER_INVENTORY.inventories[INVENTORY_BANK].tabFilters, tabData)
-- store the tabFilter in our local table so we can access it to call ChangeFilter()
table.insert(tTabFilters, tabData)
end
-- call the function to create your filterTab, pass in whatever parameters you decide you need
CreateNewTabFilterData()
-- grab the tab filter & call your function for handling the tab switch
HandleTabSwitch(tTabFilters[1])
The default, built in, filterTypes that you can call are:
Lua Code:
ITEMFILTERTYPE_ALL
ITEMFILTERTYPE_WEAPONS
ITEMFILTERTYPE_ARMOR
ITEMFILTERTYPE_CONSUMABLE
ITEMFILTERTYPE_CRAFTING
ITEMFILTERTYPE_MISCELLANEOUS
ITEMFILTERTYPE_JUNK
If you want to create your own filters to only display certain items all you have to do now is add a UNIQUE filter number to the items filterData table (found in /zgoo the item, goto dataEntry, data, filterData).
So say you create your own filterType:
Lua Code:
local ITEMFILTERTYPE_FCOLOCKED = 137 -- whatever unique number
Then just place that number in the locked items filterData table, create a filterTab out of it, put the filterTab into the inventories tabFilters table, then when your ready call this (passing in your tabData filter)
Lua Code:
PLAYER_INVENTORY:ChangeFilter(tabData)
You could create your own buttons to change the filters, add buttons to the inventory menu bar to do it, or hook the inventory menu bar buttons to change what they actualy show, whatever...
You would just have to handle the slotUpdate to handle when items are moved, sold, destroyed, looted, exc..to update its filterData values.
Oh and on initializing loop putting the filterData values into the tables too so they are there when the player logs in or /reloadui.
P.S. do be aware that bank inventory slots are not populated until the user opens the bank so you could not insert filterData until its populated..although you can do this to fix that problem:
Lua Code:
PLAYER_INVENTORY:RefreshAllInventorySlots(iInventory)
Will refresh the slots, use it on the bank for example then the items (slots) will become available even before the user opens the bank.
So when you originally populate the slots on load you could do something like this:
Lua Code:
local tSlots = PLAYER_INVENTORY.inventories[iInventory].slots
if not tSlot then
PLAYER_INVENTORY:RefreshAllInventorySlots(iInventory)
tSlots = PLAYER_INVENTORY.inventories[iInventory].slots
end