From a45ad0c4a62f2c90f821cadaac5afaceb40848da Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 12 May 2019 23:36:19 -0600 Subject: [PATCH 01/31] runelite-api: Correct WallObject documentation --- .../java/net/runelite/api/WallObject.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/WallObject.java b/runelite-api/src/main/java/net/runelite/api/WallObject.java index 9a7156b654..ddc4a734cd 100644 --- a/runelite-api/src/main/java/net/runelite/api/WallObject.java +++ b/runelite-api/src/main/java/net/runelite/api/WallObject.java @@ -25,28 +25,33 @@ package net.runelite.api; /** - * Represents the wall of a tile, which is an un-passable boundary. + * Represents one or two walls on a tile */ public interface WallObject extends TileObject { /** - * Gets the first orientation of the wall. - * - * @return the first orientation, 0-2048 where 0 is north + * A bitfield with the orientation of a wall + * 1 = East + * 2 = North + * 4 = West + * 8 = South */ int getOrientationA(); /** - * Gets the second orientation value of the wall. - * - * @return the second orientation, 0-2048 where 0 is north + * A bitfield containing the orientation of the second wall on this tile, + * or 0 if there is no second wall. + * @see #getOrientationA */ int getOrientationB(); /** - * Gets the boundary configuration of the wall. - * - * @return the boundary configuration + * A bitfield containing various flags: + *
{@code
+	 * object type id = bits & 0x20
+	 * orientation (0-3) = bits >>> 6 & 3
+	 * supports items = bits >>> 8 & 1
+	 * }
*/ int getConfig(); From feb2454e55083cc2a661660d8844294191963d53 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 12 May 2019 23:49:36 -0600 Subject: [PATCH 02/31] mixins: Correct WallObject's clickbox The orientation is baked into the model and this var has nothing to do with what this method takes in this slot --- .../src/main/java/net/runelite/mixins/RSWallObjectMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSWallObjectMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSWallObjectMixin.java index 3ef5358ffd..e5db24d686 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSWallObjectMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSWallObjectMixin.java @@ -101,8 +101,8 @@ public abstract class RSWallObjectMixin implements RSWallObject { Area clickbox = new Area(); - Area clickboxA = Perspective.getClickbox(client, getModelA(), getOrientationA(), getLocalLocation()); - Area clickboxB = Perspective.getClickbox(client, getModelB(), getOrientationB(), getLocalLocation()); + Area clickboxA = Perspective.getClickbox(client, getModelA(), 0, getLocalLocation()); + Area clickboxB = Perspective.getClickbox(client, getModelB(), 0, getLocalLocation()); if (clickboxA == null && clickboxB == null) { From f2935dcfdb629ae7b3a1748889dd323b6a892db8 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 12 May 2019 23:59:03 -0600 Subject: [PATCH 03/31] mixins: Correct DecorativeObject's clickbox - getOrientation has nothing to do with getClickbox's orientation parameter - model A is offset by x/yOffset - model B exists sometimes --- .../mixins/RSDecorativeObjectMixin.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSDecorativeObjectMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSDecorativeObjectMixin.java index e86e689fef..9bf27786eb 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSDecorativeObjectMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSDecorativeObjectMixin.java @@ -110,7 +110,29 @@ public abstract class RSDecorativeObjectMixin implements RSDecorativeObject @Override public Area getClickbox() { - return Perspective.getClickbox(client, getModel(), getOrientation(), getLocalLocation()); + Area clickbox = new Area(); + + LocalPoint lp = getLocalLocation(); + Area clickboxA = Perspective.getClickbox(client, getModel(), 0, + new LocalPoint(lp.getX() + getXOffset(), lp.getY() + getYOffset())); + Area clickboxB = Perspective.getClickbox(client, getModel2(), 0, lp); + + if (clickboxA == null && clickboxB == null) + { + return null; + } + + if (clickboxA != null) + { + clickbox.add(clickboxA); + } + + if (clickboxB != null) + { + clickbox.add(clickboxB); + } + + return clickbox; } @Inject From 7aa027084540ab967e2d221dc7a77e6a387fdc7d Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Fri, 17 May 2019 03:50:29 +0100 Subject: [PATCH 04/31] clues: add support for beginner maps --- .../net/runelite/api/widgets/WidgetID.java | 5 ++ .../plugins/cluescrolls/ClueScrollPlugin.java | 15 +++++ .../cluescrolls/clues/BeginnerMapClue.java | 66 +++++++++++++++++++ .../plugins/cluescrolls/clues/MapClue.java | 2 +- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/BeginnerMapClue.java diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index c450620abd..523c0335c8 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -134,6 +134,11 @@ public class WidgetID public static final int KEPT_ON_DEATH_GROUP_ID = 4; public static final int GUIDE_PRICE_GROUP_ID = 464; public static final int SEED_VAULT_INVENTORY_GROUP_ID = 630; + public static final int BEGINNER_CLUE_MAP_CHAMPIONS_GUILD = 346; + public static final int BEGINNER_CLUE_MAP_VARROCK_EAST_MINE = 347; + public static final int BEGINNER_CLUE_MAP_DRAYNOR = 348; + public static final int BEGINNER_CLUE_MAP_NORTH_OF_FALADOR = 351; + public static final int BEGINNER_CLUE_MAP_WIZARDS_TOWER = 356; static class WorldMap { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java index d060f1a3e4..24d9aad896 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java @@ -68,7 +68,9 @@ import net.runelite.api.events.ItemContainerChanged; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcSpawned; +import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; @@ -76,6 +78,7 @@ import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.cluescrolls.clues.AnagramClue; +import net.runelite.client.plugins.cluescrolls.clues.BeginnerMapClue; import net.runelite.client.plugins.cluescrolls.clues.CipherClue; import net.runelite.client.plugins.cluescrolls.clues.ClueScroll; import net.runelite.client.plugins.cluescrolls.clues.CoordinateClue; @@ -389,6 +392,18 @@ public class ClueScrollPlugin extends Plugin updateClue(findClueScroll()); } + @Subscribe + public void onWidgetLoaded(WidgetLoaded event) + { + if (event.getGroupId() < WidgetID.BEGINNER_CLUE_MAP_CHAMPIONS_GUILD + || event.getGroupId() > WidgetID.BEGINNER_CLUE_MAP_WIZARDS_TOWER) + { + return; + } + + updateClue(BeginnerMapClue.forWidgetID(event.getGroupId())); + } + public BufferedImage getClueScrollImage() { return itemManager.getImage(ItemID.CLUE_SCROLL_MASTER); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/BeginnerMapClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/BeginnerMapClue.java new file mode 100644 index 0000000000..caaeaeeb61 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/BeginnerMapClue.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019, Hydrox6 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.cluescrolls.clues; + +import com.google.common.collect.ImmutableList; +import lombok.Getter; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.widgets.WidgetID; + +@Getter +public class BeginnerMapClue extends MapClue implements LocationClueScroll +{ + private static final ImmutableList CLUES = ImmutableList.of( + new BeginnerMapClue(WidgetID.BEGINNER_CLUE_MAP_CHAMPIONS_GUILD, new WorldPoint(3166, 3361, 0), "South West of the Champion's Guild"), + new BeginnerMapClue(WidgetID.BEGINNER_CLUE_MAP_VARROCK_EAST_MINE, new WorldPoint(3290, 3374, 0), "Outside Varrock East Mine"), + new BeginnerMapClue(WidgetID.BEGINNER_CLUE_MAP_DRAYNOR, new WorldPoint(3093, 3226, 0), "South of Draynor Village Bank"), + new BeginnerMapClue(WidgetID.BEGINNER_CLUE_MAP_NORTH_OF_FALADOR, new WorldPoint(3043, 3398, 0), "In the standing stones north of Falador"), + new BeginnerMapClue(WidgetID.BEGINNER_CLUE_MAP_WIZARDS_TOWER, new WorldPoint(3110, 3152, 0), "On the south side of the Wizard's Tower") + ); + + private final int widgetGroupID; + + private BeginnerMapClue(int widgetGroupID, WorldPoint location, String description) + { + super(-1, location, description); + this.widgetGroupID = widgetGroupID; + setRequiresSpade(true); + } + + // Beginner Map Clues all use the same ItemID, but the WidgetID used to display them is unique + public static BeginnerMapClue forWidgetID(int widgetGroupID) + { + for (BeginnerMapClue clue : CLUES) + { + if (clue.widgetGroupID == widgetGroupID) + { + return clue; + } + } + + return null; + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java index 99b1eef058..ec95a7b946 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java @@ -102,7 +102,7 @@ public class MapClue extends ClueScroll implements ObjectClueScroll this(itemId, location, objectId, null); } - private MapClue(int itemId, WorldPoint location, String description) + MapClue(int itemId, WorldPoint location, String description) { this(itemId, location, -1, description); } From e5e2abebbd160260285ab8560b4ee2dd5893563e Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Wed, 22 May 2019 23:39:57 -0700 Subject: [PATCH 05/31] PluginManagerTest: Ensure config keyNames are not duplicated This adds a new test to ensure plugin configurations do not duplicate the keyName annotation argument to prevent runtime errors. --- .../client/plugins/PluginManagerTest.java | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java index 8f63169574..23196ff1cf 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java @@ -38,6 +38,7 @@ import java.applet.Applet; import java.io.File; import java.io.IOException; import java.io.PrintWriter; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -48,6 +49,8 @@ import net.runelite.api.Client; import net.runelite.client.RuneLite; import net.runelite.client.RuneLiteModule; import net.runelite.client.eventbus.EventBus; +import net.runelite.client.config.Config; +import net.runelite.client.config.ConfigItem; import net.runelite.client.rs.ClientUpdateCheckMode; import static org.junit.Assert.assertEquals; import org.junit.Before; @@ -75,6 +78,7 @@ public class PluginManagerTest public Client client; private Set pluginClasses; + private Set configClasses; @Before public void before() throws IOException @@ -85,8 +89,9 @@ public class PluginManagerTest RuneLite.setInjector(injector); - // Find plugins we expect to have + // Find plugins and configs we expect to have pluginClasses = new HashSet<>(); + configClasses = new HashSet<>(); Set classes = ClassPath.from(getClass().getClassLoader()).getTopLevelClassesRecursive(PLUGIN_PACKAGE); for (ClassInfo classInfo : classes) { @@ -95,6 +100,12 @@ public class PluginManagerTest if (pluginDescriptor != null) { pluginClasses.add(clazz); + continue; + } + + if (Config.class.isAssignableFrom(clazz)) + { + configClasses.add(clazz); } } @@ -155,4 +166,37 @@ public class PluginManagerTest } } + @Test + public void ensureNoDuplicateConfigKeyNames() + { + for (final Class clazz : configClasses) + { + final Set configKeyNames = new HashSet<>(); + + for (final Method method : clazz.getMethods()) + { + if (!method.isDefault()) + { + continue; + } + + final ConfigItem annotation = method.getAnnotation(ConfigItem.class); + + if (annotation == null) + { + continue; + } + + final String configKeyName = annotation.keyName(); + + if (configKeyNames.contains(configKeyName)) + { + throw new IllegalArgumentException("keyName " + configKeyName + " is duplicated in " + clazz); + } + + configKeyNames.add(configKeyName); + } + } + } + } From 825b0167d6ef36b300151064f8316f678e6372ac Mon Sep 17 00:00:00 2001 From: Max Weber Date: Thu, 23 May 2019 11:29:39 -0600 Subject: [PATCH 06/31] timetracking: Update farming patches for the Hosidius rework --- .../timetracking/farming/FarmingWorld.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java index 865c0e5517..d74d9027f3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java @@ -139,28 +139,28 @@ class FarmingWorld new FarmingPatch("", Varbits.FARMING_4772, PatchImplementation.HERB) )); - add(new FarmingRegion("Kourend", 7222, + add(new FarmingRegion("Kourend", 6967, new FarmingPatch("North East", Varbits.FARMING_4771, PatchImplementation.ALLOTMENT), new FarmingPatch("South West", Varbits.FARMING_4772, PatchImplementation.ALLOTMENT), new FarmingPatch("", Varbits.FARMING_4773, PatchImplementation.FLOWER), new FarmingPatch("", Varbits.FARMING_4774, PatchImplementation.HERB) )); add(new FarmingRegion("Kourend", 6711, - new FarmingPatch("", Varbits.FARMING_4771, PatchImplementation.SPIRIT_TREE) + new FarmingPatch("", Varbits.FARMING_7904, PatchImplementation.SPIRIT_TREE) )); add(new FarmingRegion("Kourend", 7223, - new FarmingPatch("West 1", Varbits.GRAPES_4953, PatchImplementation.GRAPES), - new FarmingPatch("West 2", Varbits.GRAPES_4954, PatchImplementation.GRAPES), - new FarmingPatch("West 3", Varbits.GRAPES_4955, PatchImplementation.GRAPES), - new FarmingPatch("West 4", Varbits.GRAPES_4956, PatchImplementation.GRAPES), - new FarmingPatch("West 5", Varbits.GRAPES_4957, PatchImplementation.GRAPES), - new FarmingPatch("West 6", Varbits.GRAPES_4958, PatchImplementation.GRAPES), - new FarmingPatch("East 1", Varbits.GRAPES_4959, PatchImplementation.GRAPES), - new FarmingPatch("East 2", Varbits.GRAPES_4960, PatchImplementation.GRAPES), - new FarmingPatch("East 3", Varbits.GRAPES_4961, PatchImplementation.GRAPES), - new FarmingPatch("East 4", Varbits.GRAPES_4962, PatchImplementation.GRAPES), - new FarmingPatch("East 5", Varbits.GRAPES_4963, PatchImplementation.GRAPES), - new FarmingPatch("East 6", Varbits.GRAPES_4964, PatchImplementation.GRAPES) + new FarmingPatch("East 1", Varbits.GRAPES_4953, PatchImplementation.GRAPES), + new FarmingPatch("East 2", Varbits.GRAPES_4954, PatchImplementation.GRAPES), + new FarmingPatch("East 3", Varbits.GRAPES_4955, PatchImplementation.GRAPES), + new FarmingPatch("East 4", Varbits.GRAPES_4956, PatchImplementation.GRAPES), + new FarmingPatch("East 5", Varbits.GRAPES_4957, PatchImplementation.GRAPES), + new FarmingPatch("East 6", Varbits.GRAPES_4958, PatchImplementation.GRAPES), + new FarmingPatch("West 1", Varbits.GRAPES_4959, PatchImplementation.GRAPES), + new FarmingPatch("West 2", Varbits.GRAPES_4960, PatchImplementation.GRAPES), + new FarmingPatch("West 3", Varbits.GRAPES_4961, PatchImplementation.GRAPES), + new FarmingPatch("West 4", Varbits.GRAPES_4962, PatchImplementation.GRAPES), + new FarmingPatch("West 5", Varbits.GRAPES_4963, PatchImplementation.GRAPES), + new FarmingPatch("West 6", Varbits.GRAPES_4964, PatchImplementation.GRAPES) )); add(new FarmingRegion("Lletya", 9265, From a459656906c95b49eff98279072784c28d48e57b Mon Sep 17 00:00:00 2001 From: Hexagon Date: Thu, 23 May 2019 23:06:58 -0300 Subject: [PATCH 07/31] clue plugin: add stash unit built status to emote clue overlay --- .../main/java/net/runelite/api/ScriptID.java | 13 + .../plugins/cluescrolls/clues/EmoteClue.java | 52 +++- .../cluescrolls/clues/emote/STASHUnit.java | 228 +++++++++--------- 3 files changed, 175 insertions(+), 118 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptID.java b/runelite-api/src/main/java/net/runelite/api/ScriptID.java index 68abc5e0f7..7f33380f28 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/runelite-api/src/main/java/net/runelite/api/ScriptID.java @@ -95,6 +95,19 @@ public final class ScriptID */ public static final int CHAT_PROMPT_INIT = 223; + /** + * Checks the state of the given stash unit. + *
    + *
  • int (loc) The stash unit object id
  • + *
  • int Bitpacked stash unit states
  • + *
  • int Bitpacked stash unit states 2
  • + *
  • int Bitpacked stash unit states 3
  • + *
+ * + * Returns a pair of booleans indicating if the stash unit is built and if it is filled + */ + public static final int WATSON_STASH_UNIT_CHECK = 1479; + /** * Queries the completion state of a quest by its struct id *
    diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java index eb4e89cef0..d4fd2ce0ee 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java @@ -27,15 +27,19 @@ package net.runelite.client.plugins.cluescrolls.clues; import com.google.common.collect.ImmutableSet; import java.awt.Color; import java.awt.Graphics2D; +import java.awt.Polygon; import java.util.Set; import javax.annotation.Nonnull; import lombok.Getter; +import net.runelite.api.Client; import net.runelite.api.EquipmentInventorySlot; import static net.runelite.api.EquipmentInventorySlot.*; import static net.runelite.api.EquipmentInventorySlot.LEGS; import net.runelite.api.Item; import net.runelite.api.ItemID; import static net.runelite.api.ItemID.*; +import net.runelite.api.Perspective; +import net.runelite.api.ScriptID; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR; @@ -47,6 +51,7 @@ import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.*; import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.BULL_ROARER; import net.runelite.client.plugins.cluescrolls.clues.emote.ItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.emote.RangeItemRequirement; +import net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit; import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.*; import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.SHANTAY_PASS; import net.runelite.client.plugins.cluescrolls.clues.emote.SingleItemRequirement; @@ -175,6 +180,9 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Panic at Al Kharid mine.", null, new WorldPoint(3300, 3314, 0), PANIC), new EmoteClue("Spin at Flynn's Mace Shop.", null, new WorldPoint(2950, 3387, 0), SPIN)); + private static final String UNICODE_CHECK_MARK = "\u2713"; + private static final String UNICODE_BALLOT_X = "\u2717"; + private static SingleItemRequirement item(int itemId) { return new SingleItemRequirement(itemId); @@ -206,19 +214,18 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu } private final String text; - private final Integer stashUnit; + private final STASHUnit stashUnit; private final WorldPoint location; private final Emote firstEmote; private final Emote secondEmote; - @Nonnull private final ItemRequirement[] itemRequirements; - private EmoteClue(String text, Integer stashUnit, WorldPoint location, Emote firstEmote, @Nonnull ItemRequirement... itemRequirements) + private EmoteClue(String text, STASHUnit stashUnit, WorldPoint location, Emote firstEmote, @Nonnull ItemRequirement... itemRequirements) { this(text, stashUnit, location, firstEmote, null, itemRequirements); } - private EmoteClue(String text, Integer stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull ItemRequirement... itemRequirements) + private EmoteClue(String text, STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull ItemRequirement... itemRequirements) { this.text = text; this.stashUnit = stashUnit; @@ -248,6 +255,17 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu if (itemRequirements.length > 0) { + Client client = plugin.getClient(); + client.runScript(ScriptID.WATSON_STASH_UNIT_CHECK, stashUnit.getObjectId(), 0, 0, 0); + int[] intStack = client.getIntStack(); + boolean stashUnitBuilt = intStack[0] == 1; + + panelComponent.getChildren().add(LineComponent.builder() + .left("STASH Unit:") + .right(stashUnitBuilt ? UNICODE_CHECK_MARK : UNICODE_BALLOT_X) + .rightColor(stashUnitBuilt ? Color.GREEN : Color.RED) + .build()); + panelComponent.getChildren().add(LineComponent.builder().left("Equip:").build()); Item[] equipment = plugin.getEquippedItems(); @@ -275,9 +293,9 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu boolean combinedFulfilled = requirement.fulfilledBy(combined); panelComponent.getChildren().add(LineComponent.builder() - .left(requirement.getCollectiveName(plugin.getClient())) + .left(requirement.getCollectiveName(client)) .leftColor(TITLED_CONTENT_COLOR) - .right(combinedFulfilled ? "\u2713" : "\u2717") + .right(combinedFulfilled ? UNICODE_CHECK_MARK : UNICODE_BALLOT_X) .rightColor(equipmentFulfilled ? Color.GREEN : (combinedFulfilled ? Color.ORANGE : Color.RED)) .build()); } @@ -287,14 +305,28 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu @Override public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin) { - LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation()); + LocalPoint localPoint = LocalPoint.fromWorld(plugin.getClient(), getLocation()); - if (localLocation == null) + if (localPoint != null) { - return; + OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localPoint, plugin.getEmoteImage(), Color.ORANGE); } - OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localLocation, plugin.getEmoteImage(), Color.ORANGE); + final WorldPoint[] worldPoints = stashUnit.getWorldPoints(); + + for (final WorldPoint worldPoint : worldPoints) + { + final LocalPoint stashUnitLocalPoint = LocalPoint.fromWorld(plugin.getClient(), worldPoint); + + if (stashUnitLocalPoint != null) + { + final Polygon poly = Perspective.getCanvasTilePoly(plugin.getClient(), stashUnitLocalPoint); + if (poly != null) + { + OverlayUtil.renderPolygon(graphics, poly, Color.RED); + } + } + } } public static EmoteClue forText(String text) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/STASHUnit.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/STASHUnit.java index 6edca56a02..b6d2038cea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/STASHUnit.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/STASHUnit.java @@ -24,115 +24,127 @@ */ package net.runelite.client.plugins.cluescrolls.clues.emote; +import lombok.Getter; import net.runelite.api.NullObjectID; +import net.runelite.api.coords.WorldPoint; -public final class STASHUnit +@Getter +public enum STASHUnit { - public static final int NEAR_A_SHED_IN_LUMBRIDGE_SWAMP = NullObjectID.NULL_28958; - public static final int ON_THE_BRIDGE_TO_THE_MISTHALIN_WIZARDS_TOWER = NullObjectID.NULL_28959; - public static final int DRAYNOR_VILLAGE_MARKET = NullObjectID.NULL_28960; - public static final int LIMESTONE_MINE = NullObjectID.NULL_28961; - public static final int OUTSIDE_THE_LEGENDS_GUILD_GATES = NullObjectID.NULL_28962; - public static final int MUDSKIPPER_POINT = NullObjectID.NULL_28963; - public static final int NEAR_THE_ENTRANA_FERRY_IN_PORT_SARIM = NullObjectID.NULL_28964; - public static final int AL_KHARID_SCORPION_MINE = NullObjectID.NULL_28965; - public static final int DRAYNOR_MANOR_BY_THE_FOUNTAIN = NullObjectID.NULL_28966; - public static final int WHEAT_FIELD_NEAR_THE_LUMBRIDGE_WINDMILL = NullObjectID.NULL_28967; - public static final int CROSSROADS_NORTH_OF_DRAYNOR_VILLAGE = NullObjectID.NULL_28968; - public static final int RIMMINGTON_MINE = NullObjectID.NULL_28969; - public static final int VARROCK_PALACE_LIBRARY = NullObjectID.NULL_28970; - public static final int UPSTAIRS_IN_THE_ARDOUGNE_WINDMILL = NullObjectID.NULL_28971; - public static final int OUTSIDE_THE_FALADOR_PARTY_ROOM = NullObjectID.NULL_28972; - public static final int TAVERLEY_STONE_CIRCLE = NullObjectID.NULL_28973; - public static final int CATHERBY_BEEHIVE_FIELD = NullObjectID.NULL_28974; - public static final int NEAR_THE_PARROTS_IN_ARDOUGNE_ZOO = NullObjectID.NULL_28975; - public static final int ROAD_JUNCTION_NORTH_OF_RIMMINGTON = NullObjectID.NULL_28976; - public static final int OUTSIDE_THE_FISHING_GUILD = NullObjectID.NULL_28977; - public static final int OUTSIDE_KEEP_LE_FAYE = NullObjectID.NULL_28978; - public static final int ROAD_JUNCTION_SOUTH_OF_SINCLAIR_MANSION = NullObjectID.NULL_28979; - public static final int OUTSIDE_THE_DIGSITE_EXAM_CENTRE = NullObjectID.NULL_28980; - public static final int NEAR_THE_SAWMILL_OPERATORS_BOOTH = NullObjectID.NULL_28981; - public static final int MUBARIZS_ROOM_AT_THE_DUEL_ARENA = NullObjectID.NULL_28982; - public static final int OUTSIDE_VARROCK_PALACE_COURTYARD = NullObjectID.NULL_28983; - public static final int NEAR_HERQUINS_SHOP_IN_FALADOR = NullObjectID.NULL_28984; - public static final int SOUTH_OF_THE_GRAND_EXCHANGE = NullObjectID.NULL_28985; - public static final int AUBURYS_SHOP_IN_VARROCK = NullObjectID.NULL_28986; - public static final int CENTRE_OF_CANIFIS = NullObjectID.NULL_28987; - public static final int MAUSOLEUM_OFF_THE_MORYTANIA_COAST = NullObjectID.NULL_28988; - public static final int EAST_OF_THE_BARBARIAN_VILLAGE_BRIDGE = NullObjectID.NULL_28989; - public static final int SOUTH_OF_THE_SHRINE_IN_TAI_BWO_WANNAI_VILLAGE = NullObjectID.NULL_28990; - public static final int CASTLE_WARS_BANK = NullObjectID.NULL_28991; - public static final int BARBARIAN_OUTPOST_OBSTACLE_COURSE = NullObjectID.NULL_28992; - public static final int GNOME_STRONGHOLD_BALANCING_ROPE = NullObjectID.NULL_28993; - public static final int OUTSIDE_YANILLE_BANK = NullObjectID.NULL_28994; - public static final int OBSERVATORY = NullObjectID.NULL_28995; - public static final int OGRE_CAGE_IN_KING_LATHAS_TRAINING_CAMP = NullObjectID.NULL_28996; - public static final int DIGSITE = NullObjectID.NULL_28997; - public static final int HICKTONS_ARCHERY_EMPORIUM = NullObjectID.NULL_28998; - public static final int SHANTAY_PASS = NullObjectID.NULL_28999; - public static final int LUMBRIDGE_SWAMP_CAVES = NullObjectID.NULL_29000; - public static final int OUTSIDE_CATHERBY_BANK = NullObjectID.NULL_29001; - public static final int OUTSIDE_THE_SEERS_VILLAGE_COURTHOUSE = NullObjectID.NULL_29002; - public static final int OUTSIDE_HARRYS_FISHING_SHOP_IN_CATHERBY = NullObjectID.NULL_29003; - public static final int TZHAAR_WEAPONS_STORE = NullObjectID.NULL_29004; - public static final int NORTH_OF_EVIL_DAVES_HOUSE_IN_EDGEVILLE = NullObjectID.NULL_29005; - public static final int WEST_OF_THE_SHAYZIEN_COMBAT_RING = NullObjectID.NULL_29006; - public static final int ENTRANCE_OF_THE_ARCEUUS_LIBRARY = NullObjectID.NULL_29007; - public static final int OUTSIDE_DRAYNOR_VILLAGE_JAIL = NullObjectID.NULL_29008; - public static final int CHAOS_TEMPLE_IN_THE_SOUTHEASTERN_WILDERNESS = NullObjectID.NULL_29009; - public static final int FISHING_GUILD_BANK = NullObjectID.NULL_29010; - public static final int TOP_FLOOR_OF_THE_LIGHTHOUSE = NullObjectID.NULL_29011; - public static final int OUTSIDE_THE_GREAT_PYRAMID_OF_SOPHANEM = NullObjectID.NULL_29012; - public static final int NOTERAZZOS_SHOP_IN_THE_WILDERNESS = NullObjectID.NULL_29013; - public static final int WEST_SIDE_OF_THE_KARAMJA_BANANA_PLANTATION = NullObjectID.NULL_29014; - public static final int MOUNTAIN_CAMP_GOAT_ENCLOSURE = NullObjectID.NULL_29015; - public static final int GNOME_GLIDER_ON_WHITE_WOLF_MOUNTAIN = NullObjectID.NULL_29016; - public static final int SHILO_VILLAGE_BANK = NullObjectID.NULL_29017; - public static final int INSIDE_THE_DIGSITE_EXAM_CENTRE = NullObjectID.NULL_29018; - public static final int NORTHEAST_CORNER_OF_THE_KHARAZI_JUNGLE = NullObjectID.NULL_29019; - public static final int VOLCANO_IN_THE_NORTHEASTERN_WILDERNESS = NullObjectID.NULL_29020; - public static final int IN_THE_MIDDLE_OF_JIGGIG = NullObjectID.NULL_29021; - public static final int AGILITY_PYRAMID = NullObjectID.NULL_29022; - public static final int HOSIDIUS_MESS = NullObjectID.NULL_29023; - public static final int CHAPEL_IN_WEST_ARDOUGNE = NullObjectID.NULL_29024; - public static final int NEAR_A_RUNITE_ROCK_IN_THE_FREMENNIK_ISLES = NullObjectID.NULL_29025; - public static final int NEAR_A_LADDER_IN_THE_WILDERNESS_LAVA_MAZE = NullObjectID.NULL_29026; - public static final int ENTRANCE_OF_THE_CAVE_OF_DAMIS = NullObjectID.NULL_29027; - public static final int WARRIORS_GUILD_BANK = NullObjectID.NULL_29028; - public static final int SOUTHEAST_CORNER_OF_THE_MONASTERY = NullObjectID.NULL_29029; - public static final int SOUTHEAST_CORNER_OF_THE_FISHING_PLATFORM = NullObjectID.NULL_29030; - public static final int OUTSIDE_THE_SLAYER_TOWER_GARGOYLE_ROOM = NullObjectID.NULL_29031; - public static final int ON_TOP_OF_TROLLHEIM_MOUNTAIN = NullObjectID.NULL_29032; - public static final int FOUNTAIN_OF_HEROES = NullObjectID.NULL_29033; - public static final int ENTRANCE_OF_THE_CAVERN_UNDER_THE_WHIRLPOOL = NullObjectID.NULL_29034; - public static final int HALFWAY_DOWN_TROLLWEISS_MOUNTAIN = NullObjectID.NULL_29035; - public static final int SHAYZIEN_WAR_TENT = NullObjectID.NULL_29036; - public static final int OUTSIDE_THE_LEGENDS_GUILD_DOOR = NullObjectID.NULL_29037; - public static final int NEAR_THE_GEM_STALL_IN_ARDOUGNE_MARKET = NullObjectID.NULL_29038; - public static final int OUTSIDE_THE_BAR_BY_THE_FIGHT_ARENA = NullObjectID.NULL_29039; - public static final int SOUTHEAST_CORNER_OF_LAVA_DRAGON_ISLE = NullObjectID.NULL_29040; - public static final int NEAR_THE_PIER_IN_ZULANDRA = NullObjectID.NULL_29041; - public static final int BARROWS_CHEST = NullObjectID.NULL_29042; - public static final int WELL_OF_VOYAGE = NullObjectID.NULL_29043; - public static final int NORTHERN_WALL_OF_CASTLE_DRAKAN = NullObjectID.NULL_29044; - public static final int _7TH_CHAMBER_OF_JALSAVRAH = NullObjectID.NULL_29045; - public static final int SOUL_ALTAR = NullObjectID.NULL_29046; - public static final int WARRIORS_GUILD_BANK_29047 = NullObjectID.NULL_29047; - public static final int ENTRANA_CHAPEL = NullObjectID.NULL_29048; - public static final int TZHAAR_GEM_STORE = NullObjectID.NULL_29049; - public static final int TENT_IN_LORD_IORWERTHS_ENCAMPMENT = NullObjectID.NULL_29050; - public static final int OUTSIDE_MUDKNUCKLES_HUT = NullObjectID.NULL_29051; - public static final int CENTRE_OF_THE_CATACOMBS_OF_KOUREND = NullObjectID.NULL_29052; - public static final int KING_BLACK_DRAGONS_LAIR = NullObjectID.NULL_29053; - public static final int OUTSIDE_KRIL_TSUTSAROTHS_ROOM = NullObjectID.NULL_29054; - public static final int BY_THE_BEAR_CAGE_IN_VARROCK_PALACE_GARDENS = NullObjectID.NULL_29055; - public static final int OUTSIDE_THE_WILDERNESS_AXE_HUT = NullObjectID.NULL_29056; - public static final int TOP_FLOOR_OF_THE_YANILLE_WATCHTOWER = NullObjectID.NULL_29057; - public static final int DEATH_ALTAR = NullObjectID.NULL_29058; - public static final int BEHIND_MISS_SCHISM_IN_DRAYNOR_VILLAGE = NullObjectID.NULL_29059; - public static final int NORTHWESTERN_CORNER_OF_THE_ENCHANTED_VALLEY = NullObjectID.NULL_29060; - public static final int NORTH_OF_MOUNT_KARUULM = NullObjectID.NULL_34647; - public static final int GYPSY_TENT_ENTRANCE = NullObjectID.NULL_34736; - public static final int FINE_CLOTHES_ENTRANCE = NullObjectID.NULL_34737; - public static final int BOB_AXES_ENTRANCE = NullObjectID.NULL_34738; + NEAR_A_SHED_IN_LUMBRIDGE_SWAMP(NullObjectID.NULL_28958, new WorldPoint(3201, 3171, 0)), + ON_THE_BRIDGE_TO_THE_MISTHALIN_WIZARDS_TOWER(NullObjectID.NULL_28959, new WorldPoint(3115, 3194, 1)), + DRAYNOR_VILLAGE_MARKET(NullObjectID.NULL_28960, new WorldPoint(3083, 3254, 0)), + LIMESTONE_MINE(NullObjectID.NULL_28961, new WorldPoint(3373, 3498, 0)), + OUTSIDE_THE_LEGENDS_GUILD_GATES(NullObjectID.NULL_28962, new WorldPoint(2735, 3350, 0)), + MUDSKIPPER_POINT(NullObjectID.NULL_28963, new WorldPoint(2988, 3111, 0)), + NEAR_THE_ENTRANA_FERRY_IN_PORT_SARIM(NullObjectID.NULL_28964, new WorldPoint(3050, 3237, 1)), + AL_KHARID_SCORPION_MINE(NullObjectID.NULL_28965, new WorldPoint(3303, 3289, 0)), + DRAYNOR_MANOR_BY_THE_FOUNTAIN(NullObjectID.NULL_28966, new WorldPoint(3089, 3331, 0)), + WHEAT_FIELD_NEAR_THE_LUMBRIDGE_WINDMILL(NullObjectID.NULL_28967, new WorldPoint(3163, 3297, 0)), + CROSSROADS_NORTH_OF_DRAYNOR_VILLAGE(NullObjectID.NULL_28968, new WorldPoint(3111, 3289, 0)), + RIMMINGTON_MINE(NullObjectID.NULL_28969, new WorldPoint(2976, 3239, 0)), + VARROCK_PALACE_LIBRARY(NullObjectID.NULL_28970, new WorldPoint(3214, 3490, 0)), + UPSTAIRS_IN_THE_ARDOUGNE_WINDMILL(NullObjectID.NULL_28971, new WorldPoint(2635, 3386, 2)), + OUTSIDE_THE_FALADOR_PARTY_ROOM(NullObjectID.NULL_28972, new WorldPoint(3043, 3371, 0)), + TAVERLEY_STONE_CIRCLE(NullObjectID.NULL_28973, new WorldPoint(2924, 3477, 0)), + CATHERBY_BEEHIVE_FIELD(NullObjectID.NULL_28974, new WorldPoint(2764, 3438, 0)), + NEAR_THE_PARROTS_IN_ARDOUGNE_ZOO(NullObjectID.NULL_28975, new WorldPoint(2608, 3284, 0)), + ROAD_JUNCTION_NORTH_OF_RIMMINGTON(NullObjectID.NULL_28976, new WorldPoint(2981, 3278, 0)), + OUTSIDE_THE_FISHING_GUILD(NullObjectID.NULL_28977, new WorldPoint(2608, 3393, 0)), + OUTSIDE_KEEP_LE_FAYE(NullObjectID.NULL_28978, new WorldPoint(2756, 3399, 0)), + ROAD_JUNCTION_SOUTH_OF_SINCLAIR_MANSION(NullObjectID.NULL_28979, new WorldPoint(2735, 3534, 0)), + OUTSIDE_THE_DIGSITE_EXAM_CENTRE(NullObjectID.NULL_28980, new WorldPoint(3353, 3343, 0)), + NEAR_THE_SAWMILL_OPERATORS_BOOTH(NullObjectID.NULL_28981, new WorldPoint(3298, 3490, 0)), + MUBARIZS_ROOM_AT_THE_DUEL_ARENA(NullObjectID.NULL_28982, new WorldPoint(3316, 3242, 0)), + OUTSIDE_VARROCK_PALACE_COURTYARD(NullObjectID.NULL_28983, new WorldPoint(3211, 3456, 0)), + NEAR_HERQUINS_SHOP_IN_FALADOR(NullObjectID.NULL_28984, new WorldPoint(2941, 3339, 0)), + SOUTH_OF_THE_GRAND_EXCHANGE(NullObjectID.NULL_28985, new WorldPoint(3159, 3464, 0)), + AUBURYS_SHOP_IN_VARROCK(NullObjectID.NULL_28986, new WorldPoint(3252, 3404, 0)), + CENTRE_OF_CANIFIS(NullObjectID.NULL_28987, new WorldPoint(3491, 3489, 0)), + MAUSOLEUM_OFF_THE_MORYTANIA_COAST(NullObjectID.NULL_28988, new WorldPoint(3500, 3575, 0)), + EAST_OF_THE_BARBARIAN_VILLAGE_BRIDGE(NullObjectID.NULL_28989, new WorldPoint(3110, 3422, 0)), + SOUTH_OF_THE_SHRINE_IN_TAI_BWO_WANNAI_VILLAGE(NullObjectID.NULL_28990, new WorldPoint(2802, 3081, 0)), + CASTLE_WARS_BANK(NullObjectID.NULL_28991, new WorldPoint(2444, 3093, 0)), + BARBARIAN_OUTPOST_OBSTACLE_COURSE(NullObjectID.NULL_28992, new WorldPoint(2541, 3550, 0)), + GNOME_STRONGHOLD_BALANCING_ROPE(NullObjectID.NULL_28993, new WorldPoint(2473, 3418, 2)), + OUTSIDE_YANILLE_BANK(NullObjectID.NULL_28994, new WorldPoint(2603, 3091, 0)), + OBSERVATORY(NullObjectID.NULL_28995, new WorldPoint(2439, 3166, 0)), + OGRE_CAGE_IN_KING_LATHAS_TRAINING_CAMP(NullObjectID.NULL_28996, new WorldPoint(2533, 3377, 0)), + DIGSITE(NullObjectID.NULL_28997, new WorldPoint(3370, 3420, 0)), + HICKTONS_ARCHERY_EMPORIUM(NullObjectID.NULL_28998, new WorldPoint(2825, 3441, 0)), + SHANTAY_PASS(NullObjectID.NULL_28999, new WorldPoint(3308, 3125, 0)), + LUMBRIDGE_SWAMP_CAVES(NullObjectID.NULL_29000, new WorldPoint(3222, 9584, 0), new WorldPoint(3167, 9570, 0)), + OUTSIDE_CATHERBY_BANK(NullObjectID.NULL_29001, new WorldPoint(2807, 3437, 0)), + OUTSIDE_THE_SEERS_VILLAGE_COURTHOUSE(NullObjectID.NULL_29002, new WorldPoint(2731, 3475, 0)), + OUTSIDE_HARRYS_FISHING_SHOP_IN_CATHERBY(NullObjectID.NULL_29003, new WorldPoint(2837, 3436, 0)), + TZHAAR_WEAPONS_STORE(NullObjectID.NULL_29004, new WorldPoint(2479, 5146, 0)), + NORTH_OF_EVIL_DAVES_HOUSE_IN_EDGEVILLE(NullObjectID.NULL_29005, new WorldPoint(3077, 3503, 0)), + WEST_OF_THE_SHAYZIEN_COMBAT_RING(NullObjectID.NULL_29006, new WorldPoint(1534, 3591, 0)), + ENTRANCE_OF_THE_ARCEUUS_LIBRARY(NullObjectID.NULL_29007, new WorldPoint(1642, 3809, 0)), + OUTSIDE_DRAYNOR_VILLAGE_JAIL(NullObjectID.NULL_29008, new WorldPoint(3130, 3250, 0)), + CHAOS_TEMPLE_IN_THE_SOUTHEASTERN_WILDERNESS(NullObjectID.NULL_29009, new WorldPoint(3245, 3609, 0)), + FISHING_GUILD_BANK(NullObjectID.NULL_29010, new WorldPoint(2593, 3409, 0)), + TOP_FLOOR_OF_THE_LIGHTHOUSE(NullObjectID.NULL_29011, new WorldPoint(2512, 3640, 2)), + OUTSIDE_THE_GREAT_PYRAMID_OF_SOPHANEM(NullObjectID.NULL_29012, new WorldPoint(3291, 2780, 0)), + NOTERAZZOS_SHOP_IN_THE_WILDERNESS(NullObjectID.NULL_29013, new WorldPoint(3027, 3699, 0)), + WEST_SIDE_OF_THE_KARAMJA_BANANA_PLANTATION(NullObjectID.NULL_29014, new WorldPoint(2909, 3169, 0)), + MOUNTAIN_CAMP_GOAT_ENCLOSURE(NullObjectID.NULL_29015, new WorldPoint(2810, 3677, 0)), + GNOME_GLIDER_ON_WHITE_WOLF_MOUNTAIN(NullObjectID.NULL_29016, new WorldPoint(2849, 3496, 0)), + SHILO_VILLAGE_BANK(NullObjectID.NULL_29017, new WorldPoint(2853, 2952, 0)), + INSIDE_THE_DIGSITE_EXAM_CENTRE(NullObjectID.NULL_29018, new WorldPoint(3356, 3333, 0)), + NORTHEAST_CORNER_OF_THE_KHARAZI_JUNGLE(NullObjectID.NULL_29019, new WorldPoint(2952, 2932, 0)), + VOLCANO_IN_THE_NORTHEASTERN_WILDERNESS(NullObjectID.NULL_29020, new WorldPoint(3368, 3930, 0)), + IN_THE_MIDDLE_OF_JIGGIG(NullObjectID.NULL_29021, new WorldPoint(2478, 3048, 0)), + AGILITY_PYRAMID(NullObjectID.NULL_29022, new WorldPoint(3357, 2830, 0)), + HOSIDIUS_MESS(NullObjectID.NULL_29023, new WorldPoint(1648, 3631, 0)), + CHAPEL_IN_WEST_ARDOUGNE(NullObjectID.NULL_29024, new WorldPoint(2527, 3294, 0)), + NEAR_A_RUNITE_ROCK_IN_THE_FREMENNIK_ISLES(NullObjectID.NULL_29025, new WorldPoint(2374, 3847, 0)), + NEAR_A_LADDER_IN_THE_WILDERNESS_LAVA_MAZE(NullObjectID.NULL_29026, new WorldPoint(3069, 3862, 0)), + ENTRANCE_OF_THE_CAVE_OF_DAMIS(NullObjectID.NULL_29027, new WorldPoint(2629, 5070, 0)), + WARRIORS_GUILD_BANK(NullObjectID.NULL_29028, new WorldPoint(2844, 3537, 0)), + SOUTHEAST_CORNER_OF_THE_MONASTERY(NullObjectID.NULL_29029, new WorldPoint(3056, 3482, 0)), + SOUTHEAST_CORNER_OF_THE_FISHING_PLATFORM(NullObjectID.NULL_29030, new WorldPoint(2787, 3277, 1)), + OUTSIDE_THE_SLAYER_TOWER_GARGOYLE_ROOM(NullObjectID.NULL_29031, new WorldPoint(3423, 3534, 2)), + ON_TOP_OF_TROLLHEIM_MOUNTAIN(NullObjectID.NULL_29032, new WorldPoint(2886, 3676, 0)), + FOUNTAIN_OF_HEROES(NullObjectID.NULL_29033, new WorldPoint(2916, 9891, 0)), + ENTRANCE_OF_THE_CAVERN_UNDER_THE_WHIRLPOOL(NullObjectID.NULL_29034, new WorldPoint(1764, 5367, 1), new WorldPoint(1636, 5367, 1)), + HALFWAY_DOWN_TROLLWEISS_MOUNTAIN(NullObjectID.NULL_29035, new WorldPoint(2782, 3787, 0)), + SHAYZIEN_WAR_TENT(NullObjectID.NULL_29036, new WorldPoint(1550, 3541, 0)), + OUTSIDE_THE_LEGENDS_GUILD_DOOR(NullObjectID.NULL_29037, new WorldPoint(2727, 3371, 0)), + NEAR_THE_GEM_STALL_IN_ARDOUGNE_MARKET(NullObjectID.NULL_29038, new WorldPoint(2672, 3302, 0)), + OUTSIDE_THE_BAR_BY_THE_FIGHT_ARENA(NullObjectID.NULL_29039, new WorldPoint(2571, 3150, 0)), + SOUTHEAST_CORNER_OF_LAVA_DRAGON_ISLE(NullObjectID.NULL_29040, new WorldPoint(3228, 3830, 0)), + NEAR_THE_PIER_IN_ZULANDRA(NullObjectID.NULL_29041, new WorldPoint(2203, 3059, 0)), + BARROWS_CHEST(NullObjectID.NULL_29042, new WorldPoint(3547, 9690, 0)), + WELL_OF_VOYAGE(NullObjectID.NULL_29043, new WorldPoint(2006, 4709, 1)), + NORTHERN_WALL_OF_CASTLE_DRAKAN(NullObjectID.NULL_29044, new WorldPoint(3559, 3385, 1)), + _7TH_CHAMBER_OF_JALSAVRAH(NullObjectID.NULL_29045, new WorldPoint(1951, 4431, 0)), + SOUL_ALTAR(NullObjectID.NULL_29046, new WorldPoint(1810, 3855, 0)), + WARRIORS_GUILD_BANK_29047(NullObjectID.NULL_29047, new WorldPoint(2845, 3545, 0)), + ENTRANA_CHAPEL(NullObjectID.NULL_29048, new WorldPoint(2851, 3355, 0)), + TZHAAR_GEM_STORE(NullObjectID.NULL_29049, new WorldPoint(2466, 5150, 0)), + TENT_IN_LORD_IORWERTHS_ENCAMPMENT(NullObjectID.NULL_29050, new WorldPoint(2198, 3257, 0)), + OUTSIDE_MUDKNUCKLES_HUT(NullObjectID.NULL_29051, new WorldPoint(2959, 3502, 0)), + CENTRE_OF_THE_CATACOMBS_OF_KOUREND(NullObjectID.NULL_29052, new WorldPoint(1661, 10045, 0)), + KING_BLACK_DRAGONS_LAIR(NullObjectID.NULL_29053, new WorldPoint(2286, 4680, 0)), + OUTSIDE_KRIL_TSUTSAROTHS_ROOM(NullObjectID.NULL_29054, new WorldPoint(2931, 5337, 2)), + BY_THE_BEAR_CAGE_IN_VARROCK_PALACE_GARDENS(NullObjectID.NULL_29055, new WorldPoint(3232, 3494, 0)), + OUTSIDE_THE_WILDERNESS_AXE_HUT(NullObjectID.NULL_29056, new WorldPoint(3186, 3958, 0)), + TOP_FLOOR_OF_THE_YANILLE_WATCHTOWER(NullObjectID.NULL_29057, new WorldPoint(2930, 4718, 2)), + DEATH_ALTAR(NullObjectID.NULL_29058, new WorldPoint(2210, 4842, 0)), + BEHIND_MISS_SCHISM_IN_DRAYNOR_VILLAGE(NullObjectID.NULL_29059, new WorldPoint(3095, 3254, 0)), + NORTHWESTERN_CORNER_OF_THE_ENCHANTED_VALLEY(NullObjectID.NULL_29060, new WorldPoint(3022, 4517, 0)), + NORTH_OF_MOUNT_KARUULM(NullObjectID.NULL_34647, new WorldPoint(1308, 3840, 0)), + GYPSY_TENT_ENTRANCE(NullObjectID.NULL_34736, new WorldPoint(3206, 3422, 0)), + FINE_CLOTHES_ENTRANCE(NullObjectID.NULL_34737, new WorldPoint(3209, 3416, 0)), + BOB_AXES_ENTRANCE(NullObjectID.NULL_34738, new WorldPoint(3233, 3200, 0)); + + private final int objectId; + private final WorldPoint[] worldPoints; + + STASHUnit(int objectId, WorldPoint... worldPoints) + { + this.objectId = objectId; + this.worldPoints = worldPoints; + } } From 581a05249794af363adcfad3cad74d0029650c7e Mon Sep 17 00:00:00 2001 From: xDemoN Date: Fri, 24 May 2019 06:54:23 -0400 Subject: [PATCH 08/31] Fix amulet of fury spelling error in ItemMapping.java (#8885) --- .../src/main/java/net/runelite/client/game/ItemMapping.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java index 782a77dc7f..aee270096f 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java @@ -101,8 +101,8 @@ public enum ItemMapping ITEM_ANGUISH_ORNAMENT_KIT(ANGUISH_ORNAMENT_KIT, NECKLACE_OF_ANGUISH_OR), ITEM_OCCULT_NECKLACE(OCCULT_NECKLACE, OCCULT_NECKLACE_OR), ITEM_OCCULT_ORNAMENT_KIT(OCCULT_ORNAMENT_KIT, OCCULT_NECKLACE_OR), - ITE_AMULET_OF_FURY(AMULET_OF_FURY, AMULET_OF_FURY_OR), - ITE_FURY_ORNAMENT_KIT(FURY_ORNAMENT_KIT, AMULET_OF_FURY_OR), + ITEM_AMULET_OF_FURY(AMULET_OF_FURY, AMULET_OF_FURY_OR), + ITEM_FURY_ORNAMENT_KIT(FURY_ORNAMENT_KIT, AMULET_OF_FURY_OR), ITEM_TORMENTED_BRACELET(TORMENTED_BRACELET, TORMENTED_BRACELET_OR), ITEM_TORMENTED_ORNAMENT_KIT(TORMENTED_ORNAMENT_KIT, TORMENTED_BRACELET_OR), From 62d56a097f7dcb46b457cf3390cfebfffd8d2211 Mon Sep 17 00:00:00 2001 From: Cistoran Date: Thu, 23 May 2019 07:26:14 -0600 Subject: [PATCH 09/31] worldmap: update Xeric's Glade teleport location --- .../runelite/client/plugins/worldmap/TeleportLocationData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index b877be8810..2e0852d6c0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -115,7 +115,7 @@ enum TeleportLocationData // Misc XERICS_LOOKOUT(TeleportType.OTHER, "Xeric's Talisman", "Xeric's Lookout", new WorldPoint(1576, 3528, 0), "xerics_talisman_teleport_icon.png"), - XERICS_GLADE(TeleportType.OTHER, "Xeric's Talisman", "Xeric's Glade", new WorldPoint(1773, 3502, 0), "xerics_talisman_teleport_icon.png"), + XERICS_GLADE(TeleportType.OTHER, "Xeric's Talisman", "Xeric's Glade", new WorldPoint(1754, 3564, 0), "xerics_talisman_teleport_icon.png"), XERICS_INFERNO(TeleportType.OTHER, "Xeric's Talisman", "Xeric's Inferno", new WorldPoint(1504, 3819, 0), "xerics_talisman_teleport_icon.png"), XERICS_HEART(TeleportType.OTHER, "Xeric's Talisman", "Xeric's Heart", new WorldPoint(1641, 3670, 0), "xerics_talisman_teleport_icon.png"), XERICS_HONOUR(TeleportType.OTHER, "Xeric's Talisman", "Xeric's Honour", new WorldPoint(1254, 3559, 0), "xerics_talisman_teleport_icon.png"), From f1176d5a8a28239b76e3174079e9e1f699f7dd19 Mon Sep 17 00:00:00 2001 From: Jared N <37555051+jaredn207@users.noreply.github.com> Date: Sat, 25 May 2019 00:46:13 +0900 Subject: [PATCH 10/31] menu swapper: add Hardwood Grove menu swap option --- .../menuentryswapper/MenuEntrySwapperConfig.java | 10 ++++++++++ .../menuentryswapper/MenuEntrySwapperPlugin.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java index 23ab63df16..58fc922c7b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java @@ -162,6 +162,16 @@ public interface MenuEntrySwapperConfig extends Config return FairyRingMode.LAST_DESTINATION; } + @ConfigItem( + keyName = "swapHardWoodGrove", + name = "Hardwood Grove", + description = "Swap Quick-Pay(100) and Send-Parcel at Hardwood Grove" + ) + default boolean swapHardWoodGrove() + { + return true; + } + @ConfigItem( keyName = "swapHarpoon", name = "Harpoon", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index b164d10b86..9d6cfd3fba 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -383,6 +383,11 @@ public class MenuEntrySwapperPlugin extends Plugin swap("teleport", option, target, true); } + if (config.swapHardWoodGrove() && target.contains("rionasta")) + { + swap("send-parcel", option, target, true); + } + if (config.swapBank()) { swap("bank", option, target, true); @@ -458,6 +463,10 @@ public class MenuEntrySwapperPlugin extends Plugin { swap("pay-toll(10gp)", option, target, true); } + else if (config.swapHardWoodGrove() && option.equals("open") && target.equals("hardwood grove doors")) + { + swap("quick-pay(100)", option, target, true); + } else if (config.swapTravel() && option.equals("inspect") && target.equals("trapdoor")) { swap("travel", option, target, true); From b616ef9eabc705ac1e4deafa115b26799a64df0e Mon Sep 17 00:00:00 2001 From: seandewar <6256228+seandewar@users.noreply.github.com> Date: Sat, 27 Apr 2019 01:49:35 +0100 Subject: [PATCH 11/31] opponentinfo: add option to show both hp value and percent --- .../opponentinfo/HitpointsDisplayStyle.java | 32 +++++++++++++++++++ .../opponentinfo/OpponentInfoConfig.java | 10 +++--- .../opponentinfo/OpponentInfoOverlay.java | 13 ++++++-- .../components/ProgressBarComponent.java | 20 ++++++++++-- 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/HitpointsDisplayStyle.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/HitpointsDisplayStyle.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/HitpointsDisplayStyle.java new file mode 100644 index 0000000000..0ed6649f16 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/HitpointsDisplayStyle.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019, Sean Dewar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.opponentinfo; + +public enum HitpointsDisplayStyle +{ + HITPOINTS, + PERCENTAGE, + BOTH; +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java index 82a7c5f214..07a84629c8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java @@ -43,14 +43,14 @@ public interface OpponentInfoConfig extends Config } @ConfigItem( - keyName = "showPercent", - name = "Show percent", - description = "Shows hitpoints as a percentage even if hitpoints are known", + keyName = "hitpointsDisplayStyle", + name = "Hitpoints display style", + description = "Show opponent's hitpoints as a value (if known), percentage, or both", position = 1 ) - default boolean showPercent() + default HitpointsDisplayStyle hitpointsDisplayStyle() { - return false; + return HitpointsDisplayStyle.HITPOINTS; } @ConfigItem( diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java index 63432efa20..f7945a5646 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java @@ -164,7 +164,10 @@ class OpponentInfoOverlay extends Overlay progressBarComponent.setBackgroundColor(HP_RED); progressBarComponent.setForegroundColor(HP_GREEN); - if (lastMaxHealth != null && !opponentInfoConfig.showPercent()) + final HitpointsDisplayStyle displayStyle = opponentInfoConfig.hitpointsDisplayStyle(); + + if ((displayStyle == HitpointsDisplayStyle.HITPOINTS || displayStyle == HitpointsDisplayStyle.BOTH) + && lastMaxHealth != null) { // This is the reverse of the calculation of healthRatio done by the server // which is: healthRatio = 1 + (healthScale - 1) * health / maxHealth (if health > 0, 0 otherwise) @@ -194,11 +197,15 @@ class OpponentInfoOverlay extends Overlay // so we know nothing about the upper limit except that it can't be higher than maxHealth maxHealth = lastMaxHealth; } - // Take the average of min and max possible healts + // Take the average of min and max possible healths health = (minHealth + maxHealth + 1) / 2; } - progressBarComponent.setLabelDisplayMode(ProgressBarComponent.LabelDisplayMode.FULL); + // Show both the hitpoint and percentage values if enabled in the config + final ProgressBarComponent.LabelDisplayMode progressBarDisplayMode = displayStyle == HitpointsDisplayStyle.BOTH ? + ProgressBarComponent.LabelDisplayMode.BOTH : ProgressBarComponent.LabelDisplayMode.FULL; + + progressBarComponent.setLabelDisplayMode(progressBarDisplayMode); progressBarComponent.setMaximum(lastMaxHealth); progressBarComponent.setValue(health); } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java index cadced4e96..a891eaba41 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java @@ -40,7 +40,8 @@ public class ProgressBarComponent implements LayoutableRenderableEntity public enum LabelDisplayMode { PERCENTAGE, - FULL + FULL, + BOTH } private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.0"); @@ -79,10 +80,13 @@ public class ProgressBarComponent implements LayoutableRenderableEntity switch (labelDisplayMode) { case PERCENTAGE: - textToWrite = DECIMAL_FORMAT.format(pc * 100d) + "%"; + textToWrite = formatPercentageProgress(pc); + break; + case BOTH: + textToWrite = formatFullProgress(currentValue, maximum) + " (" + formatPercentageProgress(pc) + ")"; break; default: - textToWrite = DECIMAL_FORMAT_ABS.format(Math.floor(currentValue)) + "/" + maximum; + textToWrite = formatFullProgress(currentValue, maximum); } final int width = preferredSize.width; @@ -126,4 +130,14 @@ public class ProgressBarComponent implements LayoutableRenderableEntity bounds.setSize(dimension); return dimension; } + + private static String formatFullProgress(double current, long maximum) + { + return DECIMAL_FORMAT_ABS.format(Math.floor(current)) + "/" + maximum; + } + + private static String formatPercentageProgress(double ratio) + { + return DECIMAL_FORMAT.format(ratio * 100d) + "%"; + } } From ea1b8fec971019eea194b5de28216461345912a3 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 24 May 2019 17:42:29 -0600 Subject: [PATCH 12/31] timetracking: Don't crash when seeing a garbage varbit value --- .../client/plugins/timetracking/farming/FarmingTracker.java | 5 +++++ .../plugins/timetracking/farming/PatchImplementation.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingTracker.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingTracker.java index aa4027b98e..ec32d63379 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingTracker.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingTracker.java @@ -187,6 +187,11 @@ public class FarmingTracker PatchState state = patch.getImplementation().forVarbitValue(value); + if (state == null) + { + return null; + } + int stage = state.getStage(); int stages = state.getStages(); int tickrate = state.getTickRate() * 60; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java index 8bec7a88a6..1aab9a7320 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.timetracking.farming; +import javax.annotation.Nullable; import lombok.Getter; import lombok.RequiredArgsConstructor; import net.runelite.client.plugins.timetracking.Tab; @@ -2576,6 +2577,7 @@ public enum PatchImplementation } }; + @Nullable abstract PatchState forVarbitValue(int value); private final Tab tab; From 2791d22f62504b11ee17ba847fbc68b0eeb22a71 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 24 May 2019 20:49:06 -0400 Subject: [PATCH 13/31] quest list plugin: fix removing widets on shutdown --- .../plugins/questlist/QuestListPlugin.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java index 2ebf2a4318..0a18b8d2c9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java @@ -25,6 +25,13 @@ package net.runelite.client.plugins.questlist; import com.google.common.collect.ImmutableList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.EnumMap; +import java.util.List; +import java.util.stream.Collectors; +import javax.inject.Inject; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; @@ -51,13 +58,6 @@ import net.runelite.client.game.chatbox.ChatboxTextInput; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.util.Text; -import javax.inject.Inject; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; -import java.util.stream.Collectors; @PluginDescriptor( name = "Quest List", @@ -93,6 +93,22 @@ public class QuestListPlugin extends Plugin private QuestState currentFilterState; + @Override + protected void startUp() + { + clientThread.invoke(this::addQuestButtons); + } + + @Override + protected void shutDown() + { + Widget header = client.getWidget(WidgetInfo.QUESTLIST_BOX); + if (header != null) + { + header.deleteAllChildren(); + } + } + @Subscribe public void onGameStateChanged(GameStateChanged e) { @@ -110,6 +126,11 @@ public class QuestListPlugin extends Plugin return; } + addQuestButtons(); + } + + private void addQuestButtons() + { Widget header = client.getWidget(WidgetInfo.QUESTLIST_BOX); if (header != null) { From edf3abb75bb962ab633699d2626da4ef8cb66a2a Mon Sep 17 00:00:00 2001 From: achencoms Date: Tue, 7 May 2019 13:31:29 -0400 Subject: [PATCH 14/31] client: add music list plugin and search filter Co-authored-by: Adam --- .../plugins/musiclist/MusicListPlugin.java | 286 ++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java new file mode 100644 index 0000000000..61a40bd10e --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2019, Anthony Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.musiclist; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.stream.Collectors; +import javax.inject.Inject; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.GameState; +import net.runelite.api.ScriptID; +import net.runelite.api.SoundEffectID; +import net.runelite.api.SpriteID; +import net.runelite.api.VarClientInt; +import net.runelite.api.events.GameStateChanged; +import net.runelite.api.events.VarClientIntChanged; +import net.runelite.api.events.WidgetLoaded; +import net.runelite.api.widgets.JavaScriptCallback; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetID; +import net.runelite.api.widgets.WidgetInfo; +import net.runelite.api.widgets.WidgetPositionMode; +import net.runelite.api.widgets.WidgetType; +import net.runelite.client.callback.ClientThread; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.game.chatbox.ChatboxPanelManager; +import net.runelite.client.game.chatbox.ChatboxTextInput; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; + +@PluginDescriptor( + name = "Music List", + description = "Adds search and filter for the music list" +) +public class MusicListPlugin extends Plugin +{ + @Inject + private Client client; + + @Inject + private ClientThread clientThread; + + @Inject + private ChatboxPanelManager chatboxPanelManager; + + private ChatboxTextInput searchInput; + + private Widget musicSearchButton; + private Widget musicFilterButton; + + private Collection tracks; + + private MusicState currentMusicFilter; + + @Override + protected void startUp() + { + clientThread.invoke(this::addMusicButtons); + } + + @Override + protected void shutDown() + { + Widget header = client.getWidget(WidgetInfo.MUSIC_WINDOW); + if (header != null) + { + header.deleteAllChildren(); + } + + tracks = null; + } + + @Subscribe + public void onGameStateChanged(GameStateChanged gameStateChanged) + { + if (gameStateChanged.getGameState() == GameState.LOGIN_SCREEN) + { + currentMusicFilter = MusicState.ALL; + tracks = null; + } + } + + @Subscribe + public void onWidgetLoaded(WidgetLoaded widgetLoaded) + { + if (widgetLoaded.getGroupId() == WidgetID.MUSIC_GROUP_ID) + { + addMusicButtons(); + } + } + + private void addMusicButtons() + { + Widget header = client.getWidget(WidgetInfo.MUSIC_WINDOW); + + if (header == null) + { + return; + } + + //Creation of the search and toggle status buttons + musicSearchButton = header.createChild(-1, WidgetType.GRAPHIC); + musicSearchButton.setSpriteId(SpriteID.GE_SEARCH); + musicSearchButton.setOriginalWidth(18); + musicSearchButton.setOriginalHeight(17); + musicSearchButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); + musicSearchButton.setOriginalX(5); + musicSearchButton.setOriginalY(32); + musicSearchButton.setHasListener(true); + musicSearchButton.setAction(1, "Open"); + musicSearchButton.setOnOpListener((JavaScriptCallback) e -> openSearch()); + musicSearchButton.setName("Search"); + musicSearchButton.revalidate(); + + musicFilterButton = header.createChild(-1, WidgetType.GRAPHIC); + musicFilterButton.setSpriteId(SpriteID.MINIMAP_ORB_HITPOINTS); + musicFilterButton.setOriginalWidth(15); + musicFilterButton.setOriginalHeight(15); + musicFilterButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); + musicFilterButton.setOriginalX(25); + musicFilterButton.setOriginalY(34); + musicFilterButton.setHasListener(true); + musicFilterButton.setAction(1, "Toggle"); + musicFilterButton.setOnOpListener((JavaScriptCallback) e -> toggleStatus()); + musicFilterButton.setName("All"); + musicFilterButton.revalidate(); + } + + @Subscribe + public void onVarClientIntChanged(VarClientIntChanged varClientIntChanged) + { + if (isChatboxOpen() && !isOnMusicTab()) + { + chatboxPanelManager.close(); + } + } + + private boolean isOnMusicTab() + { + return client.getVar(VarClientInt.INVENTORY_TAB) == 13; + } + + private boolean isChatboxOpen() + { + return searchInput != null && chatboxPanelManager.getCurrentInput() == searchInput; + } + + private String getChatboxInput() + { + return isChatboxOpen() ? searchInput.getValue() : ""; + } + + private void toggleStatus() + { + MusicState[] states = MusicState.values(); + currentMusicFilter = states[(currentMusicFilter.ordinal() + 1) % states.length]; + musicFilterButton.setSpriteId(currentMusicFilter.getSpriteID()); + musicFilterButton.setName(currentMusicFilter.getName()); + updateFilter(getChatboxInput()); + client.playSoundEffect(SoundEffectID.UI_BOOP); + } + + private void openSearch() + { + updateFilter(""); + client.playSoundEffect(SoundEffectID.UI_BOOP); + musicSearchButton.setAction(1, "Close"); + musicSearchButton.setOnOpListener((JavaScriptCallback) e -> closeSearch()); + searchInput = chatboxPanelManager.openTextInput("Search music list") + .onChanged(s -> clientThread.invokeLater(() -> updateFilter(s.trim()))) + .onClose(() -> + { + clientThread.invokeLater(() -> updateFilter("")); + musicSearchButton.setOnOpListener((JavaScriptCallback) e -> openSearch()); + musicSearchButton.setAction(1, "Open"); + }) + .build(); + } + + private void closeSearch() + { + updateFilter(""); + chatboxPanelManager.close(); + client.playSoundEffect(SoundEffectID.UI_BOOP); + } + + private void updateFilter(String input) + { + final Widget container = client.getWidget(WidgetInfo.MUSIC_WINDOW); + final Widget musicList = client.getWidget(WidgetInfo.MUSIC_TRACK_LIST); + + if (container == null || musicList == null) + { + return; + } + + String filter = input.toLowerCase(); + updateList(musicList, filter); + } + + private void updateList(Widget musicList, String filter) + { + if (tracks == null) + { + tracks = Arrays.stream(musicList.getDynamicChildren()) + .sorted(Comparator.comparing(Widget::getRelativeY)) + .collect(Collectors.toList()); + } + + tracks.forEach(w -> w.setHidden(true)); + + Collection relevantTracks = tracks.stream() + .filter(w -> w.getText().toLowerCase().contains(filter)) + .filter(w -> currentMusicFilter == MusicState.ALL || w.getTextColor() == currentMusicFilter.getColor()) + .collect(Collectors.toList()); + + // Original music track list has a little offset + int y = 3; + + for (Widget track : relevantTracks) + { + track.setHidden(false); + track.setOriginalY(y); + track.revalidate(); + + y += track.getHeight(); + } + + y += 3; + + int newHeight = 0; + + if (musicList.getScrollHeight() > 0) + { + newHeight = (musicList.getScrollY() * y) / musicList.getScrollHeight(); + } + + musicList.setScrollHeight(y); + musicList.revalidateScroll(); + + client.runScript( + ScriptID.UPDATE_SCROLLBAR, + WidgetInfo.MUSIC_TRACK_SCROLLBAR.getId(), + WidgetInfo.MUSIC_TRACK_LIST.getId(), + newHeight + ); + } + + @AllArgsConstructor + @Getter + private enum MusicState + { + NOT_FOUND(0xff0000, "Locked", SpriteID.MINIMAP_ORB_HITPOINTS), + FOUND(0xdc10d, "Unlocked", SpriteID.MINIMAP_ORB_HITPOINTS_POISON), + ALL(0, "All", SpriteID.MINIMAP_ORB_PRAYER); + + private final int color; + private final String name; + private final int spriteID; + } +} From acaef50b91ff709af39f2b94dccc59e4683c6f1f Mon Sep 17 00:00:00 2001 From: Austin Bryant Date: Thu, 23 May 2019 00:56:25 -0400 Subject: [PATCH 15/31] cooking plugin: fix wine fermentation timer to begin at appropriate time Co-authored-by: Adam --- .../client/plugins/cooking/CookingPlugin.java | 41 +++++++++++++------ .../plugins/cooking/CookingPluginTest.java | 30 +++----------- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cooking/CookingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/cooking/CookingPlugin.java index 93ee8e6412..a08497663d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cooking/CookingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cooking/CookingPlugin.java @@ -31,7 +31,11 @@ import java.time.Instant; import javax.inject.Inject; import lombok.AccessLevel; import lombok.Getter; +import static net.runelite.api.AnimationID.COOKING_WINE; import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; +import net.runelite.api.Player; +import net.runelite.api.events.AnimationChanged; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameTick; import net.runelite.client.config.ConfigManager; @@ -50,7 +54,8 @@ import net.runelite.client.ui.overlay.OverlayManager; @PluginDependency(XpTrackerPlugin.class) public class CookingPlugin extends Plugin { - private static final String WINE_MESSAGE = "You squeeze the grapes into the jug"; + @Inject + private Client client; @Inject private CookingConfig config; @@ -124,6 +129,27 @@ public class CookingPlugin extends Plugin } } + @Subscribe + public void onAnimationChanged(AnimationChanged animationChanged) + { + Player localPlayer = client.getLocalPlayer(); + + if (localPlayer != animationChanged.getActor()) + { + return; + } + + if (localPlayer.getAnimation() == COOKING_WINE && config.fermentTimer()) + { + if (fermentTimerSession == null) + { + fermentTimerSession = new FermentTimerSession(); + } + + fermentTimerSession.updateLastWineMakingAction(); + } + } + @Subscribe public void onChatMessage(ChatMessage event) { @@ -134,22 +160,11 @@ public class CookingPlugin extends Plugin final String message = event.getMessage(); - if (message.startsWith(WINE_MESSAGE) && config.fermentTimer()) - { - if (fermentTimerSession == null) - { - fermentTimerSession = new FermentTimerSession(); - } - - fermentTimerSession.updateLastWineMakingAction(); - } - if (message.startsWith("You successfully cook") || message.startsWith("You successfully bake") || message.startsWith("You manage to cook") || message.startsWith("You roast a") - || message.startsWith("You cook") - || message.startsWith(WINE_MESSAGE)) + || message.startsWith("You cook")) { if (cookingSession == null) { diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/cooking/CookingPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/cooking/CookingPluginTest.java index 067c02943c..d23fd934c0 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/cooking/CookingPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/cooking/CookingPluginTest.java @@ -29,12 +29,11 @@ import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import javax.inject.Inject; import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; import net.runelite.api.events.ChatMessage; import net.runelite.client.ui.overlay.OverlayManager; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.mockito.Mockito.when; import org.junit.Before; import org.junit.Test; @@ -52,13 +51,16 @@ public class CookingPluginTest "You cook the karambwan. It looks delicious.", "You roast a lobster.", "You cook a bass.", - "You squeeze the grapes into the jug. The wine begins to ferment.", "You successfully bake a tasty garden pie." }; @Inject CookingPlugin cookingPlugin; + @Mock + @Bind + Client client; + @Mock @Bind CookingConfig config; @@ -94,26 +96,4 @@ public class CookingPluginTest assertNotNull(cookingSession); assertEquals(COOKING_MESSAGES.length, cookingSession.getCookAmount()); } - - @Test - public void testFermentTimerOnChatMessage() - { - when(config.fermentTimer()).thenReturn(true); - ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", COOKING_MESSAGES[6], "", 0); - cookingPlugin.onChatMessage(chatMessage); - FermentTimerSession fermentTimerSession = cookingPlugin.getFermentTimerSession(); - - assertNotNull(fermentTimerSession); - } - - @Test - public void testFermentTimerOnChatMessage_pluginDisabled() - { - when(config.fermentTimer()).thenReturn(false); - ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", COOKING_MESSAGES[6], "", 0); - cookingPlugin.onChatMessage(chatMessage); - FermentTimerSession fermentTimerSession = cookingPlugin.getFermentTimerSession(); - - assertNull(fermentTimerSession); - } } \ No newline at end of file From 4f82be9691b8240a8a7dae0c1654e5566c17edd1 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 25 May 2019 18:02:56 -0400 Subject: [PATCH 16/31] xtea service: fix bulk query returning duplicates Some rows have backfilled times that are duplicates, causing the join to join multiple rows. Assume ids only increment and fetch the row with the highest id instead, and join on id. --- .../java/net/runelite/http/service/xtea/XteaService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http-service/src/main/java/net/runelite/http/service/xtea/XteaService.java b/http-service/src/main/java/net/runelite/http/service/xtea/XteaService.java index 92ec5a6dd8..61650b4e51 100644 --- a/http-service/src/main/java/net/runelite/http/service/xtea/XteaService.java +++ b/http-service/src/main/java/net/runelite/http/service/xtea/XteaService.java @@ -184,9 +184,9 @@ public class XteaService try (Connection con = sql2o.open()) { return con.createQuery( - "select t1.region, t1.time, t2.rev, t2.key1, t2.key2, t2.key3, t2.key4 from " + - "(select region,max(time) as time from xtea group by region) t1 " + - "join xtea t2 on t1.region = t2.region and t1.time = t2.time") + "select t1.region, t2.time, t2.rev, t2.key1, t2.key2, t2.key3, t2.key4 from " + + "(select region,max(id) as id from xtea group by region) t1 " + + "join xtea t2 on t1.id = t2.id") .executeAndFetch(XteaEntry.class); } } From 0211149ce2de166baec1014bdc6e8c0a9cf13013 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 25 May 2019 20:26:27 -0400 Subject: [PATCH 17/31] clanchat plugin: add clan tab chat option This allows typing messages with the clanchat tab focused without having to prepend them with '/'. --- .../client/plugins/clanchat/ClanChatConfig.java | 11 +++++++++++ .../client/plugins/clanchat/ClanChatPlugin.java | 14 ++++++++++++++ .../src/main/scripts/CommandScript.rs2asm | 5 +++++ 3 files changed, 30 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatConfig.java index 5fdd7996be..393008f7fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatConfig.java @@ -126,4 +126,15 @@ public interface ClanChatConfig extends Config { return false; } + + @ConfigItem( + keyName = "clanTabChat", + name = "Clan Tab Chat", + description = "Allows clan chat without prepending '/' to messages when on clan tab", + position = 8 + ) + default boolean clanTabChat() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatPlugin.java index fcc8728e92..d166916b7e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChatPlugin.java @@ -60,6 +60,7 @@ import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.PlayerDespawned; import net.runelite.api.events.PlayerSpawned; +import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.events.VarClientStrChanged; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; @@ -491,6 +492,19 @@ public class ClanChatPlugin extends Plugin activityBuffer.clear(); } + @Subscribe + public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent) + { + if (!scriptCallbackEvent.getEventName().equalsIgnoreCase("clanchatInput")) + { + return; + } + + final int[] intStack = client.getIntStack(); + final int size = client.getIntStackSize(); + intStack[size - 1] = config.clanTabChat() ? 1 : 0; + } + int getClanAmount() { return clanMembers.size(); diff --git a/runelite-client/src/main/scripts/CommandScript.rs2asm b/runelite-client/src/main/scripts/CommandScript.rs2asm index 0926703d6b..1c523d5aa2 100644 --- a/runelite-client/src/main/scripts/CommandScript.rs2asm +++ b/runelite-client/src/main/scripts/CommandScript.rs2asm @@ -37,6 +37,11 @@ LABEL20: invoke 1972 iconst 1 if_icmpeq LABEL31 + iconst 0 ; Modified to enable clanchat input + sconst "clanchatInput" + runelite_callback + iconst 1 + if_icmpeq LABEL31 ; Compare to 1 jump LABEL37 LABEL31: get_varc_int 41 From da260fb8b263db23717d2898353c61dee6356d13 Mon Sep 17 00:00:00 2001 From: osrs-music-map Date: Sun, 26 May 2019 10:51:56 -0400 Subject: [PATCH 18/31] chat filter: add options to filter friends and clan members Also no longer ever filter messages from the local player Co-authored-by: Adam --- .../plugins/chatfilter/ChatFilterConfig.java | 23 ++++++++ .../plugins/chatfilter/ChatFilterPlugin.java | 26 ++++++++- .../src/main/scripts/ChatBuilder.rs2asm | 2 + .../src/main/scripts/ChatSplitBuilder.rs2asm | 6 +- .../chatfilter/ChatFilterPluginTest.java | 56 +++++++++++++++++++ 5 files changed, 108 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterConfig.java index abc1747b4a..264e5ae425 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterConfig.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Magic fTail + * Copyright (c) 2019, osrs-music-map * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,4 +64,26 @@ public interface ChatFilterConfig extends Config { return ""; } + + @ConfigItem( + keyName = "filterFriends", + name = "Filter Friends", + description = "Filter your friends' messages", + position = 4 + ) + default boolean filterFriends() + { + return false; + } + + @ConfigItem( + keyName = "filterClan", + name = "Filter Clan Chat Members", + description = "Filter your clan chat members' messages", + position = 5 + ) + default boolean filterClan() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java index 3f49a1f7e4..690669cc54 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Magic fTail + * Copyright (c) 2019, osrs-music-map * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +36,7 @@ import java.util.regex.PatternSyntaxException; import javax.inject.Inject; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; +import net.runelite.api.MessageNode; import net.runelite.api.Player; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.OverheadTextChanged; @@ -97,7 +99,10 @@ public class ChatFilterPlugin extends Plugin int[] intStack = client.getIntStack(); int intStackSize = client.getIntStackSize(); - ChatMessageType chatMessageType = ChatMessageType.of(intStack[intStackSize - 1]); + int messageType = intStack[intStackSize - 2]; + int messageId = intStack[intStackSize - 1]; + + ChatMessageType chatMessageType = ChatMessageType.of(messageType); // Only filter public chat and private messages switch (chatMessageType) @@ -113,6 +118,13 @@ public class ChatFilterPlugin extends Plugin return; } + MessageNode messageNode = (MessageNode) client.getMessages().get(messageId); + String name = messageNode.getName(); + if (!shouldFilterPlayerMessage(name)) + { + return; + } + String[] stringStack = client.getStringStack(); int stringStackSize = client.getStringStackSize(); @@ -122,7 +134,7 @@ public class ChatFilterPlugin extends Plugin if (censoredMessage == null) { // Block the message - intStack[intStackSize - 2] = 0; + intStack[intStackSize - 3] = 0; } else { @@ -134,7 +146,7 @@ public class ChatFilterPlugin extends Plugin @Subscribe public void onOverheadTextChanged(OverheadTextChanged event) { - if (!(event.getActor() instanceof Player)) + if (!(event.getActor() instanceof Player) || !shouldFilterPlayerMessage(event.getActor().getName())) { return; } @@ -149,6 +161,14 @@ public class ChatFilterPlugin extends Plugin event.getActor().setOverheadText(message); } + boolean shouldFilterPlayerMessage(String playerName) + { + boolean isMessageFromSelf = playerName.equals(client.getLocalPlayer().getName()); + return !isMessageFromSelf && + (config.filterFriends() || !client.isFriended(playerName, false)) && + (config.filterClan() || !client.isClanMember(playerName)); + } + String censorMessage(final String message) { String strippedMessage = jagexPrintableCharMatcher.retainFrom(message) diff --git a/runelite-client/src/main/scripts/ChatBuilder.rs2asm b/runelite-client/src/main/scripts/ChatBuilder.rs2asm index c30307da67..2e0bc1d37c 100644 --- a/runelite-client/src/main/scripts/ChatBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatBuilder.rs2asm @@ -189,8 +189,10 @@ CHAT_FILTER: sload 11 ; Load the message iconst 1 ; Gets changed to 0 if message is blocked iload 10 ; Load the messageType + iload 9 ; Load the id of the messageNode sconst "chatFilterCheck" runelite_callback + pop_int ; Pop the id of the messageNode pop_int ; Pop the messageType iconst 1 ; 2nd half of conditional sstore 11 ; Override the message with our filtered message diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm index 45b420248d..73badbb543 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm @@ -359,9 +359,11 @@ CHAT_FILTER: sload 0 ; Load the message iconst 1 ; Gets changed to 0 if message is blocked iload 15 ; Load the messageType + iload 12 ; Load the id of the messageNode sconst "chatFilterCheck" - runelite_callback - pop_int ; Pop the messageType + runelite_callback + pop_int ; Pop the id of the messageNode + pop_int ; Pop the messageType iconst 1 ; 2nd half of conditional sstore 0 ; Override the message with our filtered message if_icmpeq LABEL327 ; Check if we are building this message diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatfilter/ChatFilterPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatfilter/ChatFilterPluginTest.java index 2fe4d88e05..a12a8b257b 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatfilter/ChatFilterPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatfilter/ChatFilterPluginTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, Adam + * Copyright (c) 2019, osrs-music-map * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,8 +30,11 @@ import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import javax.inject.Inject; import net.runelite.api.Client; +import net.runelite.api.Player; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -49,6 +53,10 @@ public class ChatFilterPluginTest @Bind private ChatFilterConfig chatFilterConfig; + @Mock + @Bind + private Player localPlayer; + @Inject private ChatFilterPlugin chatFilterPlugin; @@ -60,6 +68,7 @@ public class ChatFilterPluginTest when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_WORDS); when(chatFilterConfig.filteredWords()).thenReturn(""); when(chatFilterConfig.filteredRegex()).thenReturn(""); + when(client.getLocalPlayer()).thenReturn(localPlayer); } @Test @@ -110,4 +119,51 @@ public class ChatFilterPluginTest chatFilterPlugin.updateFilteredPatterns(); assertNull(chatFilterPlugin.censorMessage("te\u008Cst")); } + + @Test + public void testMessageFromFriendIsFiltered() + { + when(client.isFriended("Iron Mammal", false)).thenReturn(true); + when(chatFilterConfig.filterFriends()).thenReturn(true); + assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Iron Mammal")); + } + + @Test + public void testMessageFromFriendIsNotFiltered() + { + when(client.isFriended("Iron Mammal", false)).thenReturn(true); + when(chatFilterConfig.filterFriends()).thenReturn(false); + assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("Iron Mammal")); + } + + @Test + public void testMessageFromClanIsFiltered() + { + when(client.isClanMember("B0aty")).thenReturn(true); + when(chatFilterConfig.filterClan()).thenReturn(true); + assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("B0aty")); + } + + @Test + public void testMessageFromClanIsNotFiltered() + { + when(client.isClanMember("B0aty")).thenReturn(true); + when(chatFilterConfig.filterClan()).thenReturn(false); + assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("B0aty")); + } + + @Test + public void testMessageFromSelfIsNotFiltered() + { + when(localPlayer.getName()).thenReturn("Swampletics"); + assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("Swampletics")); + } + + @Test + public void testMessageFromNonFriendNonClanIsFiltered() + { + when(client.isFriended("Woox", false)).thenReturn(false); + when(client.isClanMember("Woox")).thenReturn(false); + assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Woox")); + } } \ No newline at end of file From 2800a226a11641143a0a193519bea94c1c9a4b6a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 25 May 2019 21:48:52 -0400 Subject: [PATCH 19/31] client: fix spec bar not updating with hide auto retaliate on Move the widget listener from the auto retaliate text to the spec bar, so when auto retaliate is hidden the listeners still function. --- .../net/runelite/api/widgets/WidgetID.java | 1 + .../net/runelite/api/widgets/WidgetInfo.java | 1 + .../src/main/scripts/CombatInterfaceSP.hash | 1 + .../src/main/scripts/CombatInterfaceSP.rs2asm | 29 +++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 runelite-client/src/main/scripts/CombatInterfaceSP.hash create mode 100644 runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index 523c0335c8..50e388076c 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -533,6 +533,7 @@ public class WidgetID static final int SPELL_ICON = 27; static final int SPELL_TEXT = 28; static final int AUTO_RETALIATE = 29; + static final int SPEC_BAR = 34; } static class VolcanicMine diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 78bb2832b4..058e9aa05a 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -313,6 +313,7 @@ public enum WidgetInfo COMBAT_SPELL_ICON(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPELL_ICON), COMBAT_SPELL_TEXT(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPELL_TEXT), COMBAT_AUTO_RETALIATE(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.AUTO_RETALIATE), + COMBAT_SPEC_BAR(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPEC_BAR), // Used by CombatInterfaceSP.rs2asm DIALOG_OPTION(WidgetID.DIALOG_OPTION_GROUP_ID, 0), diff --git a/runelite-client/src/main/scripts/CombatInterfaceSP.hash b/runelite-client/src/main/scripts/CombatInterfaceSP.hash new file mode 100644 index 0000000000..e92e5b127b --- /dev/null +++ b/runelite-client/src/main/scripts/CombatInterfaceSP.hash @@ -0,0 +1 @@ +DDFE4E407122EEEAE2C64A233EA937B2CC20E92D66CB66772C31182A6C60820D \ No newline at end of file diff --git a/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm b/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm new file mode 100644 index 0000000000..9f908245af --- /dev/null +++ b/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm @@ -0,0 +1,29 @@ +.id 327 +.int_stack_count 1 +.string_stack_count 0 +.int_var_count 1 +.string_var_count 0 + ; Attach specbar redraw listeners to special attack bar instead of to + ; auto retaliate text (which is var0). Test by enabling "Hide auto retaliate" + ; and using a spec. + iconst 38862882 ; 593.34 - spec bar + istore 0 ; overwrite script parameter which is the autoretail text + iload 0 + invoke 187 + iconst 186 + iload 0 + iconst 301 + iconst 300 + iconst 284 + iconst 3 + sconst "IY" + iload 0 + if_setonvartransmit + iconst 186 + iload 0 + iconst 94 + iconst 1 + sconst "IY" + iload 0 + if_setoninvtransmit + return From 4778afc9c08f207eecb5bfd4e2200106bafa9757 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 27 May 2019 10:23:18 -0400 Subject: [PATCH 20/31] spec counter: ignore non attacakble npcs --- .../specialcounter/SpecialCounterPlugin.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java index 4f1041a67b..59330554c1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java @@ -36,6 +36,7 @@ import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; import net.runelite.api.NPC; +import net.runelite.api.NPCComposition; import net.runelite.api.Player; import net.runelite.api.Skill; import net.runelite.api.VarPlayer; @@ -51,6 +52,7 @@ import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; import net.runelite.client.ws.PartyService; import net.runelite.client.ws.WSClient; +import org.apache.commons.lang3.ArrayUtils; @PluginDescriptor( name = "Special Attack Counter", @@ -181,7 +183,16 @@ public class SpecialCounterPlugin extends Plugin if (interacting instanceof NPC) { - int interactingId = ((NPC) interacting).getId(); + NPC npc = (NPC) interacting; + NPCComposition composition = npc.getComposition(); + int interactingId = npc.getId(); + + if (!ArrayUtils.contains(composition.getActions(), "Attack")) + { + // Skip over non attackable npcs so that eg. talking to bankers doesn't reset + // the counters. + return -1; + } if (!interactedNpcIds.contains(interactingId)) { From 11ba76f5bc27dce717dac2a162d89a6bd15be093 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 16 May 2019 22:17:02 -0700 Subject: [PATCH 21/31] plugins panel: Add wiki link to name labels This adds a hover color effect and a popup menu linking to the plugin's wiki page to each plugin name label both in the plugin panel and configuration panels. In the plugin panel, for plugins which have configurable settings, it also adds a "Configure" menu item to the added popup menu. Fixes runelite/runelite#1518 --- .../client/plugins/config/ConfigPanel.java | 3 +- .../client/plugins/config/PluginListItem.java | 103 +++++++++++++++++- 2 files changed, 103 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java index cfd5fca7c6..ebaa54e7cb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java @@ -311,6 +311,7 @@ public class ConfigPanel extends PluginPanel JLabel title = new JLabel(name); title.setForeground(Color.WHITE); title.setToolTipText("" + name + ":
    " + listItem.getDescription() + ""); + PluginListItem.addLabelPopupMenu(title, PluginListItem.wikiLinkMenuItem(listItem.getName())); topPanel.add(title); for (ConfigItemDescriptor cid : cd.getItems()) @@ -704,4 +705,4 @@ public class ConfigPanel extends PluginPanel } } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java index 64b97a6ab8..092b4c9c92 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java @@ -26,30 +26,43 @@ package net.runelite.client.plugins.config; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.GridLayout; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; import javax.swing.ImageIcon; import javax.swing.JLabel; +import javax.swing.JMenuItem; import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.border.EmptyBorder; import lombok.AccessLevel; import lombok.Getter; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigDescriptor; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.PluginPanel; import net.runelite.client.ui.components.IconButton; import net.runelite.client.util.ImageUtil; +import net.runelite.client.util.LinkBrowser; import org.apache.commons.text.similarity.JaroWinklerDistance; class PluginListItem extends JPanel { private static final JaroWinklerDistance DISTANCE = new JaroWinklerDistance(); + private static final String RUNELITE_WIKI_FORMAT = "https://github.com/runelite/runelite/wiki/%s"; private static final ImageIcon CONFIG_ICON; private static final ImageIcon CONFIG_ICON_HOVER; @@ -149,6 +162,8 @@ class PluginListItem extends JPanel Collections.addAll(keywords, description.toLowerCase().split(" ")); Collections.addAll(keywords, tags); + final List popupMenuItems = new ArrayList<>(); + setLayout(new BorderLayout(3, 0)); setPreferredSize(new Dimension(PluginPanel.PANEL_WIDTH, 20)); @@ -160,7 +175,6 @@ class PluginListItem extends JPanel nameLabel.setToolTipText("" + name + ":
    " + description + ""); } - add(nameLabel, BorderLayout.CENTER); pinButton.setPreferredSize(new Dimension(21, 0)); add(pinButton, BorderLayout.LINE_START); @@ -186,13 +200,21 @@ class PluginListItem extends JPanel configButton.addActionListener(e -> { configButton.setIcon(CONFIG_ICON); - configPanel.openGroupConfigPanel(PluginListItem.this, config, configDescriptor); + openGroupConfigPanel(); }); configButton.setVisible(true); configButton.setToolTipText("Edit plugin configuration"); + + final JMenuItem configMenuItem = new JMenuItem("Configure"); + configMenuItem.addActionListener(e -> openGroupConfigPanel()); + popupMenuItems.add(configMenuItem); } + popupMenuItems.add(wikiLinkMenuItem(name)); + addLabelPopupMenu(nameLabel, popupMenuItems); + add(nameLabel, BorderLayout.CENTER); + toggleButton.setPreferredSize(new Dimension(25, 0)); attachToggleButtonListener(toggleButton); buttonPanel.add(toggleButton); @@ -267,4 +289,81 @@ class PluginListItem extends JPanel } return true; } + + private void openGroupConfigPanel() + { + configPanel.openGroupConfigPanel(PluginListItem.this, config, configDescriptor); + } + + /** + * Adds a mouseover effect to change the text of the passed label to {@link ColorScheme#BRAND_ORANGE} color, and + * adds the passed menu item to a popup menu shown when the label is clicked. + * + * @param label The label to attach the mouseover and click effects to + * @param menuItem The menu item to be shown when the label is clicked + */ + static void addLabelPopupMenu(final JLabel label, final JMenuItem menuItem) + { + addLabelPopupMenu(label, Collections.singletonList(menuItem)); + } + + /** + * Adds a mouseover effect to change the text of the passed label to {@link ColorScheme#BRAND_ORANGE} color, and + * adds the passed menu items to a popup menu shown when the label is clicked. + * + * @param label The label to attach the mouseover and click effects to + * @param menuItems The menu items to be shown when the label is clicked + */ + static void addLabelPopupMenu(final JLabel label, final Collection menuItems) + { + final JPopupMenu menu = new JPopupMenu(); + menu.setBorder(new EmptyBorder(5, 5, 5, 5)); + + for (final JMenuItem menuItem : menuItems) + { + menu.add(menuItem); + } + + label.addMouseListener(new MouseAdapter() + { + private Color lastForeground; + + @Override + public void mouseClicked(MouseEvent mouseEvent) + { + Component source = (Component) mouseEvent.getSource(); + Point location = MouseInfo.getPointerInfo().getLocation(); + SwingUtilities.convertPointFromScreen(location, source); + menu.show(source, location.x, location.y); + } + + @Override + public void mouseEntered(MouseEvent mouseEvent) + { + lastForeground = label.getForeground(); + label.setForeground(ColorScheme.BRAND_ORANGE); + } + + @Override + public void mouseExited(MouseEvent mouseEvent) + { + label.setForeground(lastForeground); + } + }); + } + + /** + * Creates a menu item for linking to a wiki page which, when clicked, opens a link to the plugin's wiki page for + * the passed plugin name. + * + * @param pluginName The name of the plugin which should be linked to + * @return A {@link JMenuItem} which opens the plugin's wiki page URL in the browser when clicked + */ + static JMenuItem wikiLinkMenuItem(final String pluginName) + { + final JMenuItem menuItem = new JMenuItem("Wiki"); + final String sanitizedName = pluginName.replace(' ', '-'); + menuItem.addActionListener(e -> LinkBrowser.browse(String.format(RUNELITE_WIKI_FORMAT, sanitizedName))); + return menuItem; + } } From 8903b849bc330430fc796683f4842846361e78f5 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Wed, 22 May 2019 18:33:02 +0200 Subject: [PATCH 22/31] Add support for center label to ProgressBarComponent Signed-off-by: Tomas Slusny --- .../components/ProgressBarComponent.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java index a891eaba41..01f52d6ad0 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ProgressBarComponent.java @@ -24,6 +24,7 @@ */ package net.runelite.client.ui.overlay.components; +import com.google.common.base.Strings; import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; @@ -41,6 +42,7 @@ public class ProgressBarComponent implements LayoutableRenderableEntity { PERCENTAGE, FULL, + TEXT_ONLY, BOTH } @@ -53,6 +55,7 @@ public class ProgressBarComponent implements LayoutableRenderableEntity private long maximum = 100; private double value; private LabelDisplayMode labelDisplayMode = LabelDisplayMode.PERCENTAGE; + private String centerLabel; private String leftLabel; private String rightLabel; private Color foregroundColor = new Color(82, 161, 82); @@ -75,20 +78,34 @@ public class ProgressBarComponent implements LayoutableRenderableEntity final long span = maximum - minimum; final double currentValue = value - minimum; final double pc = currentValue / span; - final String textToWrite; + String textToWrite; switch (labelDisplayMode) { + case TEXT_ONLY: + textToWrite = ""; + break; case PERCENTAGE: textToWrite = formatPercentageProgress(pc); break; case BOTH: textToWrite = formatFullProgress(currentValue, maximum) + " (" + formatPercentageProgress(pc) + ")"; break; + case FULL: default: textToWrite = formatFullProgress(currentValue, maximum); } + if (!Strings.isNullOrEmpty(centerLabel)) + { + if (!textToWrite.isEmpty()) + { + textToWrite += " "; + } + + textToWrite += centerLabel; + } + final int width = preferredSize.width; final int height = Math.max(preferredSize.height, 16); final int progressTextX = barX + (width - metrics.stringWidth(textToWrite)) / 2; From 7217d3f962298b25a5544e2c1349eeb25f948a15 Mon Sep 17 00:00:00 2001 From: Jacky Liang <37294123+jkybtw@users.noreply.github.com> Date: Tue, 28 May 2019 18:22:23 +1000 Subject: [PATCH 23/31] Add camulet teleport icon to worldmap (#8934) --- .../plugins/worldmap/TeleportLocationData.java | 1 + .../plugins/worldmap/camulet_teleport_icon.png | Bin 0 -> 447 bytes 2 files changed, 1 insertion(+) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index 2e0852d6c0..ab2035ae74 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -138,6 +138,7 @@ enum TeleportLocationData PHARAOHS_SCEPTRE_JALSAVRAH(TeleportType.OTHER, "Pharaoh's Sceptre", "Jalsavrah (Pyramid Plunder)", new WorldPoint(3288, 2795, 0), "pharaohs_sceptre_teleport_icon.png"), PHARAOHS_SCEPTRE_JALEUSTROPHOS(TeleportType.OTHER, "Pharaoh's Sceptre", "Jaleustrophos (Agility Pyramid)", new WorldPoint(3341, 2827, 0), "pharaohs_sceptre_teleport_icon.png"), PHARAOHS_SCEPTRE_JALDRAOCHT(TeleportType.OTHER, "Pharaoh's Sceptre", "Jaldraocht (Desert Treasure Pyramid)", new WorldPoint(3232, 2897, 0), "pharaohs_sceptre_teleport_icon.png"), + CAMULET_TEMPLE(TeleportType.OTHER, "Camulet", "Enakhra's Temple", new WorldPoint(3190, 2923, 0), "camulet_teleport_icon.png"), // Wilderness OBELISK_13(TeleportType.OTHER, "Obelisk", "13", new WorldPoint(3156, 3620, 0), "obelisk_icon.png"), diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7a74119cc85f5f19c8f94051b41e5d566b321918 GIT binary patch literal 447 zcmV;w0YLtVP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0aQsuK~y+TV`RVz z82>{VNZ>z)S~LNOrv3Z(fqBTl(a{OYLKuRinejh1P3Qn(2*d!WX6zaR{M{H@O5_-L zdBqs+KKjBSrj*K{qoWHqfCZuq6BOk7G1yuwGw9e(2lM3(fZo|$%Fw;;K9~;zOxSFF z`t&J-l^HKXaT!D-3^@9BGweP30U9QZ|ACq@K}}UE!>xx}P#yxTS{%=S91TD}BW(Wm z?Hj|n(~B8+1-Ka4{~l%#5MX8a^XEUquV4Qee*gW?z$H}8AS){iRtxesip|@$&1ZP{ z=n;beCnv+Rw+0N0)(9}js7+%~(wWYnu0I2=5e85+|NSe>;Ob<>@Z!mLhJ{N`F_e|H zLS?W6l&E51Im+5|7CRZ^q004iSe$QrMgPH&U002ovPDHLkV1hMSxYqyx literal 0 HcmV?d00001 From 0f79e85433bd84cb186ea0cd4bab3a475de2de06 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 28 May 2019 08:16:29 -0400 Subject: [PATCH 24/31] clue plugin: update Hosidius clue hint from rework --- .../client/plugins/cluescrolls/clues/CoordinateClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index 05748f87ae..861958613b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -148,7 +148,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(3573, 3425, 0), "North of Dessous's tomb from Desert Treasure.") .put(new WorldPoint(3828, 2848, 0), "East of Harmony Island.") .put(new WorldPoint(3225, 2838, 0), "South of Desert Treasure pyramid.") - .put(new WorldPoint(1773, 3510, 0), "Between magic trees South of Tithe Farm.") + .put(new WorldPoint(1773, 3510, 0), "Ruins north of the Hosidius mine.") .put(new WorldPoint(3822, 3562, 0), "North-east of Dragontooth Island.") .put(new WorldPoint(3603, 3564, 0), "North of the wrecked ship, outside of Port Phasmatys.") .put(new WorldPoint(2936, 2721, 0), "Eastern shore of Crash Island.") From 5ec52d359106bb77277adaf64c3b0f91c17d9177 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Wed, 29 May 2019 09:43:35 +0100 Subject: [PATCH 25/31] Fix Hosidius Easy Cryptic clue after rework (#8940) The Hosidius Rework moved this clue slightly north west, and into the kitchens --- .../runelite/client/plugins/cluescrolls/clues/CrypticClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java index a8129cce78..583d99fae8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java @@ -298,7 +298,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("I would make a chemistry joke, but I'm afraid I wouldn't get a reaction.", "Chemist", new WorldPoint(2932, 3212, 0), "Talk to the Chemist in Rimmington"), new CrypticClue("Show this to Hazelmere.", "Hazelmere", new WorldPoint(2677, 3088, 1), "Hazelmere is found upstairs on the island located just east of Yanille."), new CrypticClue("Does one really need a fire to stay warm here?", new WorldPoint(3816, 3810, 0), "Dig next to the fire near the Volcanic Mine entrance."), - new CrypticClue("Search the open crate found in a small farmhouse in Hosidius. Cabbages grow outside.", CRATE_27533, new WorldPoint(1687, 3628, 0), "The house is north-east of the general store in Hosidius."), + new CrypticClue("Search the open crate found in the Hosidius kitchens.", CRATE_27533, new WorldPoint(1683, 3616, 0), "The kitchens are north-west of the town in Hosidius."), new CrypticClue("Dig under Ithoi's cabin.", new WorldPoint(2529, 2838, 0), "Dig under Ithoi's cabin in the Corsair Cove."), new CrypticClue("Search the drawers, upstairs in the bank to the East of Varrock.", DRAWERS_7194, new WorldPoint(3250, 3420, 1), "Search the drawers upstairs in Varrock east bank."), new CrypticClue("Speak to Hazelmere.", "Hazelmere", new WorldPoint(2677, 3088, 1), "Located upstairs in the house to the north of fairy ring CLS. Answer: 6859"), From 81050f264a5c92b7cfed1875a9109dc4e9bf6f67 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Tue, 28 May 2019 19:06:09 -0700 Subject: [PATCH 26/31] attack styles: Attach spec bar redraw listener to weapon text This fixes a bug where the special attack bar would not be redrawn if the combat tab was opened with any weapon equipped which did not have a special attack bar. The weapon text widget is used because it is always rendered with the combat tab widgets, and does not already have any kind of listeners attached. Fixes runelite/runelite#8946 --- .../src/main/java/net/runelite/api/widgets/WidgetID.java | 1 - .../src/main/java/net/runelite/api/widgets/WidgetInfo.java | 1 - runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index 50e388076c..523c0335c8 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -533,7 +533,6 @@ public class WidgetID static final int SPELL_ICON = 27; static final int SPELL_TEXT = 28; static final int AUTO_RETALIATE = 29; - static final int SPEC_BAR = 34; } static class VolcanicMine diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 058e9aa05a..78bb2832b4 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -313,7 +313,6 @@ public enum WidgetInfo COMBAT_SPELL_ICON(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPELL_ICON), COMBAT_SPELL_TEXT(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPELL_TEXT), COMBAT_AUTO_RETALIATE(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.AUTO_RETALIATE), - COMBAT_SPEC_BAR(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPEC_BAR), // Used by CombatInterfaceSP.rs2asm DIALOG_OPTION(WidgetID.DIALOG_OPTION_GROUP_ID, 0), diff --git a/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm b/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm index 9f908245af..fae9b4e230 100644 --- a/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm +++ b/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm @@ -3,10 +3,10 @@ .string_stack_count 0 .int_var_count 1 .string_var_count 0 - ; Attach specbar redraw listeners to special attack bar instead of to + ; Attach specbar redraw listeners to the weapon name text instead of to ; auto retaliate text (which is var0). Test by enabling "Hide auto retaliate" ; and using a spec. - iconst 38862882 ; 593.34 - spec bar + iconst 38862849 ; 593.1 - weapon name widget istore 0 ; overwrite script parameter which is the autoretail text iload 0 invoke 187 From 764f26ec6ed75a600cc9f63f2ed2e0d26c53bc29 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 30 May 2019 10:33:10 +0000 Subject: [PATCH 27/31] Update Item IDs to 2019-05-30-rev180 --- .../main/java/net/runelite/api/ItemID.java | 61 +++++++++++++++++++ .../java/net/runelite/api/NullItemID.java | 34 +---------- 2 files changed, 62 insertions(+), 33 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/ItemID.java b/runelite-api/src/main/java/net/runelite/api/ItemID.java index 813c354a01..517d093058 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -6618,6 +6618,7 @@ public final class ItemID public static final int NO_EGGS = 10563; public static final int GRANITE_BODY = 10564; public static final int FIRE_CAPE_10566 = 10566; + public static final int HEALER_ICON_10567 = 10567; public static final int KERIS = 10581; public static final int KERISP = 10582; public static final int KERISP_10583 = 10583; @@ -9483,6 +9484,7 @@ public final class ItemID public static final int KINDLING_20799 = 20799; public static final int EMPTY_GOURD_VIAL = 20800; public static final int WATERFILLED_GOURD_VIAL = 20801; + public static final int HEALER_ICON_20802 = 20802; public static final int SNOW_GLOBE = 20832; public static final int SACK_OF_PRESENTS = 20834; public static final int GIANT_PRESENT = 20836; @@ -10305,6 +10307,14 @@ public final class ItemID public static final int ANCIENT_MEDALLION = 22299; public static final int ANCIENT_EFFIGY = 22302; public static final int ANCIENT_RELIC = 22305; + public static final int HEALER_ICON_22308 = 22308; + public static final int HEALER_ICON_22309 = 22309; + public static final int HEALER_ICON_22310 = 22310; + public static final int HEALER_ICON_22311 = 22311; + public static final int COLLECTOR_ICON_22312 = 22312; + public static final int COLLECTOR_ICON_22313 = 22313; + public static final int COLLECTOR_ICON_22314 = 22314; + public static final int COLLECTOR_ICON_22315 = 22315; public static final int PROP_SWORD = 22316; public static final int PET_CORPOREAL_CRITTER = 22318; public static final int TZREKZUK = 22319; @@ -10321,6 +10331,19 @@ public final class ItemID public static final int STARTER_SWORD = 22331; public static final int STARTER_BOW = 22333; public static final int STARTER_STAFF = 22335; + public static final int COLLECTOR_ICON_22337 = 22337; + public static final int COLLECTOR_ICON_22338 = 22338; + public static final int COLLECTOR_ICON_22339 = 22339; + public static final int DEFENDER_ICON_22340 = 22340; + public static final int DEFENDER_ICON_22341 = 22341; + public static final int DEFENDER_ICON_22342 = 22342; + public static final int DEFENDER_ICON_22343 = 22343; + public static final int DEFENDER_ICON_22344 = 22344; + public static final int DEFENDER_ICON_22345 = 22345; + public static final int ATTACKER_ICON_22346 = 22346; + public static final int ATTACKER_ICON_22347 = 22347; + public static final int ATTACKER_ICON_22348 = 22348; + public static final int ATTACKER_ICON_22349 = 22349; public static final int EGGSHELL_PLATEBODY = 22351; public static final int EGGSHELL_PLATELEGS = 22353; public static final int HOLY_HANDEGG = 22355; @@ -10487,6 +10510,16 @@ public final class ItemID public static final int TREE_TOP = 22715; public static final int TREE_SKIRT = 22717; public static final int CANDY_CANE = 22719; + public static final int ATTACKER_ICON_22721 = 22721; + public static final int ATTACKER_ICON_22722 = 22722; + public static final int ATTACKER_ICON_22723 = 22723; + public static final int COLLECTOR_ICON_22724 = 22724; + public static final int DEFENDER_ICON_22725 = 22725; + public static final int DEFENDER_ICON_22726 = 22726; + public static final int DEFENDER_ICON_22727 = 22727; + public static final int DEFENDER_ICON_22728 = 22728; + public static final int ATTACKER_ICON_22729 = 22729; + public static final int ATTACKER_ICON_22730 = 22730; public static final int DRAGON_HASTA = 22731; public static final int DRAGON_HASTAP = 22734; public static final int DRAGON_HASTAP_22737 = 22737; @@ -10791,5 +10824,33 @@ public final class ItemID public static final int TORMENTED_BRACELET_OR = 23444; public static final int GIANT_EASTER_EGG = 23446; public static final int BUNNYMAN_MASK = 23448; + public static final int ENCHANTED_LYREI = 23458; + public static final int ATTACKER_ICON_23460 = 23460; + public static final int ATTACKER_ICON_23461 = 23461; + public static final int ATTACKER_ICON_23462 = 23462; + public static final int ATTACKER_ICON_23463 = 23463; + public static final int ATTACKER_ICON_23464 = 23464; + public static final int ATTACKER_ICON_23465 = 23465; + public static final int DEFENDER_ICON_23466 = 23466; + public static final int DEFENDER_ICON_23467 = 23467; + public static final int DEFENDER_ICON_23468 = 23468; + public static final int DEFENDER_ICON_23469 = 23469; + public static final int DEFENDER_ICON_23470 = 23470; + public static final int COLLECTOR_ICON_23471 = 23471; + public static final int COLLECTOR_ICON_23472 = 23472; + public static final int COLLECTOR_ICON_23473 = 23473; + public static final int COLLECTOR_ICON_23474 = 23474; + public static final int COLLECTOR_ICON_23475 = 23475; + public static final int COLLECTOR_ICON_23476 = 23476; + public static final int COLLECTOR_ICON_23477 = 23477; + public static final int HEALER_ICON_23478 = 23478; + public static final int HEALER_ICON_23479 = 23479; + public static final int HEALER_ICON_23480 = 23480; + public static final int HEALER_ICON_23481 = 23481; + public static final int HEALER_ICON_23482 = 23482; + public static final int HEALER_ICON_23483 = 23483; + public static final int HEALER_ICON_23484 = 23484; + public static final int HEALER_ICON_23485 = 23485; + public static final int HEALER_ICON_23486 = 23486; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullItemID.java b/runelite-api/src/main/java/net/runelite/api/NullItemID.java index 1bc9028389..9007300837 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -3834,7 +3834,6 @@ public final class NullItemID public static final int NULL_10509 = 10509; public static final int NULL_10511 = 10511; public static final int NULL_10565 = 10565; - public static final int NULL_10567 = 10567; public static final int NULL_10568 = 10568; public static final int NULL_10569 = 10569; public static final int NULL_10570 = 10570; @@ -11132,7 +11131,6 @@ public final class NullItemID public static final int NULL_20793 = 20793; public static final int NULL_20795 = 20795; public static final int NULL_20797 = 20797; - public static final int NULL_20802 = 20802; public static final int NULL_20803 = 20803; public static final int NULL_20804 = 20804; public static final int NULL_20805 = 20805; @@ -11816,32 +11814,11 @@ public final class NullItemID public static final int NULL_22304 = 22304; public static final int NULL_22306 = 22306; public static final int NULL_22307 = 22307; - public static final int NULL_22308 = 22308; - public static final int NULL_22309 = 22309; - public static final int NULL_22310 = 22310; - public static final int NULL_22311 = 22311; - public static final int NULL_22312 = 22312; - public static final int NULL_22313 = 22313; - public static final int NULL_22314 = 22314; - public static final int NULL_22315 = 22315; public static final int NULL_22317 = 22317; public static final int NULL_22329 = 22329; public static final int NULL_22332 = 22332; public static final int NULL_22334 = 22334; public static final int NULL_22336 = 22336; - public static final int NULL_22337 = 22337; - public static final int NULL_22338 = 22338; - public static final int NULL_22339 = 22339; - public static final int NULL_22340 = 22340; - public static final int NULL_22341 = 22341; - public static final int NULL_22342 = 22342; - public static final int NULL_22343 = 22343; - public static final int NULL_22344 = 22344; - public static final int NULL_22345 = 22345; - public static final int NULL_22346 = 22346; - public static final int NULL_22347 = 22347; - public static final int NULL_22348 = 22348; - public static final int NULL_22349 = 22349; public static final int NULL_22350 = 22350; public static final int NULL_22352 = 22352; public static final int NULL_22354 = 22354; @@ -12047,16 +12024,6 @@ public final class NullItemID public static final int NULL_22716 = 22716; public static final int NULL_22718 = 22718; public static final int NULL_22720 = 22720; - public static final int NULL_22721 = 22721; - public static final int NULL_22722 = 22722; - public static final int NULL_22723 = 22723; - public static final int NULL_22724 = 22724; - public static final int NULL_22725 = 22725; - public static final int NULL_22726 = 22726; - public static final int NULL_22727 = 22727; - public static final int NULL_22728 = 22728; - public static final int NULL_22729 = 22729; - public static final int NULL_22730 = 22730; public static final int NULL_22732 = 22732; public static final int NULL_22733 = 22733; public static final int NULL_22735 = 22735; @@ -12456,5 +12423,6 @@ public final class NullItemID public static final int NULL_23455 = 23455; public static final int NULL_23456 = 23456; public static final int NULL_23457 = 23457; + public static final int NULL_23459 = 23459; /* This file is automatically generated. Do not edit. */ } From 2555c35736f9e1bff1f17ba44bba128732d715a9 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 30 May 2019 10:33:10 +0000 Subject: [PATCH 28/31] Update Item variations to 2019-05-30-rev180 --- .../src/main/resources/item_variations.json | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index 81603408c9..8105a02ee2 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -3243,7 +3243,8 @@ 6125, 6126, 6127, - 13079 + 13079, + 23458 ], "branch": [ 3692, @@ -6912,6 +6913,78 @@ 10555, 20515 ], + "attacker icon": [ + 10556, + 22346, + 22347, + 22348, + 22349, + 22721, + 22722, + 22723, + 22729, + 22730, + 23460, + 23461, + 23462, + 23463, + 23464, + 23465 + ], + "collector icon": [ + 10557, + 22312, + 22313, + 22314, + 22315, + 22337, + 22338, + 22339, + 22724, + 23471, + 23472, + 23473, + 23474, + 23475, + 23476, + 23477 + ], + "defender icon": [ + 10558, + 22340, + 22341, + 22342, + 22343, + 22344, + 22345, + 22725, + 22726, + 22727, + 22728, + 23466, + 23467, + 23468, + 23469, + 23470 + ], + "healer icon": [ + 10559, + 10567, + 20802, + 22308, + 22309, + 22310, + 22311, + 23478, + 23479, + 23480, + 23481, + 23482, + 23483, + 23484, + 23485, + 23486 + ], "keris": [ 10581, 10582, From eaedc7a4ed8a449421000548460384a9db7962bc Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 30 May 2019 10:33:17 +0000 Subject: [PATCH 29/31] Update Widget IDs to 2019-05-30-rev180 --- .../net/runelite/api/widgets/WidgetID.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index 523c0335c8..0c1c2697a8 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -519,20 +519,20 @@ public class WidgetID static class Combat { static final int WEAPON_NAME = 1; - static final int LEVEL = 2; - static final int STYLE_ONE = 3; - static final int STYLE_TWO = 7; - static final int STYLE_THREE = 11; - static final int STYLE_FOUR = 15; - static final int SPELLS = 19; - static final int DEFENSIVE_SPELL_BOX = 20; - static final int DEFENSIVE_SPELL_ICON = 22; - static final int DEFENSIVE_SPELL_SHIELD = 23; - static final int DEFENSIVE_SPELL_TEXT = 24; - static final int SPELL_BOX = 25; - static final int SPELL_ICON = 27; - static final int SPELL_TEXT = 28; - static final int AUTO_RETALIATE = 29; + static final int LEVEL = 3; + static final int STYLE_ONE = 4; + static final int STYLE_TWO = 8; + static final int STYLE_THREE = 12; + static final int STYLE_FOUR = 16; + static final int SPELLS = 20; + static final int DEFENSIVE_SPELL_BOX = 21; + static final int DEFENSIVE_SPELL_ICON = 23; + static final int DEFENSIVE_SPELL_SHIELD = 24; + static final int DEFENSIVE_SPELL_TEXT = 25; + static final int SPELL_BOX = 26; + static final int SPELL_ICON = 28; + static final int SPELL_TEXT = 29; + static final int AUTO_RETALIATE = 30; } static class VolcanicMine From 0d3e7049cc24f7d093126f741c2ba50a38b5a642 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 30 May 2019 11:09:37 +0000 Subject: [PATCH 30/31] [maven-release-plugin] prepare release runelite-parent-1.5.25 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- protocol-api/pom.xml | 2 +- protocol/pom.xml | 2 +- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-mixins/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- runescape-api/pom.xml | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index a8a1ad514a..bcc74e3e2b 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 95e8efbb7a..db981661b7 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 8ba9aaf1e2..7c1c3bb967 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 9cfe444424..99712e7e05 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 2178d7b2ca..74b7ed0acd 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 Web Service diff --git a/pom.xml b/pom.xml index 66f0a9491d..66e11d7358 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 pom RuneLite @@ -59,7 +59,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.5.25 diff --git a/protocol-api/pom.xml b/protocol-api/pom.xml index 7921cd6527..33fa9a1b7d 100644 --- a/protocol-api/pom.xml +++ b/protocol-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 protocol-api diff --git a/protocol/pom.xml b/protocol/pom.xml index 56bf7a91e5..1fde2036db 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 protocol diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 628b777879..5663fc7274 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 993d1b43ff..b3c545e0b7 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 client diff --git a/runelite-mixins/pom.xml b/runelite-mixins/pom.xml index a22ac12e1f..0e9fc1fd87 100644 --- a/runelite-mixins/pom.xml +++ b/runelite-mixins/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 mixins diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 7b64643772..917e4fe4ba 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 script-assembler-plugin diff --git a/runescape-api/pom.xml b/runescape-api/pom.xml index 7d49ad3e13..2af067bd83 100644 --- a/runescape-api/pom.xml +++ b/runescape-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25-SNAPSHOT + 1.5.25 net.runelite.rs From ac19fd56b787cd857309b5fbd699929769033196 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 30 May 2019 11:09:43 +0000 Subject: [PATCH 31/31] [maven-release-plugin] prepare for next development iteration --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- protocol-api/pom.xml | 2 +- protocol/pom.xml | 2 +- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-mixins/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- runescape-api/pom.xml | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index bcc74e3e2b..64c481e76e 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index db981661b7..ac51e66b60 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 7c1c3bb967..7d8dcdc50c 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 99712e7e05..15c03eac36 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 74b7ed0acd..7b44773033 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index 66e11d7358..6945299616 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT pom RuneLite @@ -59,7 +59,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.5.25 + HEAD diff --git a/protocol-api/pom.xml b/protocol-api/pom.xml index 33fa9a1b7d..7a47b77618 100644 --- a/protocol-api/pom.xml +++ b/protocol-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT protocol-api diff --git a/protocol/pom.xml b/protocol/pom.xml index 1fde2036db..995b2d62ad 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT protocol diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 5663fc7274..37c849d760 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index b3c545e0b7..54af5f8af3 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT client diff --git a/runelite-mixins/pom.xml b/runelite-mixins/pom.xml index 0e9fc1fd87..76f1de5792 100644 --- a/runelite-mixins/pom.xml +++ b/runelite-mixins/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT mixins diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 917e4fe4ba..e4c9962294 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT script-assembler-plugin diff --git a/runescape-api/pom.xml b/runescape-api/pom.xml index 2af067bd83..f7bd6163c5 100644 --- a/runescape-api/pom.xml +++ b/runescape-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.25 + 1.5.26-SNAPSHOT net.runelite.rs