doadin / Baggins

zlib License
6 stars 7 forks source link

Rewrite equipment set item filter #123

Closed Elberet closed 3 months ago

Elberet commented 3 months ago

This should hopefully solve #119.

The rewrite removes most event handling and the use of the GetContainerItemEquipmentSetInfo API and instead relies on caching equipment set item data for all versions of WoW. The cache is updated on the first call to Matches on each frame, since relying on events introduced a race condition, where the main Baggins event handler would call the filter's matcher before the filter's event handler could update the cache. This new approach should not be any less efficient and might even avoid irrelevant updates.

Additionally, changing the filter's options - selected sets, any set - now refreshes the cache in all situations.

Elberet commented 3 months ago

@doadin: take parts of this, or take it all, or merge the PR. You're welcome either way. :)