From 73e3e40bc70e4a45d8f1a5f1e6811f1772e4888a Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 8 Nov 2024 21:09:32 -0500 Subject: [PATCH] bank tags: add items to the end of layouts --- .../client/plugins/banktags/tabs/Layout.java | 12 ++++++++++++ .../client/plugins/banktags/tabs/LayoutManager.java | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/Layout.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/Layout.java index 1ac4778e730..98912df77f2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/Layout.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/Layout.java @@ -197,4 +197,16 @@ public void resize(int size) } layout = n; } + + int lastItemIndex() + { + for (int i = layout.length - 1; i >= 0; --i) + { + if (layout[i] != -1) + { + return i; + } + } + return -1; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/LayoutManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/LayoutManager.java index 5afe3a3dd12..08f2ecdfb4b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/LayoutManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/LayoutManager.java @@ -300,7 +300,7 @@ private void layout(Layout l) } int layoutItemId = itemManager.canonicalize(itemId); - l.addItem(layoutItemId); + l.addItemAfter(layoutItemId, l.lastItemIndex()); modified = true; }