View Single Post
11/25/14, 01:39 PM   #24
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Baertram View Post
The callback function for the filters (bags, bank) is FilterSavedItems(), which is called for each item in the invemtory and then calls the function getSettingsIsFilterOn() for each of the 4 possible filter icons. This is why it is called so often.
This function only checks if the "split filters for each panel" (inventory, bank, guild bank, trading, crafting, mails, etc.) setting is enabled or not, and if the relating filter is activated or not.
The information if the filter panel is activated and the item is marked with an icon is needed for each item to hide/show it.
one other thing I thought of is that you should check to see if code is necessary to run or not before running it....this may be wrong, I have to leave soon, I don't have time to go back and look it up. but you said the getSettingsIsFilterOn() decides if something should be shown/hidden. and its looping through all the slots being called from wherever. I remember there was that CreateMarkerControl() something loop where it was firing tons of times as well and it looked like it was calling unecessary code to resize, anchor, change color, drawTier, exc...

At the very least, even if I was mistaken and all of that ControlMarker code is necessary...its defanitely not necessary if the control isn't visible. It does not matter what color, size, drawTier, anchor, exc...until it gets shown so visibility should be checked, and then if visible, setup the control in createmarker control.
Although I'm still believing that code shouldn't be in the callback.
  Reply With Quote