View Single Post
11/23/14, 06:07 PM   #4
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Baertram View Post
I hoped so @interesting
Thx man! I hope it is not any small bug or typo which causes this issue...
Every help is very appreciated!

Even small findings can improve the overall performance
If I understand you right:
If any of the registered filters for the current filterType (e.g. LAF_BANK) returns false the other filters shouldn't be executed/needed anymore, because the item will be hidden.
So one could abort the for ... do loop already in between?

Edit:
I've added a chat output in libFilters function SetInventoryFilter() to see which filters are registered upon loading of the game (Advanced filters & FCOItemSaver enabled) and when you click on FCOItemSaver filter button or any button in your inventory (weapons, armory, materials, etc.).
I also added a counter variable to libfilters which increases by 1 in the function SetInventoryFilter() at this line:
Code:
if(v) then
                	cnt = cnt + 1

Upon loading of the game (checked via Bugeater addon to see extra chat output before addons are loaded finally) I have a list of 24518 times filter "AdvancedFilters_Dropdown_Filter". This looks a bit much for me?


Same if you click on one of the AdvancedFilters buttons, e.g. the "Weapons". The filter list will explode with another 51 entries adding the filter "AdvancedFilters_Button_Filter".

If I click through the other Advanced Filters tabs the dropdown filter will be added (if I choose only "Bows" for example).

After clicking around the filter counter increased to 33492 in total.
Only changing from quest items to junk view added 884 new entries...

Maybe your fix about the "false" filter results will fix a bit of these, but aren't these numbers too high in total? Or am I missing something why this values are that high? Is the function SetInventoryFilter() executed for every item in the bags and that multiple times? I thought it is only for the bags and only if a filter is registered (upon change of a given filter).
I wrote something just like advanced filters but I didnt do any of the filtering like libFilters does. I'm trying to figure it all out. I do see one thing so far though:
Lua Code:
  1. -- in libfilters.lua
  2. -- this should be local
  3. filters = libFilters.filters
  Reply With Quote