ge plugin: disable fuzzy search if search event is consumed

This allows other plugins which replace the search results, such as the bank
tags plugin, to not get overwritten by the fuzzy search.
This commit is contained in:
Adam
2022-01-04 18:37:50 -05:00
parent 409a4ab4e9
commit ce56056e2f

View File

@@ -623,14 +623,19 @@ public class GrandExchangePlugin extends Plugin
}
}
@Subscribe
@Subscribe(
// run after the bank tags plugin, and potentially anything
// else which wants to consume the event and override
// the search behavior
priority = -100
)
public void onGrandExchangeSearched(GrandExchangeSearched event)
{
wasFuzzySearch = false;
GrandExchangeSearchMode searchMode = config.geSearchMode();
final String input = client.getVar(VarClientStr.INPUT_TEXT);
if (searchMode == GrandExchangeSearchMode.DEFAULT || input.isEmpty())
if (searchMode == GrandExchangeSearchMode.DEFAULT || input.isEmpty() || event.isConsumed())
{
return;
}