bank tags: use item name string indexof from script

This allows additional plugins to use the bankSearchFilter event to
selectively add or remove matches, as the bank tag plugin is no longer
performing the string contains check.
This commit is contained in:
Adam
2019-09-16 14:08:40 -04:00
committed by Adam
parent 7172e77f98
commit 4d63ce7334
2 changed files with 11 additions and 19 deletions

View File

@@ -169,10 +169,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
switch (eventName)
{
case "bankTagsActive":
// tell the script the bank tag plugin is active
intStack[intStackSize - 1] = 1;
break;
case "setSearchBankInputText":
stringStack[stringStackSize - 1] = SEARCH_BANK_INPUT_TEXT;
break;
@@ -184,7 +180,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
}
case "bankSearchFilter":
int itemId = intStack[intStackSize - 1];
String itemName = stringStack[stringStackSize - 2];
String search = stringStack[stringStackSize - 1];
boolean tagSearch = search.startsWith(TAG_SEARCH);
@@ -198,9 +193,9 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
// return true
intStack[intStackSize - 2] = 1;
}
else if (!tagSearch)
else if (tagSearch)
{
intStack[intStackSize - 2] = itemName.contains(search) ? 1 : 0;
intStack[intStackSize - 2] = 0;
}
break;
case "getSearchingTagTab":