darfink / ItemAutocomplete

Chat autocomplete for item links in WoW Classic
https://curseforge.com/wow/addons/itemautocomplete
MIT License
4 stars 5 forks source link

fix: Support TBC classic #3

Closed Nessworthy closed 3 years ago

Nessworthy commented 3 years ago

Commit contains changes required for this addon to work with TBC classic's addon API changes

darfink commented 3 years ago

That's awesome! I've stopped playing WoW: Classic since I released this plugin, but I still have a soft spot for it.

As of now, I don't have the ability to test these changes. Is there any possibility you are able to confirm whether these are all changes required to ensure the plugin is TBC compatible?

I'd happily merge the PR in its current state, but I've left some input.

Nessworthy commented 3 years ago

Your addon page shows there's a settings window somewhere, how would I go about toggling this? I think that's the last thing remaining, although there is a bit of a search slowdown due to all the new items.

Thanks for the plugin by the way, really neat!

darfink commented 3 years ago

From my understanding, TBC: Classic and Vanilla Classic will remain as two separate environments, each having their own community of plugins. Correct me if I'm wrong, but if that is the case, is a toggle required? Shouldn't the TBC & vanilla implementations be their own separate plugin versions? Or were you referring to a toggle for something else? I'd assume, for example, that changing the Interface version would render this plugin out of date on a vanilla client?

Regarding the slowdown, and as you described, must have impaired the search significantly. It's almost twice the amount of items to filter. Sadly, I've already tried to optimize the search implementation, but traditional computer science have not seen to be applicable with Lua. I'd guess its due to it being such a high-level language, or at least I haven't achieved any performance improvements by using data structures optimal for the task. With that said, there are definitely optimizations available with some black magic and Lua expertise.

If you are able, you could try increasing the itemsSearchedPerUpdate constant to 2000. This might introduce slight stuttering when searching for items in-game, but at least the search results will be provided twice as fast. It might be worth the trade-off.

I'm glad you appreciate it! I was inspired by fzf and its fantastic fuzzy search, which made me much more productive in the shell, and I couldn't help wonder how awesome such a fuzzy search would be in WoW 🙂

darfink commented 3 years ago

Thanks a ton for the pull request, I'll try to make the final touch ups myself. If you are able to tell whether the ID 12270 should be replaced with something else, please do tell.

Nessworthy commented 3 years ago

Should be 122270!