From f3319df4a15098eb8017a118c641f51f0ae98503 Mon Sep 17 00:00:00 2001 From: trimbe Date: Thu, 1 Aug 2019 10:36:29 -0400 Subject: [PATCH 01/13] gpu plugin: fix camera effects used for drunkeness and fishing trawler Yaw and pitch for these effects is only altered during scene drawing, so we need to cache those values at that point. --- .../java/net/runelite/client/plugins/gpu/GpuPlugin.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index 7909a09333..a53fa913be 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -207,6 +207,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks private int centerX; private int centerY; + private int yaw; + private int pitch; // Uniforms private int uniUseFog; @@ -719,6 +721,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks { centerX = client.getCenterX(); centerY = client.getCenterY(); + yaw = client.getCameraYaw(); + pitch = client.getCameraPitch(); final Scene scene = client.getScene(); final int drawDistance = Math.max(0, Math.min(MAX_DISTANCE, config.drawDistance())); @@ -911,8 +915,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, uniformBufferId); uniformBuffer.clear(); uniformBuffer - .put(client.getCameraYaw()) - .put(client.getCameraPitch()) + .put(yaw) + .put(pitch) .put(centerX) .put(centerY) .put(client.getScale()) From 480b4ad77304ea069af85b4384b5736993c3fb38 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sat, 3 Aug 2019 02:25:42 +0200 Subject: [PATCH 02/13] Snapshot all grahics2d properties in safeRender This prevents overlay graphics configurations leaking to other overlays. Signed-off-by: Tomas Slusny --- .../client/ui/overlay/OverlayRenderer.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java index a3dcd552f1..dc794066d1 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java @@ -27,10 +27,14 @@ package net.runelite.client.ui.overlay; import com.google.common.base.MoreObjects; import com.google.common.primitives.Ints; import java.awt.Color; +import java.awt.Composite; import java.awt.Dimension; import java.awt.Graphics2D; +import java.awt.Paint; import java.awt.Point; import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Stroke; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.geom.AffineTransform; @@ -462,11 +466,15 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener graphics.setFont(runeLiteConfig.interfaceFontType().getFont()); } - // Reset the default color - graphics.setColor(Color.WHITE); + // Save graphics2d properties so we can restore them later + final AffineTransform transform = graphics.getTransform(); + final Stroke stroke = graphics.getStroke(); + final Composite composite = graphics.getComposite(); + final Paint paint = graphics.getPaint(); + final Color color = graphics.getColor(); + final RenderingHints renderingHints = graphics.getRenderingHints(); + final Color background = graphics.getBackground(); - // Get transform so we can reset it after drawing - AffineTransform transform = graphics.getTransform(); graphics.translate(point.x, point.y); final Dimension overlayDimension; @@ -481,7 +489,14 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener } finally { + // Restore graphics2d properties graphics.setTransform(transform); + graphics.setStroke(stroke); + graphics.setComposite(composite); + graphics.setPaint(paint); + graphics.setColor(color); + graphics.setRenderingHints(renderingHints); + graphics.setBackground(background); } final Dimension dimension = MoreObjects.firstNonNull(overlayDimension, new Dimension()); From eb2d1d72597dc31bc0e5227853328ae306f2e64b Mon Sep 17 00:00:00 2001 From: David Date: Sat, 3 Aug 2019 14:24:51 +0100 Subject: [PATCH 03/13] skill calc: Add Dragon bolts (#9552) --- .../client/plugins/skillcalculator/skill_fletching.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json index 5a6f05161d..7da4e7236c 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json @@ -510,6 +510,12 @@ "name": "Amethyst Arrow", "xp": 13.5 }, + { + "level": 84, + "icon": 21930, + "name": "Dragon Bolts", + "xp": 12 + }, { "level": 84, "icon": 21318, From 4b239d26006efabbc8d2d380cd44f3713a9f5743 Mon Sep 17 00:00:00 2001 From: tortuga69 <37732477+tortuga69@users.noreply.github.com> Date: Sat, 3 Aug 2019 06:28:31 -0700 Subject: [PATCH 04/13] grandexchange: Add Forthos Dungeon item buy limits (#9540) --- .../runelite/client/plugins/grandexchange/ge_limits.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json b/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json index c9d3e2b098..2aa2e9a867 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json @@ -3459,5 +3459,10 @@ "22622": 10, "22634": 100, "22636": 100, - "22647": 10 -} \ No newline at end of file + "22647": 10, + "23499": 11000, + "23517": 100, + "23522": 70, + "23525": 4, + "23528": 70 +} From 715c7a26b903016f6dce0d7fe6bef9448051a615 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 3 Aug 2019 10:11:08 -0400 Subject: [PATCH 05/13] slayer plugin: validate !task name and location --- .../client/plugins/slayer/SlayerPlugin.java | 3 +- .../runelite/client/plugins/slayer/Task.java | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java index 8204846ffe..7215821734 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java @@ -770,7 +770,8 @@ public class SlayerPlugin extends Plugin } if (TASK_STRING_VALIDATION.matcher(task.getTask()).find() || task.getTask().length() > TASK_STRING_MAX_LENGTH || - TASK_STRING_VALIDATION.matcher(task.getLocation()).find() || task.getLocation().length() > TASK_STRING_MAX_LENGTH) + TASK_STRING_VALIDATION.matcher(task.getLocation()).find() || task.getLocation().length() > TASK_STRING_MAX_LENGTH || + Task.getTask(task.getTask()) == null || !Task.LOCATIONS.contains(task.getLocation())) { log.debug("Validation failed for task name or location: {}", task); return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java index 654150ebda..716711af23 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java @@ -26,7 +26,9 @@ package net.runelite.client.plugins.slayer; import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; import lombok.Getter; @@ -176,6 +178,48 @@ enum Task // private static final Map tasks; + static final List LOCATIONS = ImmutableList.of( + "", // no location is a valid location + "Abyss", + "Ancient Cavern", + "Asgarnian Ice Dungeon", + "Brimhaven Dungeon", + "Brine Rat Cavern", + "Catacombs of Kourend", + "Chasm of Fire", + "Clan Wars", + "Death Plateau", + "Evil Chicken's Lair", + "Fossil Island", + "Fremennik Slayer Dungeon", + "God Wars Dungeon", + "Iorwerth Dungeon", + "Kalphite Lair", + "Karuulm Slayer Dungeon", + "Keldagrim", + "Kraken Cove", + "Lighthouse", + "Lithkren Vault", + "Lizardman Canyon", + "Lizardman Settlement", + "Molch", + "Mount Quidamortem", + "Mourner Tunnels", + "Ogre Enclave", + "Slayer Tower", + "Smoke Devil Dungeon", + "Smoke Dungeon", + "Stronghold of Security", + "Stronghold Slayer Dungeon", + "task-only Kalphite Cave", + "Taverley Dungeon", + "Troll Stronghold", + "Waterbirth Island", + "Waterfall Dungeon", + "Wilderness", + "Witchaven Dungeon", + "Zanaris" + ); private final String name; private final int itemSpriteId; From e0442fc03ade7ccadf1075b3eae5ae5ea301a5dd Mon Sep 17 00:00:00 2001 From: Gustavo Rodrigues Date: Sat, 3 Aug 2019 21:57:52 -0300 Subject: [PATCH 06/13] hunter: Add support for ferrets (#9524) --- .../net/runelite/client/plugins/hunter/HunterPlugin.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hunter/HunterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/hunter/HunterPlugin.java index 1d7c876386..6b9a79cbdb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hunter/HunterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hunter/HunterPlugin.java @@ -189,6 +189,7 @@ public class HunterPlugin extends Plugin case ObjectID.SHAKING_BOX: // Black chinchompa caught case ObjectID.SHAKING_BOX_9382: // Grey chinchompa caught case ObjectID.SHAKING_BOX_9383: // Red chinchompa caught + case ObjectID.SHAKING_BOX_9384: // Ferret caught case ObjectID.BOULDER_20648: // Prickly kebbit caught case ObjectID.BOULDER_20649: // Sabre-tooth kebbit caught case ObjectID.BOULDER_20650: // Barb-tailed kebbit caught @@ -259,6 +260,11 @@ public class HunterPlugin extends Plugin case ObjectID.BOX_TRAP_9387: case ObjectID.BOX_TRAP_9388: + // Ferret shaking box + case ObjectID.BOX_TRAP_9394: + case ObjectID.BOX_TRAP_9396: + case ObjectID.BOX_TRAP_9397: + // Bird traps case ObjectID.BIRD_SNARE_9346: case ObjectID.BIRD_SNARE_9347: From 08fed6dba1771a6ac86dcd99d3964e1be8601d7d Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 3 Aug 2019 21:34:28 -0400 Subject: [PATCH 07/13] slayer plugin: fix task lookup test --- .../net/runelite/client/plugins/slayer/SlayerPluginTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java index a10ecaced0..f2007e7393 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java @@ -596,8 +596,8 @@ public class SlayerPluginTest public void testTaskLookup() throws IOException { net.runelite.http.api.chat.Task task = new net.runelite.http.api.chat.Task(); - task.setTask("task"); - task.setLocation("loc"); + task.setTask("Abyssal demons"); + task.setLocation("Abyss"); task.setAmount(42); task.setInitialAmount(42); From 502c7b6379604b3f9e31352229097b35832410cc Mon Sep 17 00:00:00 2001 From: xdesr <49791189+xdesr@users.noreply.github.com> Date: Mon, 5 Aug 2019 12:46:41 +0100 Subject: [PATCH 08/13] item stats: add divine potions --- .../runelite/client/plugins/itemstats/ItemStatChanges.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java index 57b9d9f135..5644414c70 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java @@ -136,6 +136,12 @@ public class ItemStatChanges add(boost(MAGIC, perc(.15, 5)), SUPER_MAGIC_POTION_1, SUPER_MAGIC_POTION_2, SUPER_MAGIC_POTION_3, SUPER_MAGIC_POTION_4); add(combo(2, boost(RANGED, perc(0.1, 4)), boost(DEFENCE, perc(0.15, 5))), BASTION_POTION1, BASTION_POTION2, BASTION_POTION3, BASTION_POTION4); add(combo(2, boost(MAGIC, 4), boost(DEFENCE, perc(0.15, 5))), BATTLEMAGE_POTION1, BATTLEMAGE_POTION2, BATTLEMAGE_POTION3, BATTLEMAGE_POTION4); + add(combo(boost(MAGIC, 4), heal(HITPOINTS, -10)), DIVINE_MAGIC_POTION1, DIVINE_MAGIC_POTION2, DIVINE_MAGIC_POTION3, DIVINE_MAGIC_POTION4); + add(combo(boost(RANGED, perc(.10, 4)), heal(HITPOINTS, -10)), DIVINE_RANGING_POTION1, DIVINE_RANGING_POTION2, DIVINE_RANGING_POTION3, DIVINE_RANGING_POTION4); + add(combo(boost(ATTACK, perc(.15, 5)), heal(HITPOINTS, -10)), DIVINE_SUPER_ATTACK_POTION1, DIVINE_SUPER_ATTACK_POTION2, DIVINE_SUPER_ATTACK_POTION3, DIVINE_SUPER_ATTACK_POTION4); + add(combo(boost(STRENGTH, perc(.15, 5)), heal(HITPOINTS, -10)), DIVINE_SUPER_STRENGTH_POTION1, DIVINE_SUPER_STRENGTH_POTION2, DIVINE_SUPER_STRENGTH_POTION3, DIVINE_SUPER_STRENGTH_POTION4); + add(combo(boost(DEFENCE, perc(.15, 5)), heal(HITPOINTS, -10)), DIVINE_SUPER_DEFENCE_POTION1, DIVINE_SUPER_DEFENCE_POTION2, DIVINE_SUPER_DEFENCE_POTION3, DIVINE_SUPER_DEFENCE_POTION4); + add(combo(3, boost(ATTACK, perc(.15, 5)), boost(STRENGTH, perc(.15, 5)), boost(DEFENCE, perc(.15, 5)), heal(HITPOINTS, -10)), DIVINE_SUPER_COMBAT_POTION1, DIVINE_SUPER_COMBAT_POTION2, DIVINE_SUPER_COMBAT_POTION3, DIVINE_SUPER_COMBAT_POTION4); // Regular overload (NMZ) add(combo(5, boost(ATTACK, perc(.15, 5)), boost(STRENGTH, perc(.15, 5)), boost(DEFENCE, perc(.15, 5)), boost(RANGED, perc(.15, 5)), boost(MAGIC, perc(.15, 5)), heal(HITPOINTS, -50)), OVERLOAD_1, OVERLOAD_2, OVERLOAD_3, OVERLOAD_4); From 1082b1b86337cdeb100a1095608b6e67ebd753b1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 6 Aug 2019 08:42:14 -0400 Subject: [PATCH 09/13] Loot Tracker: Allow loot boxes to be collapsed (#9439) --- .../plugins/loottracker/LootTrackerBox.java | 39 +++++++- .../plugins/loottracker/LootTrackerPanel.java | 86 +++++++++++++++++- .../client/plugins/loottracker/collapsed.png | Bin 0 -> 131 bytes .../client/plugins/loottracker/expanded.png | Bin 0 -> 161 bytes 4 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/collapsed.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/expanded.png diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java index f37be3eb43..0f3b11cea7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java @@ -28,6 +28,7 @@ package net.runelite.client.plugins.loottracker; import com.google.common.base.Strings; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.GridLayout; import java.awt.image.BufferedImage; import java.util.ArrayList; @@ -59,6 +60,8 @@ class LootTrackerBox extends JPanel private final JPanel itemContainer = new JPanel(); private final JLabel priceLabel = new JLabel(); private final JLabel subTitleLabel = new JLabel(); + private final JPanel logTitle = new JPanel(new BorderLayout(5, 0)); + private final JLabel titleLabel = new JLabel(); private final ItemManager itemManager; @Getter(AccessLevel.PACKAGE) private final String id; @@ -85,11 +88,10 @@ class LootTrackerBox extends JPanel setLayout(new BorderLayout(0, 1)); setBorder(new EmptyBorder(5, 0, 0, 0)); - final JPanel logTitle = new JPanel(new BorderLayout(5, 0)); logTitle.setBorder(new EmptyBorder(7, 7, 7, 7)); logTitle.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); - final JLabel titleLabel = new JLabel(Text.removeTags(id)); + titleLabel.setText(Text.removeTags(id)); titleLabel.setFont(FontManager.getRunescapeSmallFont()); titleLabel.setForeground(Color.WHITE); @@ -182,6 +184,39 @@ class LootTrackerBox extends JPanel repaint(); } + void collapse() + { + if (!isCollapsed()) + { + itemContainer.setVisible(false); + applyDimmer(false, logTitle); + } + } + + void expand() + { + if (isCollapsed()) + { + itemContainer.setVisible(true); + applyDimmer(true, logTitle); + } + } + + boolean isCollapsed() + { + return !itemContainer.isVisible(); + } + + private void applyDimmer(boolean brighten, JPanel panel) + { + for (Component component : panel.getComponents()) + { + Color color = component.getForeground(); + + component.setForeground(brighten ? color.brighter() : color.darker()); + } + } + /** * This method creates stacked items from the item list, calculates total price and then * displays all the items in the UI. diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java index 4f583e11c8..ef237a78ec 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java @@ -69,6 +69,8 @@ class LootTrackerPanel extends PluginPanel private static final ImageIcon VISIBLE_ICON_HOVER; private static final ImageIcon INVISIBLE_ICON; private static final ImageIcon INVISIBLE_ICON_HOVER; + private static final ImageIcon COLLAPSE_ICON; + private static final ImageIcon EXPAND_ICON; private static final String HTML_LABEL_TEMPLATE = "%s%s"; @@ -92,6 +94,7 @@ class LootTrackerPanel extends PluginPanel private final JLabel viewHiddenBtn = new JLabel(); private final JLabel singleLootBtn = new JLabel(); private final JLabel groupedLootBtn = new JLabel(); + private final JLabel collapseBtn = new JLabel(); // Log collection private final List records = new ArrayList<>(); @@ -112,6 +115,8 @@ class LootTrackerPanel extends PluginPanel final BufferedImage backArrowImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "back_icon.png"); final BufferedImage visibleImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "visible_icon.png"); final BufferedImage invisibleImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "invisible_icon.png"); + final BufferedImage collapseImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "collapsed.png"); + final BufferedImage expandedImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "expanded.png"); SINGLE_LOOT_VIEW = new ImageIcon(singleLootImg); SINGLE_LOOT_VIEW_FADED = new ImageIcon(ImageUtil.alphaOffset(singleLootImg, -180)); @@ -129,6 +134,9 @@ class LootTrackerPanel extends PluginPanel INVISIBLE_ICON = new ImageIcon(invisibleImg); INVISIBLE_ICON_HOVER = new ImageIcon(ImageUtil.alphaOffset(invisibleImg, -220)); + + COLLAPSE_ICON = new ImageIcon(collapseImg); + EXPAND_ICON = new ImageIcon(expandedImg); } LootTrackerPanel(final LootTrackerPlugin plugin, final ItemManager itemManager, final LootTrackerConfig config) @@ -156,6 +164,16 @@ class LootTrackerPanel extends PluginPanel final JPanel viewControls = new JPanel(new GridLayout(1, 3, 10, 0)); viewControls.setBackground(ColorScheme.DARKER_GRAY_COLOR); + collapseBtn.setIcon(EXPAND_ICON); + collapseBtn.addMouseListener(new MouseAdapter() + { + @Override + public void mousePressed(MouseEvent e) + { + changeCollapse(); + } + }); + singleLootBtn.setIcon(SINGLE_LOOT_VIEW); singleLootBtn.setToolTipText("Show each kill separately"); singleLootBtn.addMouseListener(new MouseAdapter() @@ -225,6 +243,7 @@ class LootTrackerPanel extends PluginPanel } }); + viewControls.add(collapseBtn); viewControls.add(groupedLootBtn); viewControls.add(singleLootBtn); viewControls.add(viewHiddenBtn); @@ -265,8 +284,8 @@ class LootTrackerPanel extends PluginPanel leftTitleContainer.add(backBtn, BorderLayout.WEST); leftTitleContainer.add(detailsTitle, BorderLayout.CENTER); - actionsContainer.add(leftTitleContainer, BorderLayout.WEST); actionsContainer.add(viewControls, BorderLayout.EAST); + actionsContainer.add(leftTitleContainer, BorderLayout.WEST); // Create panel that will contain overall data overallPanel.setBorder(BorderFactory.createCompoundBorder( @@ -325,6 +344,27 @@ class LootTrackerPanel extends PluginPanel add(errorPanel); } + void updateCollapseText() + { + if (isAllCollapsed()) + { + collapseBtn.setToolTipText("Un-Collapse All"); + collapseBtn.setIcon(COLLAPSE_ICON); + } + else + { + collapseBtn.setToolTipText("Collapse All"); + collapseBtn.setIcon(EXPAND_ICON); + } + } + + private boolean isAllCollapsed() + { + return boxes.stream() + .filter(i -> i.isCollapsed()) + .count() == boxes.size(); + } + void loadHeaderIcon(BufferedImage img) { overallIcon.setIcon(new ImageIcon(img)); @@ -382,6 +422,28 @@ class LootTrackerPanel extends PluginPanel viewHiddenBtn.setIcon(hideIgnoredItems ? VISIBLE_ICON : INVISIBLE_ICON); } + /** + * Changes the collapse status of loot entries + */ + private void changeCollapse() + { + boolean isAllCollapsed = isAllCollapsed(); + + for (LootTrackerBox box : boxes) + { + if (isAllCollapsed) + { + box.expand(); + } + else if (!box.isCollapsed()) + { + box.collapse(); + } + } + + updateCollapseText(); + } + /** * After an item changed it's ignored state, iterate all the records and make * sure all items of the same name also get updated @@ -464,6 +526,27 @@ class LootTrackerPanel extends PluginPanel popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5)); box.setComponentPopupMenu(popupMenu); + // Create collapse event + box.addMouseListener(new MouseAdapter() + { + @Override + public void mouseClicked(MouseEvent e) + { + if (e.getButton() == MouseEvent.BUTTON1) + { + if (box.isCollapsed()) + { + box.expand(); + } + else + { + box.collapse(); + } + updateCollapseText(); + } + } + }); + // Create reset menu final JMenuItem reset = new JMenuItem("Reset"); reset.addActionListener(e -> @@ -541,6 +624,7 @@ class LootTrackerPanel extends PluginPanel overallKillsLabel.setText(htmlLabel("Total count: ", overallKills)); overallGpLabel.setText(htmlLabel("Total value: ", overallGp)); + updateCollapseText(); } private static String htmlLabel(String key, long value) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/collapsed.png b/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/collapsed.png new file mode 100644 index 0000000000000000000000000000000000000000..449f68ae6cecf576cff82da9a9a8ab815f07937b GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^96-#&!3HGb=lz)rq`W*`9780gCNnht|NlSy-~a#n z=P^qE08-b0{QrO38-!xI9<5lW(G=lYpU^d9!zw2Rxtg$&$DcVfC!Jty)#_ZrA#!EL dBpx0f2Gfd3yLdx(DF97n@O1TaS?83{1OWU3GCBYN literal 0 HcmV?d00001 diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/expanded.png b/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/expanded.png new file mode 100644 index 0000000000000000000000000000000000000000..df41d71bc990c5e03bfbfc9911bf30e47ae7919b GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CB!3HGHK9Tzfq%u5R9780gw)ULnY;fRVoqsKr zb>6pUC(B$maGs8_w-D-4dbf(7>0zqcCWfhXMTQRiIS#*<-8egQ-4qd3(MfI#P9C_{ zd+toSWkCw-Azr?Fk!{bH2S+vBI{r=MoQL2HyN5kr`0ba7OxwcziKkEF;M1& literal 0 HcmV?d00001 From 0e8d377adfe688e5b9a98f5564ae2e2b4f46692f Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 6 Aug 2019 08:28:41 -0400 Subject: [PATCH 10/13] keyremapping: fix race with sending messages and clearing chat input It is not necessary to clear the chat input when locking chat when a message would be sent. Currently this races with the key handlers where it can sometimes clear the chatbox input prior to enter being processed, resulting in dropped messages This was introduced in b5acb61771d31fa31266a545b485d72ee92a655c --- .../plugins/keyremapping/KeyRemappingListener.java | 10 ++++++++-- .../plugins/keyremapping/KeyRemappingPlugin.java | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java index 9ffbd27e77..fbdc08a7aa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java @@ -182,10 +182,16 @@ class KeyRemappingListener extends MouseAdapter implements KeyListener switch (e.getKeyCode()) { case KeyEvent.VK_ESCAPE: - // When existing typing mode, block the escape key + // When exiting typing mode, block the escape key // so that it doesn't trigger the in-game hotkeys e.consume(); - // FALLTHROUGH + plugin.setTyping(false); + clientThread.invoke(() -> + { + client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, ""); + plugin.lockChat(); + }); + break; case KeyEvent.VK_ENTER: plugin.setTyping(false); clientThread.invoke(plugin::lockChat); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java index a292843ca1..b1edacd3da 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java @@ -88,6 +88,8 @@ public class KeyRemappingPlugin extends Plugin if (client.getGameState() == GameState.LOGGED_IN) { lockChat(); + // Clear any typed text + client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, ""); } }); } @@ -178,8 +180,6 @@ public class KeyRemappingPlugin extends Plugin if (chatboxInput != null) { chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT); - // Typed text can be non-empty on plugin start, so clear it now - client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, ""); } } From e9fae0dbe431aa898d31944fe6901e108e21198c Mon Sep 17 00:00:00 2001 From: Brady Date: Tue, 6 Aug 2019 12:46:11 -0400 Subject: [PATCH 11/13] skill calc: Add four dose stamina to herblore calculator (#4689) --- .../client/plugins/skillcalculator/skill_herblore.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json index c25cb8beda..242ca19943 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json @@ -276,6 +276,12 @@ "name": "Stamina Potion (3)", "xp": 76.5 }, + { + "level": 77, + "icon": 12625, + "name": "Stamina Potion (4)", + "xp": 102 + }, { "level": 78, "icon": 189, From 2f15420a847404239954db6cd56012412875308a Mon Sep 17 00:00:00 2001 From: dekvall Date: Wed, 7 Aug 2019 18:52:45 +0200 Subject: [PATCH 12/13] Disable inventory grid if the dragged item is removed --- .../plugins/inventorygrid/InventoryGridOverlay.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java index e7395f299d..a8848a3dd1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java @@ -79,6 +79,14 @@ class InventoryGridOverlay extends Overlay final net.runelite.api.Point mouse = client.getMouseCanvasPosition(); final Point mousePoint = new Point(mouse.getX(), mouse.getY()); + final int if1DraggedItemIndex = client.getIf1DraggedItemIndex(); + final WidgetItem draggedItem = inventoryWidget.getWidgetItem(if1DraggedItemIndex); + final int itemId = draggedItem.getId(); + + if (itemId == -1) + { + return null; + } for (int i = 0; i < INVENTORY_SIZE; ++i) { @@ -89,8 +97,7 @@ class InventoryGridOverlay extends Overlay if (config.showItem() && inBounds) { - final WidgetItem draggedItem = inventoryWidget.getWidgetItem(client.getIf1DraggedItemIndex()); - final BufferedImage draggedItemImage = itemManager.getImage(draggedItem.getId()); + final BufferedImage draggedItemImage = itemManager.getImage(itemId); final int x = (int) bounds.getX(); final int y = (int) bounds.getY(); From 345f07d20ff298fb814d568091bf4af880980448 Mon Sep 17 00:00:00 2001 From: Daniel Bolink Date: Wed, 7 Aug 2019 17:11:12 -0700 Subject: [PATCH 13/13] loot tracker: add Kingdom of Miscellania --- runelite-api/src/main/java/net/runelite/api/InventoryID.java | 4 ++++ .../client/plugins/loottracker/LootTrackerPlugin.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/InventoryID.java b/runelite-api/src/main/java/net/runelite/api/InventoryID.java index 49f84ea551..a5e4de4bdc 100644 --- a/runelite-api/src/main/java/net/runelite/api/InventoryID.java +++ b/runelite-api/src/main/java/net/runelite/api/InventoryID.java @@ -53,6 +53,10 @@ public enum InventoryID * Monkey madness puzzle box inventory. */ MONKEY_MADNESS_PUZZLE_BOX(221), + /** + * Kingdom Of Miscellania reward inventory. + */ + KINGDOM_OF_MISCELLANIA(390), /** * Chambers of Xeric chest inventory. */ diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 5fd34877f5..092d9783fd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -391,6 +391,10 @@ public class LootTrackerPlugin extends Plugin // Clue Scrolls use same InventoryID as Barrows container = client.getItemContainer(InventoryID.BARROWS_REWARD); break; + case (WidgetID.KINGDOM_GROUP_ID): + eventType = "Kingdom of Miscellania"; + container = client.getItemContainer(InventoryID.KINGDOM_OF_MISCELLANIA); + break; default: return; }