LibFilters ... And those fire in expected order in both cases...
|
Yeah as I got the exact same problems like you and have added code to delay the LibFilters fragment callback/or whatver control's OnShow OnHide events I use there, by 1 frame via zo_callLater(function() end, 0) so that the events fire before the fragments callbacks properly...
And this differs from panel/event/fragment to others, and input type (gamepad, keyboard), and usage (keybind, mouse click, etc.).
Took me weeks of testng and fine tuning.
You can use the callbacks of LibFilters if you use the lib. They should fire in the correct order and were added recently to allow addons to just register their code as the callbacks fire, like register your filters and update the inventory of the currently shown panel, unregister older/other anel filters, add your controls to the UI etc.
-> Except: universal deconstruction is not supported yet, working on it some day.
afaik if you press the I to open the inventory it always fires the fragments faster and somehow events like bank, vendor, guild store, close are run later.
Same if you register to the mail keyboard fragment and switch from there to I. Even worse if last opened panel at inventory was the CraftBag! Then you switch from mail -> craftbag directly where some inventory standard funcs do not run and everything is troubled. Even more complex if addons like CraftBag Extended are enabled which provide CraftBag at the mail panel -> press I -> Inventory/ or craftbag (depends what was selecte last there).
And there are multiple other combinations which I was sick of and thus added the callbacks to LibFilters 3.
Allthough I'm not using them everywhere as my LibFilters dependend addons run and work fine like they are (never change a running system :-)) you can use the callback for new addons.
You can test them via the integrated test.xml and test.lua files, you need to uncomment the 2x ## in fro of them in the LibFilters-3.0.txt file and then the test UI is available via /lftestfilters like explained at the LibFilters 3 WIKI at Github.