Cidan / BetterBags

A total replacement AddOn for World of Warcraft bag frames, inspired by AdiBags.
MIT License
89 stars 38 forks source link

Add support for a global function, BetterBagsSearch() #584

Open Protuhj opened 2 months ago

Protuhj commented 2 months ago

Addon Version

v0.1.96

World of Warcraft Version

Retail

Describe the bug

Using the WoW API call C_Container.SetItemSearch("search string") BB doesn't filter.

This worked in AdiBags, and should work in BB too. It also works with the default bag.

Steps to reproduce

  1. Open the bag
  2. Run the command in chat: /run C_Container.SetItemSearch("soulbound") soulbound items should be highlighted.
Cidan commented 2 months ago

Thanks for the report.

Since we have our own comprehensive search engine, there is no way that I know of to get the parameter passed into SetItemSearch cleanly. The Blizzard event does not return the actual search term, unfortunately. If I discover a way to do this, I'll get it done, but it does seem unlikely right now. I'll ask around to make sure.

Protuhj commented 2 months ago

I'd say supporting this is kinda fundamental to being a bag replacement addon.

Cidan commented 2 months ago

It's fundamentally impossible to support with custom search -- Blizzard does not expose a way to do it.

How about another custom function, like BetterBagsSearch("your string") as a global?

Protuhj commented 2 months ago

A global would work.

Cidan commented 2 months ago

Awesome, I'll add that in soon as I need to do some other work around this anyway :)

juntereiner commented 2 months ago

It looks like only adibags use the default search. I've tested it with arkinventory, sorted, baganator, bagnon and none works with /run C_Container.SetItemSearch("soulbound").

Cidan commented 2 months ago

It looks like only adibags use the default search. I've tested it with arkinventory, sorted, baganator, bagnon and none works with /run C_Container.SetItemSearch("soulbound").

Yeah that's right. Anything that implements any sort of improvement to the search engine will bypass the built in search constructs, as Blizzard doesn't allow for any sort of modification to their search logic.