Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -477,6 +477,32 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
|
|||||||
Widget bankTitle = client.getWidget(WidgetInfo.BANK_TITLE_BAR);
|
Widget bankTitle = client.getWidget(WidgetInfo.BANK_TITLE_BAR);
|
||||||
bankTitle.setText("Tag tab <col=ff0000>" + activeTab.getTag() + "</col>");
|
bankTitle.setText("Tag tab <col=ff0000>" + activeTab.getTag() + "</col>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recompute scroll size. Only required for tag tab tab and with remove separators, to remove the
|
||||||
|
// space that the separators took.
|
||||||
|
if (tabInterface.isTagTabActive() || (tabInterface.isActive() && config.removeSeparators()))
|
||||||
|
{
|
||||||
|
Widget itemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
|
||||||
|
Widget[] children = itemContainer.getChildren();
|
||||||
|
int items = 0;
|
||||||
|
for (Widget child : children)
|
||||||
|
{
|
||||||
|
if (child != null && child.getItemId() != -1 && !child.isHidden())
|
||||||
|
{
|
||||||
|
++items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// New scroll height for if_setscrollsize
|
||||||
|
final int adjustedScrollHeight = (Math.max(0, items - 1) / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING +
|
||||||
|
ITEM_VERTICAL_SPACING + ITEM_CONTAINER_BOTTOM_PADDING;
|
||||||
|
|
||||||
|
// This is prior to bankmain_finishbuilding running, so the arguments are still on the stack. Overwrite
|
||||||
|
// argument int12 (7 from the end) which is the height passed to if_setscrollsize
|
||||||
|
final int[] intStack = client.getIntStack();
|
||||||
|
final int intStackSize = client.getIntStackSize();
|
||||||
|
intStack[intStackSize - 7] = adjustedScrollHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (scriptId == ScriptID.BANKMAIN_SEARCH_TOGGLE)
|
else if (scriptId == ScriptID.BANKMAIN_SEARCH_TOGGLE)
|
||||||
{
|
{
|
||||||
@@ -510,15 +536,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tabInterface.isTagTabActive())
|
|
||||||
{
|
|
||||||
int numTabs = (int) Arrays.stream(itemContainer.getDynamicChildren())
|
|
||||||
.filter(child -> child.getItemId() != -1 && !child.isHidden())
|
|
||||||
.count();
|
|
||||||
updateBankContainerScrollHeight(numTabs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tabInterface.isActive() || !config.removeSeparators())
|
if (!tabInterface.isActive() || !config.removeSeparators())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -540,14 +557,9 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
|
|||||||
int adjYOffset = (items / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING;
|
int adjYOffset = (items / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING;
|
||||||
int adjXOffset = (items % ITEMS_PER_ROW) * ITEM_HORIZONTAL_SPACING + ITEM_ROW_START;
|
int adjXOffset = (items % ITEMS_PER_ROW) * ITEM_HORIZONTAL_SPACING + ITEM_ROW_START;
|
||||||
|
|
||||||
if (child.getOriginalY() != adjYOffset)
|
if (child.getOriginalY() != adjYOffset || child.getOriginalX() != adjXOffset)
|
||||||
{
|
{
|
||||||
child.setOriginalY(adjYOffset);
|
child.setOriginalY(adjYOffset);
|
||||||
child.revalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (child.getOriginalX() != adjXOffset)
|
|
||||||
{
|
|
||||||
child.setOriginalX(adjXOffset);
|
child.setOriginalX(adjXOffset);
|
||||||
child.revalidate();
|
child.revalidate();
|
||||||
}
|
}
|
||||||
@@ -562,23 +574,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
|
|||||||
child.setHidden(true);
|
child.setHidden(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateBankContainerScrollHeight(items);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateBankContainerScrollHeight(int items)
|
|
||||||
{
|
|
||||||
Widget bankItemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
|
|
||||||
int itemContainerHeight = bankItemContainer.getHeight();
|
|
||||||
final int adjustedScrollHeight = (Math.max(0, items - 1) / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING + ITEM_VERTICAL_SPACING + ITEM_CONTAINER_BOTTOM_PADDING;
|
|
||||||
bankItemContainer.setScrollHeight(Math.max(adjustedScrollHeight, itemContainerHeight));
|
|
||||||
|
|
||||||
final int itemContainerScroll = bankItemContainer.getScrollY();
|
|
||||||
clientThread.invokeLater(() ->
|
|
||||||
client.runScript(ScriptID.UPDATE_SCROLLBAR,
|
|
||||||
WidgetInfo.BANK_SCROLLBAR.getId(),
|
|
||||||
WidgetInfo.BANK_ITEM_CONTAINER.getId(),
|
|
||||||
itemContainerScroll));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ public class TabInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
chatboxPanelManager.openTextInput((inventory ? "Inventory " : "Equipment ") + " tags:")
|
chatboxPanelManager.openTextInput((inventory ? "Inventory" : "Equipment") + " tags:")
|
||||||
.addCharValidator(FILTERED_CHARS)
|
.addCharValidator(FILTERED_CHARS)
|
||||||
.onDone((Consumer<String>) (newTags) ->
|
.onDone((Consumer<String>) (newTags) ->
|
||||||
clientThread.invoke(() ->
|
clientThread.invoke(() ->
|
||||||
@@ -573,7 +573,7 @@ public class TabInterface
|
|||||||
|
|
||||||
switch (eventName)
|
switch (eventName)
|
||||||
{
|
{
|
||||||
case "setBankScroll":
|
case "skipBankLayout":
|
||||||
if (!isTabMenuActive())
|
if (!isTabMenuActive())
|
||||||
{
|
{
|
||||||
setTabMenuVisible(false);
|
setTabMenuVisible(false);
|
||||||
@@ -582,11 +582,8 @@ public class TabInterface
|
|||||||
|
|
||||||
setTabMenuVisible(true);
|
setTabMenuVisible(true);
|
||||||
|
|
||||||
// scroll height
|
|
||||||
intStack[intStackSize - 3] = (((tabManager.getTabs().size() - 1) / BANK_ITEMS_PER_ROW) + 1) * (BANK_ITEM_HEIGHT + BANK_ITEM_Y_PADDING);
|
|
||||||
|
|
||||||
// skip normal bank layout
|
// skip normal bank layout
|
||||||
intStack[intStackSize - 2] = 1;
|
intStack[intStackSize - 1] = 1;
|
||||||
break;
|
break;
|
||||||
case "beforeBankLayout":
|
case "beforeBankLayout":
|
||||||
setTabMenuVisible(false);
|
setTabMenuVisible(false);
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
private static final Duration DESPAWN_TIME_DROP = Duration.ofMinutes(3);
|
private static final Duration DESPAWN_TIME_DROP = Duration.ofMinutes(3);
|
||||||
private static final Duration DESPAWN_TIME_TABLE = Duration.ofMinutes(10);
|
private static final Duration DESPAWN_TIME_TABLE = Duration.ofMinutes(10);
|
||||||
private static final int KRAKEN_REGION = 9116;
|
private static final int KRAKEN_REGION = 9116;
|
||||||
|
private static final int CLAN_HALL_REGION = 6997;
|
||||||
private static final int KBD_NMZ_REGION = 9033;
|
private static final int KBD_NMZ_REGION = 9033;
|
||||||
private static final int ZILYANA_REGION = 11602;
|
private static final int ZILYANA_REGION = 11602;
|
||||||
private static final int GRAARDOR_REGION = 11347;
|
private static final int GRAARDOR_REGION = 11347;
|
||||||
@@ -456,7 +457,8 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
else if (playerRegionID == ZILYANA_REGION || playerRegionID == GRAARDOR_REGION ||
|
else if (playerRegionID == ZILYANA_REGION || playerRegionID == GRAARDOR_REGION ||
|
||||||
playerRegionID == KRIL_TSUTSAROTH_REGION || playerRegionID == KREEARRA_REGION ||
|
playerRegionID == KRIL_TSUTSAROTH_REGION || playerRegionID == KREEARRA_REGION ||
|
||||||
playerRegionID == NIGHTMARE_REGION || playerRegionID == TEMPOROSS_REGION)
|
playerRegionID == NIGHTMARE_REGION || playerRegionID == TEMPOROSS_REGION ||
|
||||||
|
playerRegionID == CLAN_HALL_REGION)
|
||||||
{
|
{
|
||||||
// GWD, Nightmare, and Tempoross instances use the normal despawn timers
|
// GWD, Nightmare, and Tempoross instances use the normal despawn timers
|
||||||
despawnTime = spawnTime.plus(groundItem.getLootType() == LootType.DROPPED
|
despawnTime = spawnTime.plus(groundItem.getLootType() == LootType.DROPPED
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.id 279
|
.id 279 ; [proc,bankmain_filteritem]
|
||||||
.int_stack_count 1
|
.int_stack_count 1
|
||||||
.string_stack_count 0
|
.string_stack_count 0
|
||||||
.int_var_count 2 ; +1 for storage of search filter result
|
.int_var_count 2 ; +1 for storage of search filter result
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.id 277
|
.id 277 ; [proc,bankmain_build]
|
||||||
.int_stack_count 17
|
.int_stack_count 17
|
||||||
.string_stack_count 0
|
.string_stack_count 0
|
||||||
.int_var_count 36
|
.int_var_count 36
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
; Fired before the bank starts its layout
|
; Fired before the bank starts its layout
|
||||||
; Used by the TabInterface to hide fake bank items for tag tabs
|
; Used by the TabInterface to hide fake bank items for tag tabs
|
||||||
;
|
;
|
||||||
; callback "setBankScroll"
|
; callback "skipBankLayout"
|
||||||
; Fired before bank is calculated
|
; Fired before bank is built
|
||||||
; Used by the TabInterface to show fake bank items for tag tabs
|
; Used by the TabInterface to show fake bank items for tag tabs
|
||||||
sconst "beforeBankLayout"
|
sconst "beforeBankLayout"
|
||||||
runelite_callback
|
runelite_callback
|
||||||
@@ -403,13 +403,11 @@ LABEL348:
|
|||||||
sub
|
sub
|
||||||
istore 30
|
istore 30
|
||||||
LABEL352:
|
LABEL352:
|
||||||
iconst 0 ; Scroll height variable
|
|
||||||
iconst 0 ; Compare variable
|
iconst 0 ; Compare variable
|
||||||
iconst 0 ;
|
iconst 0 ;
|
||||||
sconst "setBankScroll" ; Show fake bank items for tag tabs
|
sconst "skipBankLayout" ; Show fake bank items for tag tabs
|
||||||
runelite_callback ; If tag tab menu search isn't active
|
runelite_callback ; If tag tab menu search isn't active
|
||||||
if_icmpeq CONTINUE_SEARCH ; continue to normal bank search
|
if_icmpeq CONTINUE_SEARCH ; continue to normal bank search
|
||||||
istore 27 ; Load scroll height into variable
|
|
||||||
jump GetTabRange ; Skip normal bank layout
|
jump GetTabRange ; Skip normal bank layout
|
||||||
CONTINUE_SEARCH:
|
CONTINUE_SEARCH:
|
||||||
iload 31
|
iload 31
|
||||||
@@ -842,7 +840,7 @@ LABEL729:
|
|||||||
iload 14
|
iload 14
|
||||||
iload 15
|
iload 15
|
||||||
iload 16
|
iload 16
|
||||||
invoke 505
|
invoke 505 ; [proc,bankmain_finishbuilding]
|
||||||
return
|
return
|
||||||
LABEL750:
|
LABEL750:
|
||||||
invoke 514
|
invoke 514
|
||||||
|
|||||||
Reference in New Issue
Block a user