TabInterface: remember search when clicking withdraw-x
This commit is contained in:
@@ -130,6 +130,8 @@ public class TabInterface
|
|||||||
private int currentTabIndex;
|
private int currentTabIndex;
|
||||||
private TagTab iconToSet = null;
|
private TagTab iconToSet = null;
|
||||||
private Instant startScroll = Instant.now();
|
private Instant startScroll = Instant.now();
|
||||||
|
private String rememberedSearch;
|
||||||
|
private boolean waitSearchTick;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private Widget upButton;
|
private Widget upButton;
|
||||||
@@ -384,6 +386,8 @@ public class TabInterface
|
|||||||
currentTabIndex = 0;
|
currentTabIndex = 0;
|
||||||
maxTabs = 0;
|
maxTabs = 0;
|
||||||
parent = null;
|
parent = null;
|
||||||
|
waitSearchTick = false;
|
||||||
|
rememberedSearch = "";
|
||||||
|
|
||||||
if (upButton != null)
|
if (upButton != null)
|
||||||
{
|
{
|
||||||
@@ -400,6 +404,8 @@ public class TabInterface
|
|||||||
if (isHidden())
|
if (isHidden())
|
||||||
{
|
{
|
||||||
parent = null;
|
parent = null;
|
||||||
|
waitSearchTick = false;
|
||||||
|
rememberedSearch = "";
|
||||||
|
|
||||||
// If bank window was just hidden, update last active tab position
|
// If bank window was just hidden, update last active tab position
|
||||||
if (currentTabIndex != config.position())
|
if (currentTabIndex != config.position())
|
||||||
@@ -464,6 +470,20 @@ public class TabInterface
|
|||||||
activateTab(null);
|
activateTab(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!waitSearchTick
|
||||||
|
&& activeTab == null
|
||||||
|
&& !Strings.isNullOrEmpty(rememberedSearch)
|
||||||
|
&& client.getVar(VarClientInt.INPUT_TYPE) == InputType.NONE.getType())
|
||||||
|
{
|
||||||
|
bankSearch.reset(true);
|
||||||
|
bankSearch.search(InputType.NONE, rememberedSearch, true);
|
||||||
|
rememberedSearch = "";
|
||||||
|
}
|
||||||
|
else if (waitSearchTick)
|
||||||
|
{
|
||||||
|
waitSearchTick = false;
|
||||||
|
}
|
||||||
|
|
||||||
updateBounds();
|
updateBounds();
|
||||||
scrollTab(0);
|
scrollTab(0);
|
||||||
}
|
}
|
||||||
@@ -544,6 +564,15 @@ public class TabInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId()
|
||||||
|
&& event.getMenuAction() == MenuAction.EXAMINE_ITEM_BANK_EQ
|
||||||
|
&& event.getMenuOption().equalsIgnoreCase("withdraw-x"))
|
||||||
|
{
|
||||||
|
waitSearchTick = true;
|
||||||
|
rememberedSearch = client.getVar(VarClientStr.INPUT_TEXT);
|
||||||
|
bankSearch.search(InputType.NONE, rememberedSearch, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (iconToSet != null)
|
if (iconToSet != null)
|
||||||
{
|
{
|
||||||
if (event.getMenuOption().startsWith(CHANGE_ICON + " ("))
|
if (event.getMenuOption().startsWith(CHANGE_ICON + " ("))
|
||||||
|
|||||||
Reference in New Issue
Block a user