bank tags: invoke only the scrollbar update after removing separators

Invoking the tab separator removal allowed tab separators to be visible
and interactable for a frame. On slower computers, users could click and
navigate to a tab during that period. The removal no longer needs to be
invoked after e4b43d9 so we can just invoke the script run.
This commit is contained in:
trimbe
2020-08-24 16:35:15 -04:00
committed by GitHub
parent fb47850686
commit 7c01e44628

View File

@@ -505,9 +505,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
return; return;
} }
// allow time for the tab interface to become active
clientThread.invokeLater(() ->
{
if (!tabInterface.isActive()) if (!tabInterface.isActive())
{ {
return; return;
@@ -563,11 +560,12 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
int adjustedScrollHeight = (items / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING + ITEM_VERTICAL_SPACING; int adjustedScrollHeight = (items / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING + ITEM_VERTICAL_SPACING;
itemContainer.setScrollHeight(Math.max(adjustedScrollHeight, itemContainerHeight)); itemContainer.setScrollHeight(Math.max(adjustedScrollHeight, itemContainerHeight));
clientThread.invokeLater(() ->
client.runScript(ScriptID.UPDATE_SCROLLBAR, client.runScript(ScriptID.UPDATE_SCROLLBAR,
WidgetInfo.BANK_SCROLLBAR.getId(), WidgetInfo.BANK_SCROLLBAR.getId(),
WidgetInfo.BANK_ITEM_CONTAINER.getId(), WidgetInfo.BANK_ITEM_CONTAINER.getId(),
0); 0));
});
} }
@Subscribe @Subscribe