From 929f054f2a1b73764a86644bf66da7ca7887c005 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Sat, 13 Feb 2021 14:45:18 -0500 Subject: [PATCH 01/33] ItemMapping: Add Trailblazer Graceful Ornament Kits --- .../main/java/net/runelite/client/game/ItemMapping.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 58f9a917a5..c8694b7153 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 @@ -281,6 +281,14 @@ public enum ItemMapping ITEM_GRACEFUL_BOOTS(MARK_OF_GRACE, true, 32L, GRACEFUL_BOOTS), ITEM_GRACEFUL_CAPE(MARK_OF_GRACE, true, 32L, GRACEFUL_CAPE), + // Trailblazer Graceful Ornament Kit + ITEM_TRAILBLAZER_GRACEFUL_HOOD(TRAILBLAZER_GRACEFUL_ORNAMENT_KIT, GRACEFUL_HOOD_25069), + ITEM_TRAILBLAZER_GRACEFUL_TOP(TRAILBLAZER_GRACEFUL_ORNAMENT_KIT, GRACEFUL_TOP_25075), + ITEM_TRAILBLAZER_GRACEFUL_LEGS(TRAILBLAZER_GRACEFUL_ORNAMENT_KIT, GRACEFUL_LEGS_25078), + ITEM_TRAILBLAZER_GRACEFUL_GLOVES(TRAILBLAZER_GRACEFUL_ORNAMENT_KIT, GRACEFUL_GLOVES_25081), + ITEM_TRAILBLAZER_GRACEFUL_BOOTS(TRAILBLAZER_GRACEFUL_ORNAMENT_KIT, GRACEFUL_BOOTS_25084), + ITEM_TRAILBLAZER_GRACEFUL_CAPE(TRAILBLAZER_GRACEFUL_ORNAMENT_KIT, GRACEFUL_CAPE_25072), + // 10 golden nuggets = 100 soft clay ITEM_GOLDEN_NUGGET(SOFT_CLAY, true, 10L, GOLDEN_NUGGET), ITEM_PROSPECTOR_HELMET(GOLDEN_NUGGET, true, 32L, PROSPECTOR_HELMET), From 8a728c1053e174bbbf15648446824e20fea99fe5 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 13 Feb 2021 22:32:06 -0500 Subject: [PATCH 02/33] key remapping: set press enter to chat text regardless of chatbox focus I can't figure out why this was originally added, but this shouldn't care about the chatbox focus state since the script event is in the script which builds the chatbox input widget. This is currently causing an issue where the input rebuild script runs immediately before the chatbox input keylistener is reapplied when closing input dialogs. --- .../client/plugins/keyremapping/KeyRemappingPlugin.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java index a1b1034b26..6a8d060b9c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java @@ -162,12 +162,9 @@ public class KeyRemappingPlugin extends Plugin { case SCRIPT_EVENT_SET_CHATBOX_INPUT: Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT); - if (chatboxInput != null) + if (chatboxInput != null && !typing) { - if (chatboxFocused() && !typing) - { - setChatboxWidgetInput(chatboxInput, PRESS_ENTER_TO_CHAT); - } + setChatboxWidgetInput(chatboxInput, PRESS_ENTER_TO_CHAT); } break; case SCRIPT_EVENT_BLOCK_CHAT_INPUT: From 29f2e621dc5a787d7324b83e4fb18de63d9383e7 Mon Sep 17 00:00:00 2001 From: Kyle Shepherd Date: Mon, 15 Feb 2021 02:02:26 +0000 Subject: [PATCH 03/33] menu entry swapper: Add portal nexus teleport menu swap (#13181) --- .../menuentryswapper/MenuEntrySwapperConfig.java | 11 +++++++++++ .../menuentryswapper/MenuEntrySwapperPlugin.java | 8 ++++++++ 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 63b2e569b5..8923237ce7 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 @@ -342,6 +342,17 @@ public interface MenuEntrySwapperConfig extends Config return false; } + @ConfigItem( + keyName = "swapPortalNexus", + name = "Portal Nexus", + description = "Swap Teleport options with Teleport Menu on the Portal Nexus", + section = objectSection + ) + default boolean swapPortalNexus() + { + return false; + } + @ConfigItem( keyName = "swapPrivate", name = "Private", 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 b6cb75aa15..a3228959cc 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 @@ -304,6 +304,14 @@ public class MenuEntrySwapperPlugin extends Plugin swap("teleport menu", "draynor village", config::swapJewelleryBox); swap("teleport menu", "al kharid", config::swapJewelleryBox); + Arrays.asList( + "annakarl", "ape atoll dungeon", "ardougne", "barrows", "battlefront", "camelot", "carrallangar", + "catherby", "cemetery", "draynor manor", "falador", "fenkenstrain's castle", "fishing guild", "ghorrock", + "grand exchange", "great kourend", "harmony island", "kharyrll", "lumbridge", "lumbridge graveyard", + "lunar isle", "marim", "mind altar", "salve graveyard", "seers' village", "senntisten", "troll stronghold", + "varrock", "watchtower", "waterbirth island", "weiss", "west ardougne", "yanille" + ).forEach(location -> swap(location, "portal nexus", "teleport menu", config::swapPortalNexus)); + swap("shared", "private", config::swapPrivate); swap("pick", "pick-lots", config::swapPick); From 4cf953d5009357a63b21f2a0ec0eb5b36e8092a9 Mon Sep 17 00:00:00 2001 From: NJohnsonJ <37092015+NJohnsonJ@users.noreply.github.com> Date: Sun, 14 Feb 2021 20:43:39 -0600 Subject: [PATCH 04/33] AgilityShortcut: Remove Catherby grapple world map tooltip (#13215) --- .../src/main/java/net/runelite/client/game/AgilityShortcut.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java index 5833b05a37..926e780be4 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java +++ b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java @@ -117,7 +117,7 @@ public enum AgilityShortcut BRIMHAVEN_DUNGEON_MEDIUM_PIPE(34, "Pipe Squeeze", null, new WorldPoint(2698, 9501, 0), PIPE_21727), KOUREND_CATACOMBS_NORTH_EAST_CREVICE_NORTH(34, "Crevice", new WorldPoint(1715, 10057, 0), CRACK_28892), KOUREND_CATACOMBS_NORTH_EAST_CREVICE_SOUTH(34, "Crevice", new WorldPoint(1705, 10077, 0), CRACK_28892), - CATHERBY_OBELISK_GRAPPLE(36, "Grapple Rock", new WorldPoint(2841, 3434, 0), CROSSBOW_TREE_17062), + CATHERBY_OBELISK_GRAPPLE(36, "Grapple Rock", null, CROSSBOW_TREE_17062), GNOME_STRONGHOLD_ROCKS(37, "Rocks", new WorldPoint(2485, 3515, 0), ROCKS_16534, ROCKS_16535), AL_KHARID_MINING_PITCLIFF_SCRAMBLE(38, "Rocks", new WorldPoint(3305, 3315, 0), ROCKS_16549, ROCKS_16550), YANILLE_WALL_GRAPPLE(39, "Grapple Wall", new WorldPoint(2552, 3072, 0), WALL_17047), From 0b993b635c079075d4bdc287842ee336d77fa660 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 14 Feb 2021 22:09:48 -0500 Subject: [PATCH 05/33] clues: make isle of souls hotcold location a master step --- .../plugins/cluescrolls/clues/hotcold/HotColdLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java index 74e71b934d..287ca3844a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java @@ -96,7 +96,7 @@ public enum HotColdLocation FREMENNIK_PROVINCE_LUNAR_VILLAGE(new WorldPoint(2084, 3916, 0), FREMENNIK_PROVINCE, "Lunar Isle, inside the village.", ANCIENT_WIZARDS), FREMENNIK_PROVINCE_LUNAR_NORTH(new WorldPoint(2106, 3949, 0), FREMENNIK_PROVINCE, "Lunar Isle, north of the village.", ANCIENT_WIZARDS), ICE_MOUNTAIN(new WorldPoint(3007, 3475, 0), MISTHALIN, "Atop Ice Mountain"), - ISLE_OF_SOULS_MINE(new WorldPoint(2189, 2794, 0), KANDARIN, "Isle of Souls Mine, south of the Soul Wars lobby"), + ISLE_OF_SOULS_MINE(new WorldPoint(2189, 2794, 0), KANDARIN, "Isle of Souls Mine, south of the Soul Wars lobby", BRASSICAN_MAGE), KANDARIN_SINCLAR_MANSION(new WorldPoint(2730, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut.", BRASSICAN_MAGE), KANDARIN_CATHERBY(new WorldPoint(2774, 3436, 0), KANDARIN, "Catherby, between the bank and the beehives, near small rock formation.", BRASSICAN_MAGE), KANDARIN_GRAND_TREE(new WorldPoint(2448, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure.", BRASSICAN_MAGE), From 611ba3976447041f68ec0c8904ee97d62d7105fe Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 14 Feb 2021 18:25:28 -0500 Subject: [PATCH 06/33] object indicators: fix marking multilocs after var changes If a var changes after the marked objects are loaded, causing the object's name to match a marked object, it would not be identified due to it not firing spawn events --- .../objectindicators/ColorTileObject.java | 9 ++++++++ .../ObjectIndicatorsOverlay.java | 13 +++++++++++ .../ObjectIndicatorsPlugin.java | 22 ++++++++++--------- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ColorTileObject.java b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ColorTileObject.java index 1af342cd20..b1641a4885 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ColorTileObject.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ColorTileObject.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.objectindicators; import java.awt.Color; import lombok.RequiredArgsConstructor; import lombok.Value; +import net.runelite.api.ObjectComposition; import net.runelite.api.TileObject; /** @@ -38,5 +39,13 @@ import net.runelite.api.TileObject; class ColorTileObject { private final TileObject tileObject; + /** + * Non-transformed object composition for the object + */ + private final ObjectComposition composition; + /** + * Name to highlight for multilocs + */ + private final String name; private final Color color; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsOverlay.java index 0e52edf0a4..980e9317d9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsOverlay.java @@ -33,6 +33,7 @@ import net.runelite.api.Client; import net.runelite.api.DecorativeObject; import net.runelite.api.GameObject; import net.runelite.api.GroundObject; +import net.runelite.api.ObjectComposition; import net.runelite.api.TileObject; import net.runelite.api.WallObject; import net.runelite.client.ui.overlay.Overlay; @@ -71,6 +72,18 @@ class ObjectIndicatorsOverlay extends Overlay continue; } + ObjectComposition composition = colorTileObject.getComposition(); + if (composition.getImpostorIds() != null) + { + // This is a multiloc + composition = composition.getImpostor(); + // Only mark the object if the name still matches + if (composition == null || !composition.getName().equals(colorTileObject.getName())) + { + continue; + } + } + if (color == null || !config.rememberObjectColors()) { // Fallback to the current config if the object is marked before the addition of multiple colors diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java index cfa99092a8..6e24212005 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java @@ -292,16 +292,15 @@ public class ObjectIndicatorsPlugin extends Plugin { if (worldPoint.getRegionX() == objectPoint.getRegionX() && worldPoint.getRegionY() == objectPoint.getRegionY() - && worldPoint.getPlane() == objectPoint.getZ()) + && worldPoint.getPlane() == objectPoint.getZ() + && objectPoint.getId() == object.getId()) { - // Transform object to get the name which matches against what we've stored - ObjectComposition composition = getObjectComposition(object.getId()); - if (composition != null && objectPoint.getName().equals(composition.getName())) - { - log.debug("Marking object {} due to matching {}", object, objectPoint); - objects.add(new ColorTileObject(object, objectPoint.getColor())); - break; - } + log.debug("Marking object {} due to matching {}", object, objectPoint); + objects.add(new ColorTileObject(object, + client.getObjectDefinition(object.getId()), + objectPoint.getName(), + objectPoint.getColor())); + break; } } } @@ -415,7 +414,10 @@ public class ObjectIndicatorsPlugin extends Plugin else { objectPoints.add(point); - objects.add(new ColorTileObject(object, color)); + objects.add(new ColorTileObject(object, + client.getObjectDefinition(object.getId()), + name, + color)); log.debug("Marking object: {}", point); } From 7f65922747d90b1513932d715b0d8a0e1cff3ae6 Mon Sep 17 00:00:00 2001 From: Patrick Watts Date: Mon, 15 Feb 2021 10:41:08 +0400 Subject: [PATCH 07/33] crowdsourcing: Improve woodcutting and cooking tracking (#13099) --- .../cooking/CrowdsourcingCooking.java | 6 ++ .../woodcutting/CrowdsourcingWoodcutting.java | 65 +++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java index 37058b5dbe..749ead8ea9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java @@ -75,10 +75,16 @@ public class CrowdsourcingCooking // Message prefixes taken from CookingPlugin if (message.startsWith("You successfully cook") || message.startsWith("You successfully bake") + || message.startsWith("You successfully fry") || message.startsWith("You manage to cook") || message.startsWith("You roast a") + || message.startsWith("You spit-roast") || message.startsWith("You cook") + || message.startsWith("You burn") + || message.startsWith("Eventually the Jubbly") + || message.startsWith("Unfortunately the Jubbly") || message.startsWith("You accidentally burn") + || message.startsWith("You half-cook") || message.startsWith("You accidentally spoil")) { boolean inHosidiusKitchen = false; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java index 8defbe2b0d..2a52784764 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java @@ -55,25 +55,85 @@ public class CrowdsourcingWoodcutting private static final String INVENTORY_FULL_MESSAGE = "Your inventory is too full to hold any more logs."; private static final String NEST_MESSAGE = "A bird's nest falls out of the tree"; private static final Set TREE_OBJECTS = new ImmutableSet.Builder(). + add(ObjectID.OAK). add(ObjectID.OAK_10820). + add(ObjectID.OAK_8467). + add(ObjectID.OAK_9734). + add(ObjectID.YEW). + add(ObjectID.YEW_TREE_8513). + add(ObjectID.TREE). + add(ObjectID.TREE_1277). add(ObjectID.TREE_1278). + add(ObjectID.TREE_1279). + add(ObjectID.TREE_1280). + add(ObjectID.DEAD_TREE). + add(ObjectID.DEAD_TREE_1283). + add(ObjectID.DEAD_TREE_1284). + add(ObjectID.DEAD_TREE_1285). + add(ObjectID.DEAD_TREE_1286). + add(ObjectID.DEAD_TREE_1289). + add(ObjectID.DEAD_TREE_1290). + add(ObjectID.DEAD_TREE_1291). + add(ObjectID.EVERGREEN). + add(ObjectID.EVERGREEN_1319). + add(ObjectID.TREE_1330). + add(ObjectID.TREE_1331). + add(ObjectID.TREE_1332). + add(ObjectID.DEAD_TREE_1365). + add(ObjectID.DEAD_TREE_1383). + add(ObjectID.DEAD_TREE_1384). + add(ObjectID.EVERGREEN_2091). + add(ObjectID.EVERGREEN_2092). + add(ObjectID.TREE_2409). + add(ObjectID.TREE_3879). + add(ObjectID.TREE_3881). + add(ObjectID.TREE_3882). + add(ObjectID.TREE_3883). + add(ObjectID.DEAD_TREE_5902). + add(ObjectID.DEAD_TREE_5903). + add(ObjectID.DEAD_TREE_5904). + add(ObjectID.TREE_9730). + add(ObjectID.TREE_9731). + add(ObjectID.TREE_9732). + add(ObjectID.TREE_9733). + add(ObjectID.TREE_10041). + add(ObjectID.TREE_14308). + add(ObjectID.TREE_14309). + add(ObjectID.TREE_16264). + add(ObjectID.TREE_16265). + add(ObjectID.EVERGREEN_27060). + add(ObjectID.BURNT_TREE). + add(ObjectID.BURNT_TREE_30854). + + add(ObjectID.MATURE_JUNIPER_TREE). + add(ObjectID.WILLOW). add(ObjectID.WILLOW_10829). add(ObjectID.WILLOW_10831). add(ObjectID.WILLOW_10833). + add(ObjectID.WILLOW_TREE_8488). add(ObjectID.SCRAPEY_TREE). add(ObjectID.JUNGLE_TREE_15951). add(ObjectID.JUNGLE_TREE_15954). add(ObjectID.JUNGLE_TREE_15948). add(ObjectID.MAPLE_TREE_10832). + add(ObjectID.MAPLE_TREE_4674). + add(ObjectID.MAPLE_TREE_8444). add(ObjectID.MAHOGANY). add(ObjectID.TEAK). + add(ObjectID.TEAK_15062). add(ObjectID.MAGIC_TREE_10834). + add(ObjectID.MAGIC_TREE_8409). add(ObjectID.HOLLOW_TREE_10821). add(ObjectID.HOLLOW_TREE_10830). add(ObjectID.ACHEY_TREE). + add(ObjectID.REDWOOD). + add(ObjectID.REDWOOD_29670). + add(ObjectID.BRUMA_ROOTS). + add(ObjectID.ARCTIC_PINE). + add(ObjectID.SULLIUSCEP). build(); private static final Map AXE_ANIMS = new ImmutableMap.Builder(). @@ -103,8 +163,13 @@ public class CrowdsourcingWoodcutting add("You get some mahogany logs and give them to Carpenter Kjallak."). add("You get some yew logs."). add("You get some magic logs."). + add("You get some redwood logs."). add("You get some scrapey tree logs."). add("You get some bark."). + add("You get a bruma root."). + add("You get an arctic pine log"). + add("You get some juniper logs."). + add("You get some mushrooms."). build(); @Inject From 14f939a3b59e85a2b0cfbfde16bf4624ead747b1 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Tue, 9 Feb 2021 11:52:58 -0700 Subject: [PATCH 08/33] ConfigManager: don't allow access to partially loaded configs If you did a getConfiguration while the config was being loaded from the client you could get a value from the new config or the old config. Since some plugins would check profile values from the ConfigChange events being posted it could cause the ConfigManager to observe an unset rsprofile.loginSalt, which would make it generate a new one, overwriting the one the server had, causing all profiles to be lost. --- .../runelite/client/config/ConfigManager.java | 186 ++++++++---------- 1 file changed, 84 insertions(+), 102 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java index 549ef0b123..b4bc89c2da 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java @@ -27,7 +27,6 @@ package net.runelite.client.config; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; import com.google.common.collect.ComparisonChain; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; @@ -128,9 +127,10 @@ public class ConfigManager private final Client client; private final ConfigInvocationHandler handler = new ConfigInvocationHandler(this); - private final Properties properties = new Properties(); private final Map pendingChanges = new HashMap<>(); + private Properties properties = new Properties(); + // null => we need to make a new profile @Nullable private String rsProfileKey; @@ -225,35 +225,14 @@ public class ConfigManager return; } - handler.invalidate(); - properties.clear(); - + Properties newProperties = new Properties(); for (ConfigEntry entry : configuration.getConfig()) { - log.debug("Loading configuration value from client {}: {}", entry.getKey(), entry.getValue()); - - String[] split = splitKey(entry.getKey()); - if (split == null) - { - continue; - } - - final String groupName = split[KEY_SPLITTER_GROUP]; - final String profile = split[KEY_SPLITTER_PROFILE]; - final String key = split[KEY_SPLITTER_KEY]; - final String value = entry.getValue(); - final String oldValue = (String) properties.setProperty(entry.getKey(), value); - - ConfigChanged configChanged = new ConfigChanged(); - configChanged.setGroup(groupName); - configChanged.setProfile(profile); - configChanged.setKey(key); - configChanged.setOldValue(oldValue); - configChanged.setNewValue(value); - eventBus.post(configChanged); + newProperties.setProperty(entry.getKey(), entry.getValue()); } - migrateConfig(); + log.debug("Loading in config from server"); + swapProperties(newProperties, false); try { @@ -267,7 +246,64 @@ public class ConfigManager } } - private synchronized void syncPropertiesFromFile(File propertiesFile) + private void swapProperties(Properties newProperties, boolean saveToServer) + { + Set allKeys = new HashSet<>(newProperties.keySet()); + + Properties oldProperties; + synchronized (this) + { + handler.invalidate(); + oldProperties = properties; + this.properties = newProperties; + } + + updateRSProfile(); + + allKeys.addAll(oldProperties.keySet()); + + for (Object wholeKey : allKeys) + { + String[] split = splitKey((String) wholeKey); + if (split == null) + { + continue; + } + + String groupName = split[KEY_SPLITTER_GROUP]; + String profile = split[KEY_SPLITTER_PROFILE]; + String key = split[KEY_SPLITTER_KEY]; + String oldValue = (String) oldProperties.get(wholeKey); + String newValue = (String) newProperties.get(wholeKey); + + if (Objects.equals(oldValue, newValue)) + { + continue; + } + + log.debug("Loading configuration value {}: {}", wholeKey, newValue); + + ConfigChanged configChanged = new ConfigChanged(); + configChanged.setGroup(groupName); + configChanged.setProfile(profile); + configChanged.setKey(key); + configChanged.setOldValue(oldValue); + configChanged.setNewValue(newValue); + eventBus.post(configChanged); + + if (saveToServer) + { + synchronized (pendingChanges) + { + pendingChanges.put((String) wholeKey, newValue); + } + } + } + + migrateConfig(); + } + + private void syncPropertiesFromFile(File propertiesFile) { final Properties properties = new Properties(); try (FileInputStream in = new FileInputStream(propertiesFile)) @@ -276,44 +312,12 @@ public class ConfigManager } catch (Exception e) { - log.debug("Malformed properties, skipping update"); + log.warn("Malformed properties, skipping update"); return; } - final Map copy = (Map) ImmutableMap.copyOf(this.properties); - copy.forEach((wholeKey, value) -> - { - if (!properties.containsKey(wholeKey)) - { - String[] split = splitKey(wholeKey); - if (split == null) - { - return; - } - - String groupName = split[KEY_SPLITTER_GROUP]; - String profile = split[KEY_SPLITTER_PROFILE]; - String key = split[KEY_SPLITTER_KEY]; - unsetConfiguration(groupName, profile, key); - } - }); - - properties.forEach((wholeKey, objValue) -> - { - String[] split = splitKey((String) wholeKey); - if (split == null) - { - return; - } - - String groupName = split[KEY_SPLITTER_GROUP]; - String profile = split[KEY_SPLITTER_PROFILE]; - String key = split[KEY_SPLITTER_KEY]; - String value = String.valueOf(objValue); - setConfiguration(groupName, profile, key, value); - }); - - migrateConfig(); + log.debug("Loading in config from disk for upload"); + swapProperties(properties, true); } public Future importLocal() @@ -343,12 +347,10 @@ public class ConfigManager private synchronized void loadFromFile() { - handler.invalidate(); - properties.clear(); - + Properties newProperties = new Properties(); try (FileInputStream in = new FileInputStream(propertiesFile)) { - properties.load(new InputStreamReader(in, StandardCharsets.UTF_8)); + newProperties.load(new InputStreamReader(in, StandardCharsets.UTF_8)); } catch (FileNotFoundException ex) { @@ -359,38 +361,8 @@ public class ConfigManager log.warn("Unable to load settings", ex); } - try - { - Map copy = (Map) ImmutableMap.copyOf(properties); - copy.forEach((wholeKey, value) -> - { - String[] split = splitKey(wholeKey); - if (split == null) - { - log.debug("Properties key malformed!: {}", wholeKey); - properties.remove(wholeKey); - return; - } - - String groupName = split[KEY_SPLITTER_GROUP]; - String profile = split[KEY_SPLITTER_PROFILE]; - String key = split[KEY_SPLITTER_KEY]; - - ConfigChanged configChanged = new ConfigChanged(); - configChanged.setGroup(groupName); - configChanged.setProfile(profile); - configChanged.setKey(key); - configChanged.setOldValue(null); - configChanged.setNewValue(value); - eventBus.post(configChanged); - }); - } - catch (Exception ex) - { - log.warn("Error posting config events", ex); - } - - migrateConfig(); + log.debug("Loading in config from disk"); + swapProperties(newProperties, false); } private void saveToFile(final File propertiesFile) throws IOException @@ -519,7 +491,11 @@ public class ConfigManager assert !key.startsWith(RSPROFILE_GROUP + "."); String wholeKey = getWholeKey(groupName, profile, key); - String oldValue = (String) properties.setProperty(wholeKey, value); + String oldValue; + synchronized (this) + { + oldValue = (String) properties.setProperty(wholeKey, value); + } if (Objects.equals(oldValue, value)) { @@ -599,7 +575,11 @@ public class ConfigManager { assert !key.startsWith(RSPROFILE_GROUP + "."); String wholeKey = getWholeKey(groupName, profile, key); - String oldValue = (String) properties.remove(wholeKey); + String oldValue; + synchronized (this) + { + oldValue = (String) properties.remove(wholeKey); + } if (oldValue == null) { @@ -977,6 +957,7 @@ public class ConfigManager salt = new byte[15]; new SecureRandom() .nextBytes(salt); + log.info("creating new salt as there is no existing one {}", Base64.getUrlEncoder().encodeToString(salt)); setConfiguration(RSPROFILE_GROUP, RSPROFILE_LOGIN_SALT, salt); } @@ -1013,7 +994,7 @@ public class ConfigManager String keyStr = RSPROFILE_GROUP + "." + Base64.getUrlEncoder().encodeToString(key); if (!keys.contains(keyStr)) { - log.info("creating new profile {} for user {}", key, username); + log.info("creating new profile {} for user {} ({}) salt {}", keyStr, username, type, Base64.getUrlEncoder().encodeToString(salt)); setConfiguration(RSPROFILE_GROUP, keyStr, RSPROFILE_LOGIN_HASH, loginHash); setConfiguration(RSPROFILE_GROUP, keyStr, RSPROFILE_TYPE, type); @@ -1071,6 +1052,7 @@ public class ConfigManager /** * Split a config key into (group, profile, key) + * * @param key in form group.(rsprofile.profile.)?key * @return an array of {group, profile, key} */ From c92f83510297c475617d75ae430c9d7d114174c2 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sun, 2 Feb 2020 22:24:21 -0800 Subject: [PATCH 09/33] timers plugin: Improve imbued heart detection As is the case with other graphics-based timers, the imbued heart timer will not fire if other graphics animations are triggered (such as those created when fighting the Dagannoth Kings). To add this timer more reliably, this commit will add the timer when a Magic stat boost occurs of the appropriate amount after recently clicking on an imbued heart. Because the magic level boost, combined with an imbued heart click check, is a reliable way to detect usage of an imbued heart, the graphics check is removed. --- .../main/java/net/runelite/api/GraphicID.java | 1 - .../client/plugins/timers/GameTimer.java | 2 +- .../client/plugins/timers/TimersPlugin.java | 62 ++++++++- .../plugins/timers/TimersPluginTest.java | 130 +++++++++++++++++- 4 files changed, 186 insertions(+), 9 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/GraphicID.java b/runelite-api/src/main/java/net/runelite/api/GraphicID.java index 669cb1e441..6f2db34f74 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicID.java +++ b/runelite-api/src/main/java/net/runelite/api/GraphicID.java @@ -44,7 +44,6 @@ public class GraphicID public static final int BOOK_HOME_TELEPORT_3 = 803; public static final int BOOK_HOME_TELEPORT_4 = 804; public static final int STAFF_OF_THE_DEAD = 1228; - public static final int IMBUED_HEART = 1316; public static final int FLYING_FISH = 1387; public static final int NPC_CONTACT = 728; public static final int POT_SHARE = 733; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java index e4521feb9e..2008152b56 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java @@ -54,7 +54,7 @@ enum GameTimer ICEBURST(SpriteID.SPELL_ICE_BURST, GameTimerImageType.SPRITE, "Ice burst", GraphicID.ICE_BURST, 16, GAME_TICKS, true), ICEBLITZ(SpriteID.SPELL_ICE_BLITZ, GameTimerImageType.SPRITE, "Ice blitz", GraphicID.ICE_BLITZ, 24, GAME_TICKS, true), ICEBARRAGE(SpriteID.SPELL_ICE_BARRAGE, GameTimerImageType.SPRITE, "Ice barrage", GraphicID.ICE_BARRAGE, 32, GAME_TICKS, true), - IMBUEDHEART(ItemID.IMBUED_HEART, GameTimerImageType.ITEM, "Imbued heart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS, true), + IMBUEDHEART(ItemID.IMBUED_HEART, GameTimerImageType.ITEM, "Imbued heart", 420, ChronoUnit.SECONDS, true), VENGEANCE(SpriteID.SPELL_VENGEANCE, GameTimerImageType.SPRITE, "Vengeance", 30, ChronoUnit.SECONDS), EXSUPERANTIFIRE(ItemID.EXTENDED_SUPER_ANTIFIRE4, GameTimerImageType.ITEM, "Extended Super AntiFire", 6, ChronoUnit.MINUTES), OVERLOAD_RAID(ItemID.OVERLOAD_4_20996, GameTimerImageType.ITEM, "Overload", 5, ChronoUnit.MINUTES, true), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 341c1c35a0..3fafb14126 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -39,6 +39,7 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.Constants; import net.runelite.api.EquipmentInventorySlot; +import net.runelite.api.GameState; import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; @@ -48,11 +49,13 @@ import static net.runelite.api.ItemID.INFERNAL_CAPE; import net.runelite.api.NPC; import net.runelite.api.NpcID; import net.runelite.api.Player; +import net.runelite.api.Skill; import net.runelite.api.VarPlayer; import net.runelite.api.Varbits; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ActorDeath; import net.runelite.api.events.AnimationChanged; +import net.runelite.api.events.StatChanged; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; @@ -141,6 +144,8 @@ public class TimersPlugin extends Plugin private int lastAnimation; private boolean widgetHiddenChangedOnPvpWorld; private ElapsedTimer tzhaarTimer; + private int imbuedHeartClickTick = -1; + private int lastBoostedMagicLevel = -1; @Inject private ItemManager itemManager; @@ -163,6 +168,15 @@ public class TimersPlugin extends Plugin return configManager.getConfig(TimersConfig.class); } + @Override + public void startUp() + { + if (client.getGameState() == GameState.LOGGED_IN) + { + lastBoostedMagicLevel = client.getBoostedSkillLevel(Skill.MAGIC); + } + } + @Override protected void shutDown() throws Exception { @@ -176,6 +190,8 @@ public class TimersPlugin extends Plugin nextPoisonTick = 0; removeTzhaarTimer(); staminaTimer = null; + imbuedHeartClickTick = -1; + lastBoostedMagicLevel = -1; } @Subscribe @@ -435,6 +451,12 @@ public class TimersPlugin extends Plugin return; } + if (event.getMenuOption().contains("Invigorate") + && event.getId() == ItemID.IMBUED_HEART) + { + imbuedHeartClickTick = client.getTickCount(); + } + TeleportWidget teleportWidget = TeleportWidget.of(event.getWidgetId()); if (teleportWidget != null) { @@ -796,8 +818,10 @@ public class TimersPlugin extends Plugin config.tzhaarLastTime(null); } break; - case HOPPING: case LOGIN_SCREEN: + lastBoostedMagicLevel = -1; + // fall through + case HOPPING: // pause tzhaar timer if logged out without pausing if (config.tzhaarStartTime() != null && config.tzhaarLastTime() == null) { @@ -856,11 +880,6 @@ public class TimersPlugin extends Plugin return; } - if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId()) - { - createGameTimer(IMBUEDHEART); - } - if (config.showFreezes()) { if (actor.getGraphic() == BIND.getGraphicId()) @@ -978,6 +997,37 @@ public class TimersPlugin extends Plugin } } + @Subscribe + public void onStatChanged(StatChanged statChanged) + { + if (statChanged.getSkill() != Skill.MAGIC) + { + return; + } + + final int boostedMagicLevel = statChanged.getBoostedLevel(); + + if (imbuedHeartClickTick < 0 + || client.getTickCount() > imbuedHeartClickTick + 3 // allow for 2 ticks of lag + || !config.showImbuedHeart()) + { + lastBoostedMagicLevel = boostedMagicLevel; + return; + } + + final int boostAmount = boostedMagicLevel - statChanged.getLevel(); + final int boostChange = boostedMagicLevel - lastBoostedMagicLevel; + final int heartBoost = 1 + (statChanged.getLevel() / 10); + + if ((boostAmount == heartBoost || (lastBoostedMagicLevel != -1 && boostChange == heartBoost)) + && boostChange > 0) + { + createGameTimer(IMBUEDHEART); + } + + lastBoostedMagicLevel = boostedMagicLevel; + } + private void createStaminaTimer() { Duration duration = Duration.ofMinutes(wasWearingEndurance ? 4 : 2); diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/timers/TimersPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/timers/TimersPluginTest.java index ab7a254c6d..69e2b1eec1 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/timers/TimersPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/timers/TimersPluginTest.java @@ -32,10 +32,15 @@ import java.time.Duration; import java.time.Instant; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; +import net.runelite.api.Experience; import net.runelite.api.InventoryID; import net.runelite.api.ItemContainer; +import net.runelite.api.ItemID; +import net.runelite.api.Skill; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.ItemContainerChanged; +import net.runelite.api.events.MenuOptionClicked; +import net.runelite.api.events.StatChanged; import net.runelite.client.game.ItemManager; import net.runelite.client.game.SpriteManager; import net.runelite.client.ui.overlay.infobox.InfoBox; @@ -53,9 +58,11 @@ import static org.mockito.ArgumentMatchers.nullable; import org.mockito.Mock; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; @@ -369,4 +376,125 @@ public class TimersPluginTest ElapsedTimer timer = (ElapsedTimer) captor.getValue(); assertEquals("00:06", timer.getText()); } -} \ No newline at end of file + + @Test + public void testImbuedHeartBoost() + { + when(timersConfig.showImbuedHeart()).thenReturn(true); + when(client.getTickCount()).thenReturn(100); + StatChanged event; + + final MenuOptionClicked imbuedHeartClick = new MenuOptionClicked(); + imbuedHeartClick.setMenuOption("Invigorate"); + imbuedHeartClick.setId(ItemID.IMBUED_HEART); + timersPlugin.onMenuOptionClicked(imbuedHeartClick); + + when(client.getTickCount()).thenReturn(101); + + for (int level = 1, i = 0; level <= Experience.MAX_REAL_LEVEL; level++, i++) + { + event = new StatChanged(Skill.MAGIC, 0, level, heartBoostedLevel(level)); + timersPlugin.onStatChanged(event); + + ArgumentCaptor captor = ArgumentCaptor.forClass(InfoBox.class); + verify(infoBoxManager, times(i + 1)).addInfoBox(captor.capture()); + TimerTimer infoBox = (TimerTimer) captor.getValue(); + assertEquals(GameTimer.IMBUEDHEART, infoBox.getTimer()); + } + } + + @Test + public void testImbuedHeartBoostFromDrained() + { + when(timersConfig.showImbuedHeart()).thenReturn(true); + when(client.getTickCount()).thenReturn(100); + + final MenuOptionClicked imbuedHeartClick = new MenuOptionClicked(); + imbuedHeartClick.setMenuOption("Invigorate"); + imbuedHeartClick.setId(ItemID.IMBUED_HEART); + timersPlugin.onMenuOptionClicked(imbuedHeartClick); + + when(client.getTickCount()).thenReturn(101); + + for (int level = 1, i = 0; level <= Experience.MAX_REAL_LEVEL; level++, i++) + { + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, level - 1)); + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, heartBoostedLevel(level) - 1)); + + ArgumentCaptor captor = ArgumentCaptor.forClass(InfoBox.class); + verify(infoBoxManager, times(i + 1)).addInfoBox(captor.capture()); + TimerTimer infoBox = (TimerTimer) captor.getValue(); + assertEquals(GameTimer.IMBUEDHEART, infoBox.getTimer()); + } + } + + @Test + public void testImbuedHeartBoostFromPartialBoost() + { + when(timersConfig.showImbuedHeart()).thenReturn(true); + when(client.getTickCount()).thenReturn(100); + + final MenuOptionClicked imbuedHeartClick = new MenuOptionClicked(); + imbuedHeartClick.setMenuOption("Invigorate"); + imbuedHeartClick.setId(ItemID.IMBUED_HEART); + timersPlugin.onMenuOptionClicked(imbuedHeartClick); + + when(client.getTickCount()).thenReturn(101); + + for (int level = 10, i = 0; level <= Experience.MAX_REAL_LEVEL; level++, i++) + { + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, level + 1)); + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, heartBoostedLevel(level))); + + ArgumentCaptor captor = ArgumentCaptor.forClass(InfoBox.class); + verify(infoBoxManager, times(i + 1)).addInfoBox(captor.capture()); + TimerTimer infoBox = (TimerTimer) captor.getValue(); + assertEquals(GameTimer.IMBUEDHEART, infoBox.getTimer()); + } + } + + @Test + public void testNonImbuedHeartBoost() + { + lenient().when(timersConfig.showImbuedHeart()).thenReturn(true); + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, 1, 1)); + + // Simulate stat changes of imbued heart boost amount without having clicked the imbued heart + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, 29, 34)); // equal to magic essence + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, 39, 43)); // equal to magic potion + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, 49, 54)); // equal to spicy stew + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, 99, 109)); + + verifyNoInteractions(infoBoxManager); + } + + @Test + public void testMagicLevelDrain() + { + lenient().when(timersConfig.showImbuedHeart()).thenReturn(true); + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, 1, 1)); + when(client.getTickCount()).thenReturn(100); + + final MenuOptionClicked imbuedHeartClick = new MenuOptionClicked(); + imbuedHeartClick.setMenuOption("Invigorate"); + imbuedHeartClick.setId(ItemID.IMBUED_HEART); + timersPlugin.onMenuOptionClicked(imbuedHeartClick); + + when(client.getTickCount()).thenReturn(101); + + // Simulate stat changes draining to the imbued heart boost amount + for (int level = 1; level <= Experience.MAX_REAL_LEVEL; level++) + { + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, level)); + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, heartBoostedLevel(level) + 1)); + timersPlugin.onStatChanged(new StatChanged(Skill.MAGIC, 0, level, heartBoostedLevel(level))); + } + + verifyNoInteractions(infoBoxManager); + } + + private static int heartBoostedLevel(final int level) + { + return level + 1 + (level / 10); + } +} From 5fd55ae9a7f066112801d33cfa55ca79b1d07e7e Mon Sep 17 00:00:00 2001 From: Patrick Watts Date: Tue, 16 Feb 2021 03:49:10 +0400 Subject: [PATCH 10/33] menu entry swapper: Add fishing spot bait swap (#13203) --- .../menuentryswapper/MenuEntrySwapperConfig.java | 11 +++++++++++ .../menuentryswapper/MenuEntrySwapperPlugin.java | 4 ++++ 2 files changed, 15 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 8923237ce7..a9564ff1c5 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 @@ -287,6 +287,17 @@ public interface MenuEntrySwapperConfig extends Config return false; } + @ConfigItem( + keyName = "swapBait", + name = "Bait", + description = "Swap Lure, Small Net with Bait on Fishing spot", + section = objectSection + ) + default boolean swapBait() + { + return false; + } + @ConfigItem( keyName = "swapHelp", name = "Help", 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 a3228959cc..41ce37427e 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 @@ -238,6 +238,10 @@ public class MenuEntrySwapperPlugin extends Plugin swap("big net", "harpoon", config::swapHarpoon); swap("net", "harpoon", config::swapHarpoon); + swap("lure", "bait", config::swapBait); + swap("net", "bait", config::swapBait); + swap("small net", "bait", config::swapBait); + swap("enter", "portal", "home", () -> config.swapHomePortal() == HouseMode.HOME); swap("enter", "portal", "build mode", () -> config.swapHomePortal() == HouseMode.BUILD_MODE); swap("enter", "portal", "friend's house", () -> config.swapHomePortal() == HouseMode.FRIENDS_HOUSE); From e40a7ad6afb3e38d9ec5220ee0684cfdd4fb24b9 Mon Sep 17 00:00:00 2001 From: Jonathan Lee Date: Sun, 14 Feb 2021 23:49:30 -0800 Subject: [PATCH 11/33] crowdsourcing: Add newly-found cooking messages --- .../plugins/crowdsourcing/cooking/CrowdsourcingCooking.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java index 749ead8ea9..3cad5274a7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/cooking/CrowdsourcingCooking.java @@ -85,6 +85,9 @@ public class CrowdsourcingCooking || message.startsWith("Unfortunately the Jubbly") || message.startsWith("You accidentally burn") || message.startsWith("You half-cook") + || message.startsWith("The undead meat is now cooked") + || message.startsWith("The undead chicken is now cooked") + || message.startsWith("You successfully scramble") || message.startsWith("You accidentally spoil")) { boolean inHosidiusKitchen = false; From 662c287602f459be958d9908f06a90b6df4fc5d0 Mon Sep 17 00:00:00 2001 From: Jonathan Lee Date: Mon, 15 Feb 2021 03:33:40 -0800 Subject: [PATCH 12/33] cooking: Add more chatbox messages --- .../runelite/client/plugins/cooking/CookingPlugin.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 cfed06e255..19dacaf7b7 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 @@ -174,9 +174,16 @@ public class CookingPlugin extends Plugin if (message.startsWith("You successfully cook") || message.startsWith("You successfully bake") + || message.startsWith("You successfully fry") || message.startsWith("You manage to cook") || message.startsWith("You roast a") + || message.startsWith("You spit-roast") || message.startsWith("You cook") + || message.startsWith("Eventually the Jubbly") + || message.startsWith("You half-cook") + || message.startsWith("The undead meat is now cooked") + || message.startsWith("The undead chicken is now cooked") + || message.startsWith("You successfully scramble") || message.startsWith("You dry a piece of meat")) { if (session == null) @@ -189,6 +196,8 @@ public class CookingPlugin extends Plugin } else if (message.startsWith("You accidentally burn") + || message.startsWith("You burn") + || message.startsWith("Unfortunately the Jubbly") || message.startsWith("You accidentally spoil")) { if (session == null) From 4b2767ab6048491737eecd076a0aa3e936d23e6e Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Wed, 17 Feb 2021 19:53:30 -0800 Subject: [PATCH 13/33] discord: Add missing Misthalin region --- .../runelite/client/plugins/discord/DiscordGameEventType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java index 4bfe4652ed..c50fa8289e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java @@ -385,7 +385,7 @@ enum DiscordGameEventType REGION_MCGRUBORS_WOOD("McGrubor's Wood", DiscordAreaType.REGIONS, 10550), REGION_MIME_STAGE("Mime's Stage", DiscordAreaType.REGIONS, 8010), REGION_MIND_ALTAR("Mind Altar", DiscordAreaType.REGIONS, 11083), - REGION_MISTHALIN("Misthalin", DiscordAreaType.REGIONS, 12594, 12595), + REGION_MISTHALIN("Misthalin", DiscordAreaType.REGIONS, 12594, 12595, 12851), REGION_MOLCH("Molch", DiscordAreaType.REGIONS, 5177), REGION_MOLCH_ISLAND("Molch Island", DiscordAreaType.REGIONS, 5432), REGION_MORYTANIA("Morytania", DiscordAreaType.REGIONS, 13619, 13620, 13621, 13622, 13876, 13877, 13879, 14133, 14134, 14389, 14390, 14391, 14645, 14647), From 053f7842891fbe9f774d61ec289ba8e58af10623 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Wed, 17 Feb 2021 19:58:20 -0800 Subject: [PATCH 14/33] discord: Add Wild Varrock Last Man Standing regions --- .../runelite/client/plugins/discord/DiscordGameEventType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java index c50fa8289e..42f9e325ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java @@ -287,7 +287,8 @@ enum DiscordGameEventType MG_HALLOWED_SEPULCHRE("Hallowed Sepulchre", DiscordAreaType.MINIGAMES, 8797, 9051, 9052, 9053, 9054, 9309, 9563, 9565, 9821, 10074, 10075, 10077), MG_INFERNO("The Inferno", DiscordAreaType.MINIGAMES, 9043), MG_KELDAGRIM_RAT_PITS("Keldagrim Rat Pits", DiscordAreaType.MINIGAMES, 7753), - MG_LAST_MAN_STANDING("Last Man Standing", DiscordAreaType.MINIGAMES, 13660, 13659, 13658, 13916, 13915, 13914), + MG_LAST_MAN_STANDING_DESERTED_ISLAND("LMS - Deserted Island", DiscordAreaType.MINIGAMES, 13658, 13659, 13660, 13914, 13915, 13916), + MG_LAST_MAN_STANDING_WILD_VARROCK("LMS - Wild Varrock", DiscordAreaType.MINIGAMES, 13918, 13919, 13920, 14174, 14175, 14176, 14430, 14431, 14432), MG_MAGE_TRAINING_ARENA("Mage Training Arena", DiscordAreaType.MINIGAMES, 13462, 13463), MG_NIGHTMARE_ZONE("Nightmare Zone", DiscordAreaType.MINIGAMES, 9033), MG_PEST_CONTROL("Pest Control", DiscordAreaType.MINIGAMES, 10536), From 7ca843a06664c2c205a1c00230aefc304d08bd97 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Wed, 17 Feb 2021 11:28:57 -0500 Subject: [PATCH 15/33] loot tracker: Add Wild Varrock Last Man Standing regions --- .../runelite/client/plugins/loottracker/LootTrackerPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index f3802e230a..46857ea2e2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -202,7 +202,7 @@ public class LootTrackerPlugin extends Plugin private static final Set HALLOWED_SEPULCHRE_MAP_REGIONS = ImmutableSet.of(8797, 10077, 9308, 10074, 9050); // one map region per floor // Last man standing map regions - private static final Set LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916); + private static final Set LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13660, 13914, 13915, 13916, 13918, 13919, 13920, 14174, 14175, 14176, 14430, 14431, 14432); private static final Pattern PICKPOCKET_REGEX = Pattern.compile("You pick (the )?(?.+)'s? pocket.*"); From 9f31e979d7bb492c1d6787114bf943b878d297e8 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Thu, 18 Feb 2021 02:09:44 -0500 Subject: [PATCH 16/33] worldmap: Improve cart and minecart systems tooltips (#13226) This commit also adds Ice Mountain minecart location. --- .../worldmap/TransportationPointLocation.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java index 3d3913a304..330c0738d9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java @@ -122,17 +122,18 @@ enum TransportationPointLocation CHARTER_PRIFDDINAS_INSTANCE("Charter Ship", new WorldPoint(3180, 6083, 0)), //Minecarts/Carts - MINE_CART_ARCEUUS("Minecart", new WorldPoint(1673, 3832, 0)), + MINE_CART_ARCEUUS("Lovakengj Minecart Network", new WorldPoint(1673, 3832, 0)), MINE_CART_GRANDEXCHANGE("Minecart to Keldagrim", new WorldPoint(3139, 3504, 0)), - MINE_CART_HOSIDIUS("Minecart", new WorldPoint(1656, 3542, 0)), - MINE_CART_KELDAGRIM("Minecart", new WorldPoint(2908, 10170, 0)), - MINE_CART_LOVAKENGJ("Minecart", new WorldPoint(1524, 3721, 0)), - MINE_CART_PORT_PISCARILIUS("Minecart", new WorldPoint(1760, 3708, 0)), - MINE_CART_QUIDAMORTEM("Minecart", new WorldPoint(1253, 3550, 0)), - MINE_CART_SHAYZIEN("Minecart", new WorldPoint(1586, 3622, 0)), - MINE_CART_TAVERLEY_UNDERGROUND("Minecart", new WorldPoint(2874, 9870, 0)), + MINE_CART_HOSIDIUS("Lovakengj Minecart Network", new WorldPoint(1656, 3542, 0)), + MINE_CART_ICE_MOUNTAIN("Minecart to Keldagrim", new WorldPoint(2995, 9836, 0)), + MINE_CART_KELDAGRIM("Keldagrim Minecart System", new WorldPoint(2908, 10170, 0)), + MINE_CART_LOVAKENGJ("Lovakengj Minecart Network", new WorldPoint(1524, 3721, 0)), + MINE_CART_PORT_PISCARILIUS("Lovakengj Minecart Network", new WorldPoint(1760, 3708, 0)), + MINE_CART_QUIDAMORTEM("Lovakengj Minecart Network", new WorldPoint(1253, 3550, 0)), + MINE_CART_SHAYZIEN("Lovakengj Minecart Network", new WorldPoint(1586, 3622, 0)), + MINE_CART_WHITE_WOLF_MOUNTAIN("Minecart to Keldagrim", new WorldPoint(2874, 9870, 0)), CART_TO_BRIMHAVEN("Cart to Brimhaven", new WorldPoint(2833, 2958, 0), new WorldPoint(2780, 3214, 0)), - CART_TO_SHILO("Cart to Shilo", new WorldPoint(2780, 3214, 0), new WorldPoint(2833, 2958, 0)), + CART_TO_SHILO("Cart to Shilo Village", new WorldPoint(2780, 3214, 0), new WorldPoint(2833, 2958, 0)), //Canoes CANOE_BARBVILLAGE("Canoe", new WorldPoint(3111, 3409, 0)), From 63614f531994a1e29a0163921719be900c6cba70 Mon Sep 17 00:00:00 2001 From: Silverfeelin Date: Thu, 18 Feb 2021 23:47:25 +0100 Subject: [PATCH 17/33] item identification: Add sacks (#9372) --- .../plugins/itemidentification/ItemIdentification.java | 7 +++++++ .../itemidentification/ItemIdentificationConfig.java | 10 ++++++++++ .../itemidentification/ItemIdentificationOverlay.java | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index fadbf29c59..c892de9420 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -48,6 +48,12 @@ enum ItemIdentification POISON_IVY_SEED(Type.SEED, "Ivy", "I", ItemID.POISON_IVY_SEED), WHITEBERRY_SEED(Type.SEED, "White", "W", ItemID.WHITEBERRY_SEED), + //Sacks + SACK(Type.SACK, "Empty", "EMP", ItemID.EMPTY_SACK), + CABBAGE_SACK(Type.SACK, "Cabbage", "CAB", ItemID.CABBAGES1, ItemID.CABBAGES2, ItemID.CABBAGES3, ItemID.CABBAGES4, ItemID.CABBAGES5, ItemID.CABBAGES6, ItemID.CABBAGES7, ItemID.CABBAGES8, ItemID.CABBAGES9, ItemID.CABBAGES10), + ONION_SACK(Type.SACK, "Onion", "ONI", ItemID.ONIONS1, ItemID.ONIONS2, ItemID.ONIONS3, ItemID.ONIONS4, ItemID.ONIONS5, ItemID.ONIONS6, ItemID.ONIONS7, ItemID.ONIONS8, ItemID.ONIONS9, ItemID.ONIONS10), + POTATO_SACK(Type.SACK, "Potato", "POT", ItemID.POTATOES1, ItemID.POTATOES2, ItemID.POTATOES3, ItemID.POTATOES4, ItemID.POTATOES5, ItemID.POTATOES6, ItemID.POTATOES7, ItemID.POTATOES8, ItemID.POTATOES9, ItemID.POTATOES10), + //Herbs GUAM(Type.HERB, "Guam", "G", ItemID.GUAM_LEAF, ItemID.GRIMY_GUAM_LEAF), MARRENTILL(Type.HERB, "Marren", "M", ItemID.MARRENTILL, ItemID.GRIMY_MARRENTILL), @@ -305,6 +311,7 @@ enum ItemIdentification enum Type { SEED, + SACK, HERB, SAPLING, ORE, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java index 115792329b..606daac64d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java @@ -73,6 +73,16 @@ public interface ItemIdentificationConfig extends Config return true; } + @ConfigItem( + keyName = "showSacks", + name = "Sacks", + description = "Show identification on Sacks" + ) + default boolean showSacks() + { + return false; + } + @ConfigItem( keyName = "showHerbs", name = "Herbs", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java index eaf7824ff6..c63db62924 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java @@ -71,6 +71,12 @@ class ItemIdentificationOverlay extends WidgetItemOverlay return; } break; + case SACK: + if (!config.showSacks()) + { + return; + } + break; case HERB: if (!config.showHerbs()) { From 3d80df9a98fff141bce590c6a099d303cba3360b Mon Sep 17 00:00:00 2001 From: Nathaniel Johnson Date: Thu, 18 Feb 2021 19:26:48 -0800 Subject: [PATCH 18/33] mining: Add hint arrow to active daeyalt essence --- .../client/plugins/mining/MiningPlugin.java | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java index adecd59fa9..6cc0e90ae4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java @@ -39,6 +39,7 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.GameObject; import net.runelite.api.GameState; +import static net.runelite.api.HintArrowType.WORLD_POSITION; import net.runelite.api.MenuAction; import static net.runelite.api.ObjectID.DEPLETED_VEIN_26665; import static net.runelite.api.ObjectID.DEPLETED_VEIN_26666; @@ -133,6 +134,7 @@ public class MiningPlugin extends Plugin pickaxe = null; overlayManager.remove(overlay); overlayManager.remove(rocksOverlay); + respawns.forEach(respawn -> clearHintArrowAt(respawn.getWorldPoint())); respawns.clear(); } @@ -200,7 +202,7 @@ public class MiningPlugin extends Plugin @Subscribe public void onGameTick(GameTick gameTick) { - respawns.removeIf(RockRespawn::isExpired); + clearExpiredRespawns(); recentlyLoggedIn = false; if (session == null || session.getLastMined() == null) @@ -223,6 +225,24 @@ public class MiningPlugin extends Plugin } } + /** + * Clears expired respawns and removes the hint arrow from expired Daeyalt essence rocks. + */ + private void clearExpiredRespawns() + { + respawns.removeIf(rockRespawn -> + { + final boolean expired = rockRespawn.isExpired(); + + if (expired && rockRespawn.getRock() == Rock.DAEYALT_ESSENCE) + { + clearHintArrowAt(rockRespawn.getWorldPoint()); + } + + return expired; + }); + } + public void resetSession() { session = null; @@ -243,19 +263,29 @@ public class MiningPlugin extends Plugin Rock rock = Rock.getRock(object.getId()); if (rock != null) { + final WorldPoint point = object.getWorldLocation(); + if (rock == Rock.DAEYALT_ESSENCE) { - final WorldPoint point = object.getWorldLocation(); respawns.removeIf(rockRespawn -> rockRespawn.getWorldPoint().equals(point)); + clearHintArrowAt(point); } else { - RockRespawn rockRespawn = new RockRespawn(rock, object.getWorldLocation(), Instant.now(), (int) rock.getRespawnTime(region).toMillis(), rock.getZOffset()); + RockRespawn rockRespawn = new RockRespawn(rock, point, Instant.now(), (int) rock.getRespawnTime(region).toMillis(), rock.getZOffset()); respawns.add(rockRespawn); } } } + private void clearHintArrowAt(WorldPoint worldPoint) + { + if (client.getHintArrowType() == WORLD_POSITION && client.getHintArrowPoint().equals(worldPoint)) + { + client.clearHintArrow(); + } + } + @Subscribe public void onGameObjectSpawned(GameObjectSpawned event) { @@ -273,6 +303,7 @@ public class MiningPlugin extends Plugin final int region = client.getLocalPlayer().getWorldLocation().getRegionID(); RockRespawn rockRespawn = new RockRespawn(rock, object.getWorldLocation(), Instant.now(), (int) rock.getRespawnTime(region).toMillis(), rock.getZOffset()); respawns.add(rockRespawn); + client.setHintArrow(object.getWorldLocation()); } // If the Lovakite ore respawns before the timer is up, remove it else if (rock == Rock.LOVAKITE) From e0be69c725bfd879a4065e4f2573c09af9575d64 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 18 Feb 2021 19:40:33 -0500 Subject: [PATCH 19/33] client: move core singleton eventbus registration to singleton constructors --- .../java/net/runelite/client/RuneLite.java | 64 -------------- .../net/runelite/client/callback/Hooks.java | 84 ++++++++++--------- .../client/chat/ChatMessageManager.java | 8 +- .../runelite/client/chat/CommandManager.java | 1 + .../client/game/FriendChatManager.java | 4 +- .../net/runelite/client/game/ItemManager.java | 5 +- .../net/runelite/client/game/LootManager.java | 1 + .../game/chatbox/ChatboxPanelManager.java | 2 + .../runelite/client/menus/MenuManager.java | 5 +- .../client/ui/overlay/OverlayRenderer.java | 5 +- .../ui/overlay/infobox/InfoBoxManager.java | 1 + .../net/runelite/client/ws/PartyService.java | 1 + .../client/chat/ChatMessageManagerTest.java | 12 ++- 13 files changed, 76 insertions(+), 117 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index 7418be6c5e..aa6ef1e2e1 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -56,32 +56,20 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.client.account.SessionManager; -import net.runelite.client.callback.Hooks; -import net.runelite.client.chat.ChatMessageManager; -import net.runelite.client.chat.CommandManager; import net.runelite.client.config.ConfigManager; import net.runelite.client.discord.DiscordService; import net.runelite.client.eventbus.EventBus; import net.runelite.client.externalplugins.ExternalPluginManager; -import net.runelite.client.game.FriendChatManager; -import net.runelite.client.game.ItemManager; -import net.runelite.client.game.LootManager; -import net.runelite.client.game.chatbox.ChatboxPanelManager; -import net.runelite.client.menus.MenuManager; import net.runelite.client.plugins.PluginManager; import net.runelite.client.rs.ClientLoader; import net.runelite.client.rs.ClientUpdateCheckMode; import net.runelite.client.ui.ClientUI; -import net.runelite.client.ui.DrawManager; import net.runelite.client.ui.FatalErrorDialog; import net.runelite.client.ui.SplashScreen; import net.runelite.client.ui.overlay.OverlayManager; -import net.runelite.client.ui.overlay.OverlayRenderer; import net.runelite.client.ui.overlay.WidgetOverlay; -import net.runelite.client.ui.overlay.infobox.InfoBoxManager; import net.runelite.client.ui.overlay.tooltip.TooltipOverlay; import net.runelite.client.ui.overlay.worldmap.WorldMapOverlay; -import net.runelite.client.ws.PartyService; import net.runelite.http.api.RuneLiteAPI; import okhttp3.Cache; import okhttp3.OkHttpClient; @@ -117,9 +105,6 @@ public class RuneLite @Inject private ConfigManager configManager; - @Inject - private DrawManager drawManager; - @Inject private SessionManager sessionManager; @@ -132,48 +117,15 @@ public class RuneLite @Inject private ClientUI clientUI; - @Inject - private Provider infoBoxManager; - @Inject private OverlayManager overlayManager; - @Inject - private Provider partyService; - - @Inject - private Provider itemManager; - - @Inject - private Provider overlayRenderer; - - @Inject - private Provider friendsChatManager; - - @Inject - private Provider chatMessageManager; - - @Inject - private Provider menuManager; - - @Inject - private Provider commandManager; - @Inject private Provider tooltipOverlay; @Inject private Provider worldMapOverlay; - @Inject - private Provider lootManager; - - @Inject - private Provider chatboxPanelManager; - - @Inject - private Provider hooks; - @Inject @Nullable private Client client; @@ -362,27 +314,11 @@ public class RuneLite eventBus.register(pluginManager); eventBus.register(externalPluginManager); eventBus.register(overlayManager); - eventBus.register(drawManager); eventBus.register(configManager); eventBus.register(discordService); if (!isOutdated) { - // Initialize chat colors - chatMessageManager.get().loadColors(); - - eventBus.register(infoBoxManager.get()); - eventBus.register(partyService.get()); - eventBus.register(overlayRenderer.get()); - eventBus.register(friendsChatManager.get()); - eventBus.register(itemManager.get()); - eventBus.register(menuManager.get()); - eventBus.register(chatMessageManager.get()); - eventBus.register(commandManager.get()); - eventBus.register(lootManager.get()); - eventBus.register(chatboxPanelManager.get()); - eventBus.register(hooks.get()); - // Add core overlays WidgetOverlay.createOverlays(client).forEach(overlayManager::add); overlayManager.add(worldMapOverlay.get()); diff --git a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java index dd16869ee5..444077d75e 100644 --- a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java +++ b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java @@ -83,44 +83,19 @@ public class Hooks implements Callbacks private static final GameTick GAME_TICK = new GameTick(); private static final BeforeRender BEFORE_RENDER = new BeforeRender(); - @Inject - private Client client; - - @Inject - private OverlayRenderer renderer; - - @Inject - private EventBus eventBus; - - @Inject - private DeferredEventBus deferredEventBus; - - @Inject - private Scheduler scheduler; - - @Inject - private InfoBoxManager infoBoxManager; - - @Inject - private ChatMessageManager chatMessageManager; - - @Inject - private MouseManager mouseManager; - - @Inject - private KeyManager keyManager; - - @Inject - private ClientThread clientThread; - - @Inject - private DrawManager drawManager; - - @Inject - private Notifier notifier; - - @Inject - private ClientUI clientUi; + private final Client client; + private final OverlayRenderer renderer; + private final EventBus eventBus; + private final DeferredEventBus deferredEventBus; + private final Scheduler scheduler; + private final InfoBoxManager infoBoxManager; + private final ChatMessageManager chatMessageManager; + private final MouseManager mouseManager; + private final KeyManager keyManager; + private final ClientThread clientThread; + private final DrawManager drawManager; + private final Notifier notifier; + private final ClientUI clientUi; private Dimension lastStretchedDimensions; private VolatileImage stretchedImage; @@ -155,6 +130,39 @@ public class Hooks implements Callbacks return lastGraphics; } + @Inject + private Hooks( + Client client, + OverlayRenderer renderer, + EventBus eventBus, + DeferredEventBus deferredEventBus, + Scheduler scheduler, + InfoBoxManager infoBoxManager, + ChatMessageManager chatMessageManager, + MouseManager mouseManager, + KeyManager keyManager, + ClientThread clientThread, + DrawManager drawManager, + Notifier notifier, + ClientUI clientUi + ) + { + this.client = client; + this.renderer = renderer; + this.eventBus = eventBus; + this.deferredEventBus = deferredEventBus; + this.scheduler = scheduler; + this.infoBoxManager = infoBoxManager; + this.chatMessageManager = chatMessageManager; + this.mouseManager = mouseManager; + this.keyManager = keyManager; + this.clientThread = clientThread; + this.drawManager = drawManager; + this.notifier = notifier; + this.clientUi = clientUi; + eventBus.register(this); + } + @Override public void post(Object event) { diff --git a/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java b/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java index 6e888ce8f1..50e6fefbb0 100644 --- a/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java +++ b/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java @@ -50,6 +50,7 @@ import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.events.VarbitChanged; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ChatColorConfig; +import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.ConfigChanged; import net.runelite.client.ui.JagexColors; @@ -72,11 +73,14 @@ public class ChatMessageManager private ChatMessageManager( Client client, ChatColorConfig chatColorConfig, - ClientThread clientThread) + ClientThread clientThread, + EventBus eventBus) { this.client = client; this.chatColorConfig = chatColorConfig; this.clientThread = clientThread; + eventBus.register(this); + loadColors(); } @Subscribe @@ -254,7 +258,7 @@ public class ChatMessageManager /** * Load all configured colors */ - public void loadColors() + private void loadColors() { colorCache.clear(); diff --git a/runelite-client/src/main/java/net/runelite/client/chat/CommandManager.java b/runelite-client/src/main/java/net/runelite/client/chat/CommandManager.java index 6c725df06c..e8fb4dcedb 100644 --- a/runelite-client/src/main/java/net/runelite/client/chat/CommandManager.java +++ b/runelite-client/src/main/java/net/runelite/client/chat/CommandManager.java @@ -63,6 +63,7 @@ public class CommandManager this.client = client; this.eventBus = eventBus; this.clientThread = clientThread; + eventBus.register(this); } public void register(ChatboxInputListener chatboxInputListener) diff --git a/runelite-client/src/main/java/net/runelite/client/game/FriendChatManager.java b/runelite-client/src/main/java/net/runelite/client/game/FriendChatManager.java index 5c24a6ce33..f27eb6f312 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/FriendChatManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/FriendChatManager.java @@ -45,6 +45,7 @@ import net.runelite.api.IndexedSprite; import net.runelite.api.SpriteID; import net.runelite.api.events.FriendsChatChanged; import net.runelite.api.events.GameStateChanged; +import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.util.ImageUtil; import net.runelite.client.util.Text; @@ -93,10 +94,11 @@ public class FriendChatManager private int offset; @Inject - private FriendChatManager(Client client, SpriteManager spriteManager) + private FriendChatManager(Client client, SpriteManager spriteManager, EventBus eventBus) { this.client = client; this.spriteManager = spriteManager; + eventBus.register(this); } public boolean isMember(String name) diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java index 9518ed82d0..d524a9a5e3 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java @@ -55,6 +55,7 @@ import net.runelite.api.SpritePixels; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.PostItemComposition; import net.runelite.client.callback.ClientThread; +import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.util.AsyncBufferedImage; import net.runelite.http.api.item.ItemClient; @@ -169,7 +170,7 @@ public class ItemManager @Inject public ItemManager(Client client, ScheduledExecutorService scheduledExecutorService, ClientThread clientThread, - OkHttpClient okHttpClient) + OkHttpClient okHttpClient, EventBus eventBus) { this.client = client; this.clientThread = clientThread; @@ -213,6 +214,8 @@ public class ItemManager return loadItemOutline(key.itemId, key.itemQuantity, key.outlineColor); } }); + + eventBus.register(this); } private void loadPrices() diff --git a/runelite-client/src/main/java/net/runelite/client/game/LootManager.java b/runelite-client/src/main/java/net/runelite/client/game/LootManager.java index e44c5d7572..418e493738 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/LootManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/LootManager.java @@ -84,6 +84,7 @@ public class LootManager { this.eventBus = eventBus; this.client = client; + eventBus.register(this); } @Subscribe diff --git a/runelite-client/src/main/java/net/runelite/client/game/chatbox/ChatboxPanelManager.java b/runelite-client/src/main/java/net/runelite/client/game/chatbox/ChatboxPanelManager.java index 38bb623b95..9fb70abd9e 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/chatbox/ChatboxPanelManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/chatbox/ChatboxPanelManager.java @@ -79,6 +79,8 @@ public class ChatboxPanelManager this.chatboxTextMenuInputProvider = chatboxTextMenuInputProvider; this.chatboxTextInputProvider = chatboxTextInputProvider; + + eventBus.register(this); } public void close() diff --git a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java index c2231233db..bb65ecaaca 100644 --- a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java +++ b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java @@ -24,7 +24,6 @@ */ package net.runelite.client.menus; -import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; @@ -65,11 +64,11 @@ public class MenuManager private final Multimap managedMenuOptions = LinkedHashMultimap.create(); @Inject - @VisibleForTesting - MenuManager(Client client, EventBus eventBus) + private MenuManager(Client client, EventBus eventBus) { this.client = client; this.eventBus = eventBus; + eventBus.register(this); } /** diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java index 5c01f578c8..b6adfa6813 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java @@ -58,6 +58,7 @@ import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetItem; import net.runelite.client.config.RuneLiteConfig; +import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.input.KeyListener; import net.runelite.client.input.KeyManager; @@ -113,7 +114,8 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener final RuneLiteConfig runeLiteConfig, final MouseManager mouseManager, final KeyManager keyManager, - final ClientUI clientUI) + final ClientUI clientUI, + final EventBus eventBus) { this.client = client; this.overlayManager = overlayManager; @@ -121,6 +123,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener this.clientUI = clientUI; keyManager.registerKeyListener(this); mouseManager.registerMouseListener(this); + eventBus.register(this); } @Subscribe diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxManager.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxManager.java index 66a6d7d913..32b6e04aec 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxManager.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxManager.java @@ -95,6 +95,7 @@ public class InfoBoxManager this.eventBus = eventBus; this.overlayManager = overlayManager; this.configManager = configManager; + eventBus.register(this); } @Subscribe diff --git a/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java b/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java index 094b1d3de4..a96b6704ff 100644 --- a/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java +++ b/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java @@ -78,6 +78,7 @@ public class PartyService this.sessionManager = sessionManager; this.eventBus = eventBus; this.chat = chat; + eventBus.register(this); } public void changeParty(UUID newParty) diff --git a/runelite-client/src/test/java/net/runelite/client/chat/ChatMessageManagerTest.java b/runelite-client/src/test/java/net/runelite/client/chat/ChatMessageManagerTest.java index b75c79b277..6bdb200694 100644 --- a/runelite-client/src/test/java/net/runelite/client/chat/ChatMessageManagerTest.java +++ b/runelite-client/src/test/java/net/runelite/client/chat/ChatMessageManagerTest.java @@ -35,6 +35,7 @@ import net.runelite.api.MessageNode; import net.runelite.api.Player; import net.runelite.api.events.ChatMessage; import net.runelite.client.config.ChatColorConfig; +import net.runelite.client.events.ConfigChanged; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -62,8 +63,6 @@ public class ChatMessageManagerTest public void before() { Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); - - chatMessageManager.loadColors(); } @Test @@ -71,7 +70,10 @@ public class ChatMessageManagerTest { when(chatColorConfig.opaqueServerMessage()).thenReturn(Color.decode("#b20000")); - chatMessageManager.loadColors(); + // rebuild color cache + ConfigChanged configChanged = new ConfigChanged(); + configChanged.setGroup("textrecolor"); + chatMessageManager.onConfigChanged(configChanged); ChatMessage chatMessage = new ChatMessage(); chatMessage.setType(ChatMessageType.GAMEMESSAGE); @@ -93,8 +95,6 @@ public class ChatMessageManagerTest when(chatColorConfig.opaquePublicFriendUsernames()).thenReturn(Color.decode("#b20000")); - chatMessageManager.loadColors(); - // Setup message ChatMessage chatMessage = new ChatMessage(); chatMessage.setType(ChatMessageType.PUBLICCHAT); @@ -125,8 +125,6 @@ public class ChatMessageManagerTest when(chatColorConfig.opaquePublicFriendUsernames()).thenReturn(Color.decode("#b20000")); - chatMessageManager.loadColors(); - // Setup message ChatMessage chatMessage = new ChatMessage(); chatMessage.setType(ChatMessageType.PUBLICCHAT); From 667df94d1be48ccdf53a6f65b0f05f1674980664 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 19 Feb 2021 19:52:38 -0500 Subject: [PATCH 20/33] barrows plugin: use widget closed event for clearing puzzle --- .../client/plugins/barrows/BarrowsPlugin.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/barrows/BarrowsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/barrows/BarrowsPlugin.java index 149a7ac24e..cde5c6bb73 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/barrows/BarrowsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/barrows/BarrowsPlugin.java @@ -37,8 +37,8 @@ import net.runelite.api.Item; import net.runelite.api.ItemContainer; import net.runelite.api.Player; import net.runelite.api.SpriteID; -import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; +import net.runelite.api.events.WidgetClosed; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetID; @@ -49,6 +49,7 @@ import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.chat.QueuedMessage; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.ItemManager; import net.runelite.client.game.SpriteManager; import net.runelite.client.plugins.Plugin; @@ -159,8 +160,6 @@ public class BarrowsPlugin extends Plugin if (event.getGameState() == GameState.LOADING) { wasInCrypt = isInCrypt(); - // on region changes the tiles get set to null - puzzleAnswer = null; } else if (event.getGameState() == GameState.LOGGED_IN) { @@ -221,6 +220,15 @@ public class BarrowsPlugin extends Plugin } } + @Subscribe + public void onWidgetClosed(WidgetClosed widgetClosed) + { + if (widgetClosed.getGroupId() == WidgetID.BARROWS_PUZZLE_GROUP_ID) + { + puzzleAnswer = null; + } + } + private void startPrayerDrainTimer() { if (config.showPrayerDrainTimer()) From bd7e47f70ee1b8e3a9dce34ea380a08569e3559d Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 19 Feb 2021 19:53:10 -0500 Subject: [PATCH 21/33] devtools: add disconnect button --- .../runelite/client/plugins/devtools/DevToolsPanel.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsPanel.java index abc63546d9..54f0037639 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsPanel.java @@ -33,8 +33,10 @@ import javax.inject.Inject; import javax.swing.JButton; import javax.swing.JPanel; import net.runelite.api.Client; +import net.runelite.api.GameState; import net.runelite.api.MenuAction; import net.runelite.client.Notifier; +import net.runelite.client.callback.ClientThread; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.PluginPanel; import net.runelite.client.ui.overlay.OverlayMenuEntry; @@ -45,6 +47,7 @@ import net.runelite.client.util.ImageUtil; class DevToolsPanel extends PluginPanel { private final Client client; + private final ClientThread clientThread; private final Notifier notifier; private final DevToolsPlugin plugin; @@ -58,6 +61,7 @@ class DevToolsPanel extends PluginPanel @Inject private DevToolsPanel( Client client, + ClientThread clientThread, DevToolsPlugin plugin, WidgetInspector widgetInspector, VarInspector varInspector, @@ -69,6 +73,7 @@ class DevToolsPanel extends PluginPanel { super(); this.client = client; + this.clientThread = clientThread; this.plugin = plugin; this.widgetInspector = widgetInspector; this.varInspector = varInspector; @@ -205,6 +210,10 @@ class DevToolsPanel extends PluginPanel } }); + final JButton disconnectBtn = new JButton("Disconnect"); + disconnectBtn.addActionListener(e -> clientThread.invoke(() -> client.setGameState(GameState.CONNECTION_LOST))); + container.add(disconnectBtn); + return container; } } From 601128c1e72703f7556e08702d698c10f565eafe Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 19 Feb 2021 19:54:52 -0500 Subject: [PATCH 22/33] discord plugin: only check for area update on logged in gamestate --- .../net/runelite/client/plugins/discord/DiscordPlugin.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java index cfc0aa80e9..f6469dbac5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java @@ -172,10 +172,9 @@ public class DiscordPlugin extends Plugin resetState(); checkForGameStateUpdate(); } + checkForAreaUpdate(); break; } - - checkForAreaUpdate(); } @Subscribe From e1453e59e1df7b7fc42d14f020eb41c3f10126f2 Mon Sep 17 00:00:00 2001 From: Brandt Hill Date: Fri, 19 Feb 2021 19:34:57 -0600 Subject: [PATCH 23/33] Make Integer.class work when deserializing config --- .../src/main/java/net/runelite/client/config/ConfigManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java index b4bc89c2da..42a6d4e965 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java @@ -748,7 +748,7 @@ public class ConfigManager { return Boolean.parseBoolean(str); } - if (type == int.class) + if (type == int.class || type == Integer.class) { return Integer.parseInt(str); } From 37e6a326d0ecc00344ee9742f0426da95bdc8aa7 Mon Sep 17 00:00:00 2001 From: asdftemp <53125463+asdftemp@users.noreply.github.com> Date: Sat, 20 Feb 2021 23:20:56 +0100 Subject: [PATCH 24/33] item identification: Add logs and planks (#13171) --- .../ItemIdentification.java | 44 +++++++++++++++++++ .../ItemIdentificationConfig.java | 22 ++++++++++ .../ItemIdentificationOverlay.java | 12 +++++ 3 files changed, 78 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index c892de9420..dd230567ab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -75,6 +75,48 @@ enum ItemIdentification SITO_FOIL(Type.HERB, "Sito", "SF", ItemID.SITO_FOIL, ItemID.GRIMY_SITO_FOIL), SNAKE_WEED(Type.HERB, "Snake", "SW", ItemID.SNAKE_WEED, ItemID.GRIMY_SNAKE_WEED), VOLENCIA_MOSS(Type.HERB, "Volenc", "V", ItemID.VOLENCIA_MOSS, ItemID.GRIMY_VOLENCIA_MOSS), + + //Logs + RED_LOGS(Type.LOGS, "Red", "RED", ItemID.RED_LOGS), + GREEN_LOGS(Type.LOGS, "Green", "GRE", ItemID.GREEN_LOGS), + BLUE_LOGS(Type.LOGS, "Blue", "BLU", ItemID.BLUE_LOGS), + WHITE_LOGS(Type.LOGS, "White", "WHI", ItemID.WHITE_LOGS), + PURPLE_LOGS(Type.LOGS, "Purple", "PUR", ItemID.PURPLE_LOGS), + + SCRAPEY_TREE_LOGS(Type.LOGS, "Scrapey", "SCRAP", ItemID.SCRAPEY_TREE_LOGS), + + LOG(Type.LOGS, "Log", "LOG", ItemID.LOGS), + ACHEY_TREE_LOG(Type.LOGS, "Achey", "ACH", ItemID.ACHEY_TREE_LOGS), + OAK_LOG(Type.LOGS, "Oak", "OAK", ItemID.OAK_LOGS), + WILLOW_LOG(Type.LOGS, "Willow", "WIL", ItemID.WILLOW_LOGS), + TEAK_LOG(Type.LOGS, "Teak", "TEAK", ItemID.TEAK_LOGS), + JUNIPER_LOG(Type.LOGS, "Juniper", "JUN", ItemID.JUNIPER_LOGS), + MAPLE_LOG(Type.LOGS, "Maple", "MAP", ItemID.MAPLE_LOGS), + MAHOGANY_LOG(Type.LOGS, "Mahog", "MAH", ItemID.MAHOGANY_LOGS), + ARCTIC_PINE_LOG(Type.LOGS, "Arctic", "ARC", ItemID.ARCTIC_PINE_LOGS), + YEW_LOG(Type.LOGS, "Yew", "YEW", ItemID.YEW_LOGS), + BLISTERWOOD_LOG(Type.LOGS, "Blister", "BLI", ItemID.BLISTERWOOD_LOGS), + MAGIC_LOG(Type.LOGS, "Magic", "MAG", ItemID.MAGIC_LOGS), + REDWOOD_LOG(Type.LOGS, "Red", "RED", ItemID.REDWOOD_LOGS), + + PYRE_LOGS(Type.LOGS, "Pyre", "P", ItemID.PYRE_LOGS), + ARCTIC_PYRE_LOGS(Type.LOGS, "Art P", "AP", ItemID.ARCTIC_PYRE_LOGS), + OAK_PYRE_LOGS(Type.LOGS, "Oak P", "OAKP", ItemID.OAK_PYRE_LOGS), + WILLOW_PYRE_LOGS(Type.LOGS, "Wil P", "WILP", ItemID.WILLOW_PYRE_LOGS), + TEAK_PYRE_LOGS(Type.LOGS, "Teak P", "TEAKP", ItemID.TEAK_PYRE_LOGS), + MAPLE_PYRE_LOGS(Type.LOGS, "Map P", "MAPP", ItemID.MAPLE_PYRE_LOGS), + MAHOGANY_PYRE_LOGS(Type.LOGS, "Mah P", "MAHP", ItemID.MAHOGANY_PYRE_LOGS), + YEW_PYRE_LOGS(Type.LOGS, "Yew P", "YEWP", ItemID.YEW_PYRE_LOGS), + MAGIC_PYRE_LOGS(Type.LOGS, "Mag P", "MAGP", ItemID.MAGIC_PYRE_LOGS), + REDWOOD_PYRE_LOGS(Type.LOGS, "Red P", "REDP", ItemID.REDWOOD_PYRE_LOGS), + + //Planks + PLANK(Type.PLANK, "Plank", "PLANK", ItemID.PLANK), + OAK_PLANK(Type.PLANK, "Oak", "OAK", ItemID.OAK_PLANK), + TEAK_PLANK(Type.PLANK, "Teak", "TEAK", ItemID.TEAK_PLANK), + MAHOGANY_PLANK(Type.PLANK, "Mahog", "MAH", ItemID.MAHOGANY_PLANK), + WAXWOOD_PLANK(Type.PLANK, "Wax", "WAX", ItemID.WAXWOOD_PLANK), + MALLIGNUM_ROOT_PLANK(Type.PLANK, "Mallig", "MALL", ItemID.MALLIGNUM_ROOT_PLANK), //Saplings OAK_SAPLING(Type.SAPLING, "Oak", "OAK", ItemID.OAK_SAPLING, ItemID.OAK_SEEDLING, ItemID.OAK_SEEDLING_W), @@ -313,6 +355,8 @@ enum ItemIdentification SEED, SACK, HERB, + LOGS, + PLANK, SAPLING, ORE, GEM, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java index 606daac64d..ff0bb9442d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java @@ -94,6 +94,28 @@ public interface ItemIdentificationConfig extends Config return false; } + @ConfigItem( + keyName = "showLogs", + name = "Logs", + description = "Show identification on Logs", + section = identificationSection + ) + default boolean showLogs() + { + return false; + } + + @ConfigItem( + keyName = "showPlanks", + name = "Planks", + description = "Show identification on Planks", + section = identificationSection + ) + default boolean showPlanks() + { + return false; + } + @ConfigItem( keyName = "showSaplings", name = "Saplings", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java index c63db62924..10a43dfd89 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java @@ -83,6 +83,18 @@ class ItemIdentificationOverlay extends WidgetItemOverlay return; } break; + case LOGS: + if (!config.showLogs()) + { + return; + } + break; + case PLANK: + if (!config.showPlanks()) + { + return; + } + break; case SAPLING: if (!config.showSaplings()) { From 575ae4201c0e9b39347cca10dfd75a0922ccfa03 Mon Sep 17 00:00:00 2001 From: mkowen1 Date: Sat, 20 Feb 2021 14:23:51 -0800 Subject: [PATCH 25/33] item identification: Add more seeds --- .../ItemIdentification.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index c892de9420..22bfe28984 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -45,8 +45,28 @@ enum ItemIdentification LANTADYME_SEED(Type.SEED, "Lanta", "L", ItemID.LANTADYME_SEED), DWARF_WEED_SEED(Type.SEED, "Dwarf", "D", ItemID.DWARF_WEED_SEED), TORSTOL_SEED(Type.SEED, "Torstol", "TOR", ItemID.TORSTOL_SEED), + POISON_IVY_SEED(Type.SEED, "Ivy", "I", ItemID.POISON_IVY_SEED), WHITEBERRY_SEED(Type.SEED, "White", "W", ItemID.WHITEBERRY_SEED), + SEAWEED_SPORE(Type.SEED, "Seaweed", "SW", ItemID.SEAWEED_SPORE), + + HESPORI_SEED(Type.SEED, "Hespori", "HES", ItemID.HESPORI_SEED), + KRONOS_SEED(Type.SEED, "Kronos", "KRO", ItemID.KRONOS_SEED), + IASOR_SEED(Type.SEED, "Iasor", "IA", ItemID.IASOR_SEED), + ATTAS_SEED(Type.SEED, "Attas", "AT", ItemID.ATTAS_SEED), + CELASTRUS_SEED(Type.SEED, "Celas", "CEL", ItemID.CELASTRUS_SEED), + SPIRIT_SEED(Type.SEED, "Spirit", "SPI", ItemID.SPIRIT_SEED), + CALQUAT_SEED(Type.SEED, "Calquat", "CAL", ItemID.CALQUAT_TREE_SEED), + + ACORN(Type.SEED, "Oak", "OAK", ItemID.ACORN), + WILLOW_SEED(Type.SEED, "Willow", "WIL", ItemID.WILLOW_SEED), + MAPLE_SEED(Type.SEED, "Maple", "MAP", ItemID.MAPLE_SEED), + YEW_SEED(Type.SEED, "Yew", "YEW", ItemID.SPIRIT_SEED), + MAGIC_SEED(Type.SEED, "Magic", "MAG", ItemID.SPIRIT_SEED), + REDWOOD_SEED(Type.SEED, "Red", "RED", ItemID.REDWOOD_TREE_SEED), + TEAK_SEED(Type.SEED, "Teak", "TEAK", ItemID.TEAK_SEED), + MAHOGANY_SEED(Type.SEED, "Mahog", "MAH", ItemID.MAHOGANY_SEED), + CRYSTAL_ACORN(Type.SEED, "Crystal", "CRY", ItemID.CRYSTAL_ACORN), //Sacks SACK(Type.SACK, "Empty", "EMP", ItemID.EMPTY_SACK), From 09f0cfd0c80adcb84f5ecf29d8b742928f6c4d01 Mon Sep 17 00:00:00 2001 From: mkowen1 Date: Sat, 20 Feb 2021 14:25:07 -0800 Subject: [PATCH 26/33] item identification: Add lunar teleport tablets --- .../itemidentification/ItemIdentification.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index 22bfe28984..1b701d2259 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -253,15 +253,18 @@ enum ItemIdentification ARDOUGNE_TELEPORT(Type.TABLET, "Ardoug", "ARD", ItemID.ARDOUGNE_TELEPORT), WATCHTOWER_TELEPORT(Type.TABLET, "W.tow", "WT", ItemID.WATCHTOWER_TELEPORT), TELEPORT_TO_HOUSE(Type.TABLET, "House", "POH", ItemID.TELEPORT_TO_HOUSE), + ENCHANT_SAPPHIRE_OR_OPAL(Type.TABLET, "E.Saph", "E SO", ItemID.ENCHANT_SAPPHIRE_OR_OPAL), ENCHANT_EMERALD_OR_JADE(Type.TABLET, "E.Emer", "E EJ", ItemID.ENCHANT_EMERALD_OR_JADE), ENCHANT_RUBY_OR_TOPAZ(Type.TABLET, "E.Ruby", "E RT", ItemID.ENCHANT_RUBY_OR_TOPAZ), ENCHANT_DIAMOND(Type.TABLET, "E.Diam", "E DIA", ItemID.ENCHANT_DIAMOND), ENCHANT_DRAGONSTONE(Type.TABLET, "E.Dstn", "E DS", ItemID.ENCHANT_DRAGONSTONE), ENCHANT_ONYX(Type.TABLET, "E.Onyx", "E ONX", ItemID.ENCHANT_ONYX), + TELEKINETIC_GRAB(Type.TABLET, "T.grab", "T.GRB", ItemID.TELEKINETIC_GRAB), BONES_TO_PEACHES(Type.TABLET, "Peach", "BtP", ItemID.BONES_TO_PEACHES_8015), BONES_TO_BANANAS(Type.TABLET, "Banana", "BtB", ItemID.BONES_TO_BANANAS), + RIMMINGTON_TELEPORT(Type.TABLET, "Rimmi", "RIM", ItemID.RIMMINGTON_TELEPORT), TAVERLEY_TELEPORT(Type.TABLET, "Taver", "TAV", ItemID.TAVERLEY_TELEPORT), POLLNIVNEACH_TELEPORT(Type.TABLET, "Pollnv", "POL", ItemID.POLLNIVNEACH_TELEPORT), @@ -271,6 +274,7 @@ enum ItemIdentification TROLLHEIM_TELEPORT(Type.TABLET, "Trollh", "T.HM", ItemID.TROLLHEIM_TELEPORT), PRIFDDINAS_TELEPORT(Type.TABLET, "Prifd", "PRIF", ItemID.PRIFDDINAS_TELEPORT), HOSIDIUS_TELEPORT(Type.TABLET, "Hosid", "HOS", ItemID.HOSIDIUS_TELEPORT), + ANNAKARL_TELEPORT(Type.TABLET, "Annak", "GDZ", ItemID.ANNAKARL_TELEPORT), CARRALLANGAR_TELEPORT(Type.TABLET, "Carra", "CAR", ItemID.CARRALLANGAR_TELEPORT), DAREEYAK_TELEPORT(Type.TABLET, "Dareey", "DAR", ItemID.DAREEYAK_TELEPORT), @@ -278,6 +282,7 @@ enum ItemIdentification LASSAR_TELEPORT(Type.TABLET, "Lass", "LSR", ItemID.LASSAR_TELEPORT), PADDEWWA_TELEPORT(Type.TABLET, "Paddew", "PDW", ItemID.PADDEWWA_TELEPORT), SENNTISTEN_TELEPORT(Type.TABLET, "Sennt", "SNT", ItemID.SENNTISTEN_TELEPORT), + LUMBRIDGE_GRAVEYARD_TELEPORT(Type.TABLET, "L.Grave", "L.GRV", ItemID.LUMBRIDGE_GRAVEYARD_TELEPORT), DRAYNOR_MANOR_TELEPORT(Type.TABLET, "D.Manor", "D.MNR", ItemID.DRAYNOR_MANOR_TELEPORT), MIND_ALTAR_TELEPORT(Type.TABLET, "M.Altar", "M.ALT", ItemID.MIND_ALTAR_TELEPORT), @@ -289,6 +294,16 @@ enum ItemIdentification BARROWS_TELEPORT(Type.TABLET, "Barrow", "BAR", ItemID.BARROWS_TELEPORT), APE_ATOLL_TELEPORT(Type.TABLET, "Atoll", "APE", ItemID.APE_ATOLL_TELEPORT), BATTLEFRONT_TELEPORT(Type.TABLET, "B.Front", "BF", ItemID.BATTLEFRONT_TELEPORT), + + MOONCLAN_TELEPORT(Type.TABLET, "Moon", "MOON", ItemID.MOONCLAN_TELEPORT), + OURANIA_TELEPORT(Type.TABLET, "Ourania", "ZMI", ItemID.OURANIA_TELEPORT), + WATERBIRTH_TELEPORT(Type.TABLET, "W.Birth", "WAT", ItemID.WATERBIRTH_TELEPORT), + BARBARIAN_TELEPORT(Type.TABLET, "Barb", "BARB", ItemID.BARBARIAN_TELEPORT), + KHAZARD_TELEPORT(Type.TABLET, "Khaz", "KHA", ItemID.KHAZARD_TELEPORT), + FISHING_GUILD_TELEPORT(Type.TABLET, "Fish G.", "FIS", ItemID.FISHING_GUILD_TELEPORT), + CATHERBY_TELEPORT(Type.TABLET, "Cathy", "CATH", ItemID.CATHERBY_TELEPORT), + ICE_PLATEAU(Type.TABLET, "Ice Pl.", "ICE", ItemID.ICE_PLATEAU_TELEPORT), + TARGET_TELEPORT(Type.TABLET, "Target", "TRG", ItemID.TARGET_TELEPORT), VOLCANIC_MINE_TELEPORT(Type.TABLET, "V.Mine", "VM", ItemID.VOLCANIC_MINE_TELEPORT), WILDERNESS_CRABS_TELEPORT(Type.TABLET, "W.Crab", "CRAB", ItemID.WILDERNESS_CRABS_TELEPORT); From 68a544943c8b32c396a620cf76914976e345775c Mon Sep 17 00:00:00 2001 From: mkowen1 Date: Sat, 20 Feb 2021 14:27:01 -0800 Subject: [PATCH 27/33] item identification: Add composts --- .../itemidentification/ItemIdentification.java | 8 +++++++- .../itemidentification/ItemIdentificationConfig.java | 11 +++++++++++ .../itemidentification/ItemIdentificationOverlay.java | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index 1b701d2259..adaff1575e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -120,6 +120,11 @@ enum ItemIdentification CALQUAT_SAPLING(Type.SAPLING, "Calquat", "CALQ", ItemID.CALQUAT_SAPLING, ItemID.CALQUAT_SEEDLING, ItemID.CALQUAT_SEEDLING_W), CELASTRUS_SAPLING(Type.SAPLING, "Celas", "CEL", ItemID.CELASTRUS_SAPLING, ItemID.CELASTRUS_SEEDLING, ItemID.CELASTRUS_SEEDLING_W), + //Compost + COMPOST(Type.COMPOST, "Compost", "COM", ItemID.COMPOST), + SUPERCOMPOST(Type.COMPOST, "Sup Com", "SCOM", ItemID.SUPERCOMPOST), + ULTRACOMPOST(Type.COMPOST, "Ult Com", "UCOM", ItemID.ULTRACOMPOST), + //Ores COPPER_ORE(Type.ORE, "Copper", "COP", ItemID.COPPER_ORE), TIN_ORE(Type.ORE, "Tin", "TIN", ItemID.TIN_ORE), @@ -209,7 +214,7 @@ enum ItemIdentification SERUM_207(Type.POTION, "Ser207", "S7", ItemID.SERUM_207_4, ItemID.SERUM_207_3, ItemID.SERUM_207_2, ItemID.SERUM_207_1), SERUM_208(Type.POTION, "Ser208", "S8", ItemID.SERUM_208_4, ItemID.SERUM_208_3, ItemID.SERUM_208_2, ItemID.SERUM_208_1), - COMPOST(Type.POTION, "Compost", "Cp", ItemID.COMPOST_POTION4, ItemID.COMPOST_POTION3, ItemID.COMPOST_POTION2, ItemID.COMPOST_POTION1), + COMPOST_POTION(Type.POTION, "Compost", "COM", ItemID.COMPOST_POTION4, ItemID.COMPOST_POTION3, ItemID.COMPOST_POTION2, ItemID.COMPOST_POTION1), AGILITY(Type.POTION, "Agility", "Ag", ItemID.AGILITY_POTION4, ItemID.AGILITY_POTION3, ItemID.AGILITY_POTION2, ItemID.AGILITY_POTION1), FISHING(Type.POTION, "Fishing", "Fi", ItemID.FISHING_POTION4, ItemID.FISHING_POTION3, ItemID.FISHING_POTION2, ItemID.FISHING_POTION1), @@ -349,6 +354,7 @@ enum ItemIdentification SACK, HERB, SAPLING, + COMPOST, ORE, GEM, POTION, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java index 606daac64d..d677b5ccb8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java @@ -105,6 +105,17 @@ public interface ItemIdentificationConfig extends Config return true; } + @ConfigItem( + keyName = "showComposts", + name = "Composts", + description = "Show identification on Composts", + section = identificationSection + ) + default boolean showComposts() + { + return false; + } + @ConfigItem( keyName = "showOres", name = "Ores", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java index c63db62924..65bacc644e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java @@ -89,6 +89,12 @@ class ItemIdentificationOverlay extends WidgetItemOverlay return; } break; + case COMPOST: + if (!config.showComposts()) + { + return; + } + break; case ORE: if (!config.showOres()) { From 05cc4f419ca49f1594580ba363cc0d9538b7152d Mon Sep 17 00:00:00 2001 From: mkowen1 Date: Sat, 20 Feb 2021 14:27:44 -0800 Subject: [PATCH 28/33] item identification: Add bars --- .../itemidentification/ItemIdentification.java | 11 +++++++++++ .../itemidentification/ItemIdentificationConfig.java | 11 +++++++++++ .../itemidentification/ItemIdentificationOverlay.java | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index adaff1575e..458dd1395e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -147,6 +147,16 @@ enum ItemIdentification DAEYALT_ORE(Type.ORE, "Daeyalt", "DAE", ItemID.DAEYALT_ORE), LUNAR_ORE(Type.ORE, "Lunar", "LUN", ItemID.LUNAR_ORE), + //Bars + BRONZE_BAR(Type.BAR, "Bronze", "BRO", ItemID.BRONZE_BAR), + IRON_BAR(Type.BAR, "Iron", "IRO", ItemID.IRON_BAR), + SILVER_BAR(Type.BAR, "Silver", "SIL", ItemID.SILVER_BAR), + STEEL_BAR(Type.BAR, "Steel", "STE", ItemID.STEEL_BAR), + GOLD_BAR(Type.BAR, "Gold", "GOL", ItemID.GOLD_BAR), + MITHRIL_BAR(Type.BAR, "Mithril", "MIT", ItemID.MITHRIL_BAR), + ADAMANTITE_BAR(Type.BAR, "Adaman", "ADA", ItemID.ADAMANTITE_BAR), + RUNITE_BAR(Type.BAR, "Runite", "RUN", ItemID.RUNITE_BAR), + //Gems SAPPHIRE(Type.GEM, "Sapphir", "S", ItemID.UNCUT_SAPPHIRE, ItemID.SAPPHIRE), EMERALD(Type.GEM, "Emerald", "E", ItemID.UNCUT_EMERALD, ItemID.EMERALD), @@ -356,6 +366,7 @@ enum ItemIdentification SAPLING, COMPOST, ORE, + BAR, GEM, POTION, IMPLING_JAR, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java index d677b5ccb8..1a61948cf3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationConfig.java @@ -127,6 +127,17 @@ public interface ItemIdentificationConfig extends Config return false; } + @ConfigItem( + keyName = "showBars", + name = "Bars", + description = "Show identification on Bars", + section = identificationSection + ) + default boolean showBars() + { + return false; + } + @ConfigItem( keyName = "showGems", name = "Gems", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java index 65bacc644e..ce7a658398 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentificationOverlay.java @@ -101,6 +101,12 @@ class ItemIdentificationOverlay extends WidgetItemOverlay return; } break; + case BAR: + if (!config.showBars()) + { + return; + } + break; case GEM: if (!config.showGems()) { From 71ccf89580050832bc887a77311c035d59c4d8b3 Mon Sep 17 00:00:00 2001 From: joelewis43 <36579791+joelewis43@users.noreply.github.com> Date: Sat, 20 Feb 2021 14:54:10 -0800 Subject: [PATCH 29/33] menu entry swapper: Add Fossil Island Rowboat Dive swap (#13237) --- .../menuentryswapper/MenuEntrySwapperConfig.java | 11 +++++++++++ .../menuentryswapper/MenuEntrySwapperPlugin.java | 2 ++ 2 files changed, 13 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 a9564ff1c5..d10ceaebeb 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 @@ -650,4 +650,15 @@ public interface MenuEntrySwapperConfig extends Config { return false; } + + @ConfigItem( + keyName = "swapRowboatDive", + name = "Fossil Island Rowboat Dive", + description = "Swap Travel with Dive on the rowboat found on the small island north-east of Fossil Island", + section = objectSection + ) + default boolean swapRowboatDive() + { + return false; + } } 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 41ce37427e..d02db40188 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 @@ -373,6 +373,8 @@ public class MenuEntrySwapperPlugin extends Plugin swapTeleport("teleport to house", "outside"); swap("eat", "guzzle", config::swapRockCake); + + swap("travel", "dive", config::swapRowboatDive); } private void swap(String option, String swappedOption, Supplier enabled) From d716503c04630561e612e4f3938463d4119f460f Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sat, 20 Feb 2021 15:03:06 -0800 Subject: [PATCH 30/33] menu entry swapper config: Fix formatting from previous commit --- .../plugins/menuentryswapper/MenuEntrySwapperConfig.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 d10ceaebeb..30d54bfb65 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 @@ -652,10 +652,10 @@ public interface MenuEntrySwapperConfig extends Config } @ConfigItem( - keyName = "swapRowboatDive", - name = "Fossil Island Rowboat Dive", - description = "Swap Travel with Dive on the rowboat found on the small island north-east of Fossil Island", - section = objectSection + keyName = "swapRowboatDive", + name = "Fossil Island Rowboat Dive", + description = "Swap Travel with Dive on the rowboat found on the small island north-east of Fossil Island", + section = objectSection ) default boolean swapRowboatDive() { From b095ff7f1338431cd9f261543495d02f6f2c23cd Mon Sep 17 00:00:00 2001 From: joelewis43 <36579791+joelewis43@users.noreply.github.com> Date: Sat, 20 Feb 2021 15:07:40 -0800 Subject: [PATCH 31/33] SkillChallengeClue: Add Twisted Slayer Helmet to Dust devil step (#13245) --- .../client/plugins/cluescrolls/clues/SkillChallengeClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java index 41f6f283cb..7cd1f67f35 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java @@ -146,7 +146,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam new SkillChallengeClue("Steal from a chest in Ardougne Castle."), new SkillChallengeClue("Craft a green dragonhide body.", xOfItem(ItemID.GREEN_DRAGON_LEATHER, 3), item(ItemID.NEEDLE), item(ItemID.THREAD)), new SkillChallengeClue("String a yew longbow.", item(ItemID.YEW_LONGBOW_U), item(ItemID.BOW_STRING)), - new SkillChallengeClue("Kill a Dust Devil.", "slay a dust devil.", true, any("Facemask or Slayer Helmet", item(ItemID.FACEMASK), item(ItemID.SLAYER_HELMET), item(ItemID. SLAYER_HELMET_I), item(ItemID. BLACK_SLAYER_HELMET), item(ItemID. BLACK_SLAYER_HELMET_I), item(ItemID. PURPLE_SLAYER_HELMET), item(ItemID. PURPLE_SLAYER_HELMET_I), item(ItemID. RED_SLAYER_HELMET), item(ItemID. RED_SLAYER_HELMET_I), item(ItemID.GREEN_SLAYER_HELMET), item(ItemID. GREEN_SLAYER_HELMET_I), item(ItemID. TURQUOISE_SLAYER_HELMET), item(ItemID. TURQUOISE_SLAYER_HELMET_I), item(ItemID. HYDRA_SLAYER_HELMET), item(ItemID. HYDRA_SLAYER_HELMET_I))), + new SkillChallengeClue("Kill a Dust Devil.", "slay a dust devil.", true, any("Facemask or Slayer Helmet", item(ItemID.FACEMASK), item(ItemID.SLAYER_HELMET), item(ItemID. SLAYER_HELMET_I), item(ItemID. BLACK_SLAYER_HELMET), item(ItemID. BLACK_SLAYER_HELMET_I), item(ItemID. PURPLE_SLAYER_HELMET), item(ItemID. PURPLE_SLAYER_HELMET_I), item(ItemID. RED_SLAYER_HELMET), item(ItemID. RED_SLAYER_HELMET_I), item(ItemID.GREEN_SLAYER_HELMET), item(ItemID. GREEN_SLAYER_HELMET_I), item(ItemID. TURQUOISE_SLAYER_HELMET), item(ItemID. TURQUOISE_SLAYER_HELMET_I), item(ItemID. HYDRA_SLAYER_HELMET), item(ItemID. HYDRA_SLAYER_HELMET_I), item(ItemID.TWISTED_SLAYER_HELMET), item(ItemID.TWISTED_SLAYER_HELMET_I))), new SkillChallengeClue("Catch a black warlock.", item(ItemID.BUTTERFLY_JAR), any("Butterfly Net", item(ItemID.BUTTERFLY_NET), item(ItemID.MAGIC_BUTTERFLY_NET))), new SkillChallengeClue("Catch a red chinchompa.", item(ItemID.BOX_TRAP)), new SkillChallengeClue("Mine a mithril ore.", ANY_PICKAXE), From 50c39164b7f896c98e3ef8c55d3537a957e2cda7 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sat, 20 Feb 2021 19:25:53 -0800 Subject: [PATCH 32/33] item identification: Fix duplicate tree seed entries --- .../client/plugins/itemidentification/ItemIdentification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index 3e649d5a27..9b6531537b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -61,8 +61,8 @@ enum ItemIdentification ACORN(Type.SEED, "Oak", "OAK", ItemID.ACORN), WILLOW_SEED(Type.SEED, "Willow", "WIL", ItemID.WILLOW_SEED), MAPLE_SEED(Type.SEED, "Maple", "MAP", ItemID.MAPLE_SEED), - YEW_SEED(Type.SEED, "Yew", "YEW", ItemID.SPIRIT_SEED), - MAGIC_SEED(Type.SEED, "Magic", "MAG", ItemID.SPIRIT_SEED), + YEW_SEED(Type.SEED, "Yew", "YEW", ItemID.YEW_SEED), + MAGIC_SEED(Type.SEED, "Magic", "MAG", ItemID.MAGIC_SEED), REDWOOD_SEED(Type.SEED, "Red", "RED", ItemID.REDWOOD_TREE_SEED), TEAK_SEED(Type.SEED, "Teak", "TEAK", ItemID.TEAK_SEED), MAHOGANY_SEED(Type.SEED, "Mahog", "MAH", ItemID.MAHOGANY_SEED), From 5f7c2a9deeb010acf59dd905a79b4f1259e46c32 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 20 Feb 2021 11:11:09 -0500 Subject: [PATCH 33/33] corp plugin: use varbit changed event to track damage In masses it has been observed that the players damage counter can increment after the last hitsplat has been applied, which causes the final damage summary message to be incorrect --- .../client/plugins/corp/CorpPlugin.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/corp/CorpPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/corp/CorpPlugin.java index 284e8caea9..a6e9caf439 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/corp/CorpPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/corp/CorpPlugin.java @@ -43,6 +43,7 @@ import net.runelite.api.events.HitsplatApplied; import net.runelite.api.events.InteractingChanged; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcSpawned; +import net.runelite.api.events.VarbitChanged; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; import net.runelite.client.chat.ChatMessageManager; @@ -191,12 +192,6 @@ public class CorpPlugin extends Plugin return; } - int myDamage = client.getVar(Varbits.CORP_DAMAGE); - // sometimes hitsplats are applied after the damage counter has been reset - if (myDamage > 0) - { - yourDamage = myDamage; - } totalDamage += hitsplatApplied.getHitsplat().getAmount(); } @@ -213,4 +208,18 @@ public class CorpPlugin extends Plugin players.add(source); } + + @Subscribe + public void onVarbitChanged(VarbitChanged varbitChanged) + { + if (corp != null) + { + int myDamage = client.getVar(Varbits.CORP_DAMAGE); + // avoid resetting our counter when the client's is reset + if (myDamage > 0) + { + yourDamage = myDamage; + } + } + } }