From fa99ba9cf8ecd5d4f540d97aadc2e6b5ebe7b4c5 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 5 Apr 2019 05:10:21 -0600 Subject: [PATCH 01/37] runelite-client: remove RuneLiteModuleTest It is being tested sufficiently by PluginManagerTest --- .../runelite/client/RuneLiteModuleTest.java | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java diff --git a/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java b/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java deleted file mode 100644 index fbfdf9fbac..0000000000 --- a/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2016-2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client; - -import com.google.inject.Guice; -import net.runelite.client.rs.ClientUpdateCheckMode; -import org.junit.Test; - -public class RuneLiteModuleTest -{ - @Test - public void testConfigure() - { - Guice.createInjector(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)); - } -} From 64643c136d0bc7be5270b57a82585066aa66ec02 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 5 Apr 2019 05:24:05 -0600 Subject: [PATCH 02/37] runelite-client: Start the ClientLoader running before injection starts This saves about a second of startup time. It also removes the possibly incorrect ClientUpdateCheckMode from the RuneLiteModule --- .../java/net/runelite/client/RuneLite.java | 38 +++++++++++-------- .../net/runelite/client/RuneLiteModule.java | 14 +++---- .../client/rs/ClientConfigLoader.java | 22 ++++------- .../net/runelite/client/rs/ClientLoader.java | 29 +++++++------- .../client/plugins/PluginManagerTest.java | 6 +-- .../client/rs/ClientConfigLoaderTest.java | 4 +- 6 files changed, 55 insertions(+), 58 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 ecdda28103..46538678ec 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -58,6 +58,7 @@ import net.runelite.client.menus.MenuManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginInstantiationException; 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; @@ -183,20 +184,6 @@ public class RuneLite System.exit(0); } - final boolean developerMode = options.has("developer-mode") && RuneLiteProperties.getLauncherVersion() == null; - - if (developerMode) - { - boolean assertions = false; - assert assertions = true; - if (!assertions) - { - throw new RuntimeException("Developers should enable assertions; Add `-ea` to your JVM arguments`"); - } - } - - PROFILES_DIR.mkdirs(); - if (options.has("debug")) { final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); @@ -212,10 +199,31 @@ public class RuneLite } }); + final ClientLoader clientLoader = new ClientLoader(options.valueOf(updateMode)); + + new Thread(() -> + { + clientLoader.get(); + }, "Preloader").start(); + + final boolean developerMode = options.has("developer-mode") && RuneLiteProperties.getLauncherVersion() == null; + + if (developerMode) + { + boolean assertions = false; + assert assertions = true; + if (!assertions) + { + throw new RuntimeException("Developers should enable assertions; Add `-ea` to your JVM arguments`"); + } + } + + PROFILES_DIR.mkdirs(); + final long start = System.currentTimeMillis(); injector = Guice.createInjector(new RuneLiteModule( - options.valueOf(updateMode), + clientLoader, developerMode)); injector.getInstance(RuneLite.class).start(); diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java b/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java index 7ce80f8a1e..23b80ea009 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java @@ -30,6 +30,7 @@ import com.google.inject.name.Names; import java.applet.Applet; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; import javax.annotation.Nullable; import javax.inject.Singleton; import net.runelite.api.Client; @@ -44,8 +45,6 @@ import net.runelite.client.eventbus.EventBus; import net.runelite.client.game.ItemManager; 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.task.Scheduler; import net.runelite.client.util.DeferredEventBus; import net.runelite.client.util.ExecutorServiceExceptionLogger; @@ -56,19 +55,18 @@ import org.slf4j.LoggerFactory; public class RuneLiteModule extends AbstractModule { - private final ClientUpdateCheckMode updateCheckMode; + private final Supplier clientLoader; private final boolean developerMode; - public RuneLiteModule(final ClientUpdateCheckMode updateCheckMode, final boolean developerMode) + public RuneLiteModule(Supplier clientLoader, boolean developerMode) { - this.updateCheckMode = updateCheckMode; + this.clientLoader = clientLoader; this.developerMode = developerMode; } @Override protected void configure() { - bindConstant().annotatedWith(Names.named("updateCheckMode")).to(updateCheckMode); bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode); bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor())); bind(OkHttpClient.class).toInstance(RuneLiteAPI.CLIENT); @@ -96,9 +94,9 @@ public class RuneLiteModule extends AbstractModule @Provides @Singleton - Applet provideApplet(ClientLoader clientLoader) + Applet provideApplet() { - return clientLoader.load(); + return clientLoader.get(); } @Provides diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java index 9d3804ebab..41e7915eff 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java @@ -25,30 +25,22 @@ */ package net.runelite.client.rs; -import com.google.common.annotations.VisibleForTesting; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import javax.inject.Inject; -import javax.inject.Singleton; -import okhttp3.OkHttpClient; +import net.runelite.http.api.RuneLiteAPI; import okhttp3.Request; import okhttp3.Response; -@Singleton class ClientConfigLoader { - private static final String CONFIG_URL = "http://oldschool.runescape.com/jav_config.ws"; - private final OkHttpClient httpClient; - - @Inject - @VisibleForTesting - ClientConfigLoader(final OkHttpClient httpClient) + private ClientConfigLoader() { - this.httpClient = httpClient; } - RSConfig fetch() throws IOException + private static final String CONFIG_URL = "http://oldschool.runescape.com/jav_config.ws"; + + static RSConfig fetch() throws IOException { final Request request = new Request.Builder() .url(CONFIG_URL) @@ -56,8 +48,8 @@ class ClientConfigLoader final RSConfig config = new RSConfig(); - try (final Response response = httpClient.newCall(request).execute(); final BufferedReader in = new BufferedReader( - new InputStreamReader(response.body().byteStream()))) + try (final Response response = RuneLiteAPI.CLIENT.newCall(request).execute(); + final BufferedReader in = new BufferedReader(new InputStreamReader(response.body().byteStream()))) { String str; diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java index fb16dda6d2..e5adedb2f9 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java @@ -45,11 +45,9 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Map; +import java.util.function.Supplier; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import static net.runelite.client.rs.ClientUpdateCheckMode.AUTO; @@ -61,22 +59,27 @@ import okhttp3.Response; import org.apache.commons.compress.compressors.CompressorException; @Slf4j -@Singleton -public class ClientLoader +public class ClientLoader implements Supplier { - private final ClientConfigLoader clientConfigLoader; private ClientUpdateCheckMode updateCheckMode; + private Applet client = null; - @Inject - private ClientLoader( - @Named("updateCheckMode") final ClientUpdateCheckMode updateCheckMode, - final ClientConfigLoader clientConfigLoader) + public ClientLoader(ClientUpdateCheckMode updateCheckMode) { this.updateCheckMode = updateCheckMode; - this.clientConfigLoader = clientConfigLoader; } - public Applet load() + @Override + public synchronized Applet get() + { + if (client == null) + { + client = doLoad(); + } + return client; + } + + private Applet doLoad() { if (updateCheckMode == NONE) { @@ -85,7 +88,7 @@ public class ClientLoader try { - RSConfig config = clientConfigLoader.fetch(); + RSConfig config = ClientConfigLoader.fetch(); Map zipFile = new HashMap<>(); { diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java index 23196ff1cf..93dbeff17c 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java @@ -51,7 +51,6 @@ import net.runelite.client.RuneLiteModule; import net.runelite.client.eventbus.EventBus; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigItem; -import net.runelite.client.rs.ClientUpdateCheckMode; import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Rule; @@ -84,7 +83,7 @@ public class PluginManagerTest public void before() throws IOException { Injector injector = Guice.createInjector(Modules - .override(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)) + .override(new RuneLiteModule(() -> null, true)) .with(BoundFieldModule.of(this))); RuneLite.setInjector(injector); @@ -108,7 +107,6 @@ public class PluginManagerTest configClasses.add(clazz); } } - } @Test @@ -146,7 +144,7 @@ public class PluginManagerTest { List modules = new ArrayList<>(); modules.add(new GraphvizModule()); - modules.add(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)); + modules.add(new RuneLiteModule(() -> null, true)); PluginManager pluginManager = new PluginManager(true, null, null, null, null, null); pluginManager.loadCorePlugins(); diff --git a/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java b/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java index 719998d407..beb3400927 100644 --- a/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java +++ b/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java @@ -26,7 +26,6 @@ package net.runelite.client.rs; import java.io.IOException; -import okhttp3.OkHttpClient; import org.junit.Test; /** @@ -38,8 +37,7 @@ public class ClientConfigLoaderTest @Test public void test() throws IOException { - final ClientConfigLoader loader = new ClientConfigLoader(new OkHttpClient()); - final RSConfig config = loader.fetch(); + final RSConfig config = ClientConfigLoader.fetch(); for (String key : config.getClassLoaderProperties().keySet()) { From f42ebbfe8255b7ecf2277bffe249e821a53296cd Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 5 Apr 2019 06:14:41 -0600 Subject: [PATCH 03/37] runelite-client: Preload certain slow classes --- .../net/runelite/client/ClassPreloader.java | 48 +++++++++++++++++++ .../java/net/runelite/client/RuneLite.java | 1 + 2 files changed, 49 insertions(+) create mode 100644 runelite-client/src/main/java/net/runelite/client/ClassPreloader.java diff --git a/runelite-client/src/main/java/net/runelite/client/ClassPreloader.java b/runelite-client/src/main/java/net/runelite/client/ClassPreloader.java new file mode 100644 index 0000000000..227e8f3978 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/ClassPreloader.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 Abex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client; + +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import net.runelite.client.ui.FontManager; + +/** + * Loads some slow to initialize classes (hopefully) before they are needed to streamline client startup + */ +@SuppressWarnings({"ResultOfMethodCallIgnored", "unused"}) +class ClassPreloader +{ + static void preload() + { + // This needs to enumerate the system fonts for some reason, and that takes a while + FontManager.getRunescapeSmallFont(); + + // This needs to load a timezone database that is mildly large + ZoneId.of("Europe/London"); + + // This just needs to call 20 different DateTimeFormatter constructors, which are slow + Object unused = DateTimeFormatter.BASIC_ISO_DATE; + } +} 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 46538678ec..54887ec58e 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -204,6 +204,7 @@ public class RuneLite new Thread(() -> { clientLoader.get(); + ClassPreloader.preload(); }, "Preloader").start(); final boolean developerMode = options.has("developer-mode") && RuneLiteProperties.getLauncherVersion() == null; From c6149f0db0732ecf3f70abd3638c97055801d8f5 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Fri, 12 Jul 2019 22:27:55 -0700 Subject: [PATCH 04/37] overlaymanager: Add anyMatch method This will help plugins make informed decisions when, say, displaying different text when toggling an overlay on and off. --- .../runelite/client/ui/overlay/OverlayManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java index 5a6e240f90..2af17900b3 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java @@ -217,6 +217,17 @@ public class OverlayManager return removeIf; } + /** + * Returns whether an overlay exists which matches the given predicate. + * + * @param filter Filter predicate function + * @return {@code true} if any overlays match the given filter, {@code false} otherwise + */ + public synchronized boolean anyMatch(Predicate filter) + { + return overlays.stream().anyMatch(filter); + } + /** * Clear all overlays */ From ae8379b08a1b577cbd38cfcdb8af31e6155cf7c9 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Fri, 12 Jul 2019 22:29:12 -0700 Subject: [PATCH 05/37] xptrackerplugin: Add canvas menu options to skill tab This commit adds a configuration option to display menu options to add or remove a skill from the canvas from the skill tab. --- .../plugins/xptracker/XpTrackerConfig.java | 13 +++- .../plugins/xptracker/XpTrackerPlugin.java | 76 +++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java index 616844739b..9f4cedef32 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java @@ -94,6 +94,17 @@ public interface XpTrackerConfig extends Config @ConfigItem( position = 4, + keyName = "skillTabOverlayMenuOptions", + name = "Add skill tab canvas menu option", + description = "Configures whether a menu option to show/hide canvas XP trackers will be added to skills on the skill tab" + ) + default boolean skillTabOverlayMenuOptions() + { + return true; + } + + @ConfigItem( + position = 5, keyName = "onScreenDisplayMode", name = "On-screen tracker display mode (top)", description = "Configures the information displayed in the first line of on-screen XP overlays" @@ -104,7 +115,7 @@ public interface XpTrackerConfig extends Config } @ConfigItem( - position = 4, + position = 6, keyName = "onScreenDisplayModeBottom", name = "On-screen tracker display mode (bottom)", description = "Configures the information displayed in the second line of on-screen XP overlays" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java index 7d3006ddc9..2da0ffff2c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java @@ -31,6 +31,7 @@ import com.google.inject.Binder; import com.google.inject.Provides; import java.awt.image.BufferedImage; import java.time.temporal.ChronoUnit; +import java.util.Arrays; import java.util.EnumSet; import java.util.List; import java.util.Objects; @@ -40,6 +41,8 @@ import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.Experience; import net.runelite.api.GameState; +import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; import net.runelite.api.NPC; import net.runelite.api.Player; import net.runelite.api.Skill; @@ -48,7 +51,11 @@ import net.runelite.api.WorldType; import net.runelite.api.events.ExperienceChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; +import net.runelite.api.events.MenuEntryAdded; +import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcDespawned; +import net.runelite.api.widgets.WidgetID; +import static net.runelite.api.widgets.WidgetInfo.TO_GROUP; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.game.NPCManager; @@ -61,6 +68,7 @@ import net.runelite.client.ui.ClientToolbar; import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.overlay.OverlayManager; import net.runelite.client.util.ImageUtil; +import net.runelite.client.util.Text; import net.runelite.http.api.xp.XpClient; @PluginDescriptor( @@ -76,6 +84,9 @@ public class XpTrackerPlugin extends Plugin */ private static final int XP_THRESHOLD = 10_000; + private static final String MENUOP_ADD_CANVAS_TRACKER = "Add to canvas"; + private static final String MENUOP_REMOVE_CANVAS_TRACKER = "Remove from canvas"; + static final List COMBAT = ImmutableList.of( Skill.ATTACK, Skill.STRENGTH, @@ -375,6 +386,66 @@ public class XpTrackerPlugin extends Plugin } } + @Subscribe + public void onMenuEntryAdded(final MenuEntryAdded event) + { + int widgetID = event.getActionParam1(); + + if (TO_GROUP(widgetID) != WidgetID.SKILLS_GROUP_ID + || !event.getOption().startsWith("View") + || !xpTrackerConfig.skillTabOverlayMenuOptions()) + { + return; + } + + // Get skill from menu option, eg. "View Attack guide" + final String skillText = event.getOption().split(" ")[1]; + final Skill skill = Skill.valueOf(Text.removeTags(skillText).toUpperCase()); + + MenuEntry[] menuEntries = client.getMenuEntries(); + menuEntries = Arrays.copyOf(menuEntries, menuEntries.length + 1); + + MenuEntry menuEntry = menuEntries[menuEntries.length - 1] = new MenuEntry(); + menuEntry.setTarget(skillText); + menuEntry.setOption(hasOverlay(skill) ? MENUOP_REMOVE_CANVAS_TRACKER : MENUOP_ADD_CANVAS_TRACKER); + menuEntry.setParam0(event.getActionParam0()); + menuEntry.setParam1(widgetID); + menuEntry.setType(MenuAction.RUNELITE.getId()); + + client.setMenuEntries(menuEntries); + } + + @Subscribe + public void onMenuOptionClicked(MenuOptionClicked event) + { + if (event.getMenuAction().getId() != MenuAction.RUNELITE.getId() + || TO_GROUP(event.getWidgetId()) != WidgetID.SKILLS_GROUP_ID) + { + return; + } + + final Skill skill; + try + { + skill = Skill.valueOf(Text.removeTags(event.getMenuTarget()).toUpperCase()); + } + catch (IllegalArgumentException ex) + { + log.debug(null, ex); + return; + } + + switch (event.getMenuOption()) + { + case MENUOP_ADD_CANVAS_TRACKER: + addOverlay(skill); + break; + case MENUOP_REMOVE_CANVAS_TRACKER: + removeOverlay(skill); + break; + } + } + XpSnapshotSingle getSkillSnapshot(Skill skill) { return xpState.getSkillSnapshot(skill); @@ -561,4 +632,9 @@ public class XpTrackerPlugin extends Plugin pauseSkill(skill, pause); } } + + private boolean hasOverlay(final Skill skill) + { + return overlayManager.anyMatch(o -> o instanceof XpInfoBoxOverlay && ((XpInfoBoxOverlay) o).getSkill() == skill); + } } From bd7a6ed7ef2cbfe2ceb6c50c837c74c064d54bd4 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Thu, 25 Jul 2019 14:43:22 -0600 Subject: [PATCH 06/37] Update Quest Enum to latest cache --- runelite-api/src/main/java/net/runelite/api/Quest.java | 8 +++++--- .../diaries/ArdougneDiaryRequirement.java | 2 +- .../achievementdiary/diaries/WesternDiaryRequirement.java | 6 +++--- .../client/plugins/worldmap/QuestStartLocation.java | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Quest.java b/runelite-api/src/main/java/net/runelite/api/Quest.java index 420611d235..ec40bcec01 100644 --- a/runelite-api/src/main/java/net/runelite/api/Quest.java +++ b/runelite-api/src/main/java/net/runelite/api/Quest.java @@ -122,8 +122,8 @@ public enum Quest MONKEY_MADNESS_II(396, "Monkey Madness II"), MONKS_FRIEND(397, "Monk's Friend"), MOUNTAIN_DAUGHTER(398, "Mountain Daughter"), - MOURNINGS_ENDS_PART_I(399, "Mourning's Ends Part I"), - MOURNINGS_ENDS_PART_II(400, "Mourning's Ends Part II"), + MOURNINGS_END_PART_I(399, "Mourning's End Part I"), + MOURNINGS_END_PART_II(400, "Mourning's End Part II"), MURDER_MYSTERY(401, "Murder Mystery"), MY_ARMS_BIG_ADVENTURE(402, "My Arm's Big Adventure"), NATURE_SPIRIT(403, "Nature Spirit"), @@ -175,6 +175,7 @@ public enum Quest ZOGRE_FLESH_EATERS(449, "Zogre Flesh Eaters"), THE_ASCENT_OF_ARCEUUS(542, "The Ascent of Arceuus"), THE_FORSAKEN_TOWER(543, "The Forsaken Tower"), + SONG_OF_THE_ELVES(603, "Song of the Elves"), //Miniquests ENTER_THE_ABYSS(319, "Enter the Abyss"), @@ -188,7 +189,8 @@ public enum Quest THE_MAGE_ARENA(327, "The Mage Arena"), LAIR_OF_TARN_RAZORLOR(328, "Lair of Tarn Razorlor"), FAMILY_PEST(329, "Family Pest"), - THE_MAGE_ARENA_II(330, "The Mage Arena II"); + THE_MAGE_ARENA_II(330, "The Mage Arena II"), + IN_SEARCH_OF_KNOWLEDGE(602, "In Search of Knowledge"); @Getter private final int id; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java index fbb7bbfa78..e519510885 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java @@ -109,7 +109,7 @@ public class ArdougneDiaryRequirement extends GenericDiaryRequirement new QuestRequirement(Quest.LEGENDS_QUEST)); add("Craft some Death runes.", new SkillRequirement(Skill.RUNECRAFT, 65), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_II)); + new QuestRequirement(Quest.MOURNINGS_END_PART_II)); // ELITE add("Catch a Manta ray in the Fishing Trawler and cook it in Port Khazard.", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java index b136f889fe..ed253026ba 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java @@ -110,7 +110,7 @@ public class WesternDiaryRequirement extends GenericDiaryRequirement new QuestRequirement(Quest.REGICIDE)); add("Check the health of your Palm tree in Lletya.", new SkillRequirement(Skill.FARMING, 68), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_I, true)); + new QuestRequirement(Quest.MOURNINGS_END_PART_I, true)); add("Claim a Chompy bird hat from Rantz after registering at least 300 kills.", new QuestRequirement(Quest.BIG_CHOMPY_BIRD_HUNTING)); add("Build an Isafdar painting in your POH Quest hall.", @@ -128,7 +128,7 @@ public class WesternDiaryRequirement extends GenericDiaryRequirement // ELITE add("Fletch a Magic Longbow in the Elven lands.", new SkillRequirement(Skill.FLETCHING, 85), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_I)); + new QuestRequirement(Quest.MOURNINGS_END_PART_I)); add("Kill the Thermonuclear Smoke devil (Does not require task).", new SkillRequirement(Skill.SLAYER, 93)); add("Have Prissy Scilla protect your Magic tree.", @@ -140,6 +140,6 @@ public class WesternDiaryRequirement extends GenericDiaryRequirement new QuestRequirement(Quest.BIG_CHOMPY_BIRD_HUNTING)); add("Pickpocket an Elf.", new SkillRequirement(Skill.THIEVING, 85), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_I, true)); + new QuestRequirement(Quest.MOURNINGS_END_PART_I, true)); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index cfa3d9fb12..fd145ff041 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -122,8 +122,8 @@ enum QuestStartLocation MAKING_HISTORY(Quest.MAKING_HISTORY, new WorldPoint(2435, 3346, 0)), MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3209, 0)), MOUNTAIN_DAUGHTER(Quest.MOUNTAIN_DAUGHTER, new WorldPoint(2810, 3672, 0)), - MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_ENDS_PART_I, new WorldPoint(2289, 3149, 0)), - MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_ENDS_PART_II, new WorldPoint(2352, 3172, 0)), + MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_END_PART_I, new WorldPoint(2289, 3149, 0)), + MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_END_PART_II, new WorldPoint(2352, 3172, 0)), MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)), MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)), NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3440, 9894, 0)), From 0ed6e6a9a41b6e4c2b6a68d8dc6d89f4722f8237 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 26 Jul 2019 09:58:19 +0100 Subject: [PATCH 07/37] Add new Jethic medium clue step (#9456) --- .../runelite/client/plugins/cluescrolls/clues/AnagramClue.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java index a25e4c7e10..3023754e35 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java @@ -162,7 +162,8 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("RAIN COVE", "Veronica", new WorldPoint(3110, 3330, 0), "Outside Draynor Manor"), new AnagramClue("RUG DETER", "Gertrude", new WorldPoint(3151, 3412, 0), "West of Varrock, south of the Cooks' Guild"), new AnagramClue("SIR SHARE RED", "Hairdresser", new WorldPoint(2944, 3381, 0), "Western Falador"), - new AnagramClue("TAUNT ROOF", "Fortunato", new WorldPoint(3080, 3250, 0), "Draynor Village Market") + new AnagramClue("TAUNT ROOF", "Fortunato", new WorldPoint(3080, 3250, 0), "Draynor Village Market"), + new AnagramClue("HICK JET", "Jethick", new WorldPoint(2541, 3305, 0), "West Ardougne", "38") ); private final String text; From eaf7ec6674411714db554ddd873c1e06021bcde4 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sat, 2 Feb 2019 13:04:09 +0100 Subject: [PATCH 08/37] Use GL_DYNAMIC_DRAW for ever-changing uniformBuffer GL_STATIC_DRAW means that the buffer will be created once, set once, and used once, but its created once, updated a lot, and used a lot, what means it should use GL_DYNAMIC_DRAW (this param affects how glBufferSubData later works). Signed-off-by: Tomas Slusny --- .../main/java/net/runelite/client/plugins/gpu/GpuPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index 0141f9ebef..7909a09333 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -643,7 +643,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks } uniformBuffer.flip(); - gl.glBufferData(gl.GL_UNIFORM_BUFFER, uniformBuffer.limit() * Integer.BYTES, uniformBuffer, gl.GL_STATIC_DRAW); + gl.glBufferData(gl.GL_UNIFORM_BUFFER, uniformBuffer.limit() * Integer.BYTES, uniformBuffer, gl.GL_DYNAMIC_DRAW); gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, 0); } From 40ee0fede21afd01bb596b6e4da4c4fe5fd6a0d3 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Fri, 26 Jul 2019 02:15:55 -0700 Subject: [PATCH 09/37] Fix Ardounge -> Ardougne typo in cryptic clue description (#9460) --- .../runelite/client/plugins/cluescrolls/clues/CrypticClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java index b2d2981d26..6c5fd0103e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java @@ -266,7 +266,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("Thanks, Grandma!", "Tynan", new WorldPoint(1836, 3786, 0), "Tynan can be found in the north-east corner of Port Piscarilius."), new CrypticClue("In a town where everyone has perfect vision, seek some locked drawers in a house that sits opposite a workshop.", "Chicken", DRAWERS_25766, new WorldPoint(2709, 3478, 0), "The Seers' Village house south of the Elemental Workshop entrance. Kill any Chicken to obtain a key."), new CrypticClue("The treasure is buried in a small building full of bones. Here is a hint: it's not near a graveyard.", new WorldPoint(3356, 3507, 0), "In the western building near the Limestone quarry east of Varrock. Dig south of the box of bones in the smaller building."), - new CrypticClue("Search the crates in East Ardougne's general store.", CRATE_357, new WorldPoint(2615, 3291, 0), "Located south of the Ardounge church."), + new CrypticClue("Search the crates in East Ardougne's general store.", CRATE_357, new WorldPoint(2615, 3291, 0), "Located south of the Ardougne church."), new CrypticClue("Come brave adventurer, your sense is on fire. If you talk to me, it's an old god you desire.", "Viggora", null, "Speak to Viggora"), new CrypticClue("2 musical birds. Dig in front of the spinning light.", new WorldPoint(2671, 10396, 0), "Dig in front of the spinning light in Ping and Pong's room inside the Iceberg"), new CrypticClue("Search the wheelbarrow in Rimmington mine.", WHEELBARROW_9625, new WorldPoint(2978, 3239, 0), "The Rimmington mining site is located north of Rimmington."), From 7b7ac8ff93dfc277dd0181c3c334d4bedad7666d Mon Sep 17 00:00:00 2001 From: Daniel Serpa Date: Tue, 9 Jul 2019 16:09:03 -0400 Subject: [PATCH 10/37] quest list plugin: add not completed filter --- .../client/plugins/questlist/QuestListPlugin.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java index 62583460bb..ecc2a80bf3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java @@ -357,7 +357,14 @@ public class QuestListPlugin extends Plugin else { // Otherwise hide if it doesn't match the filter state - hidden = currentFilterState != QuestState.ALL && questState != currentFilterState; + if (currentFilterState == QuestState.NOT_COMPLETED) + { + hidden = questState == QuestState.COMPLETE; + } + else + { + hidden = currentFilterState != QuestState.ALL && questState != currentFilterState; + } } quest.setHidden(hidden); @@ -391,7 +398,8 @@ public class QuestListPlugin extends Plugin NOT_STARTED(0xff0000, "Not started", SpriteID.MINIMAP_ORB_HITPOINTS), IN_PROGRESS(0xffff00, "In progress", SpriteID.MINIMAP_ORB_HITPOINTS_DISEASE), COMPLETE(0xdc10d, "Completed", SpriteID.MINIMAP_ORB_HITPOINTS_POISON), - ALL(0, "All", SpriteID.MINIMAP_ORB_PRAYER); + ALL(0, "All", SpriteID.MINIMAP_ORB_PRAYER), + NOT_COMPLETED(0, "Not Completed", SpriteID.MINIMAP_ORB_RUN); private final int color; private final String name; From 029fd5e37299ae396c4fd1e07c01c580f1fdcda9 Mon Sep 17 00:00:00 2001 From: Jacky L <37294123+jkybtw@users.noreply.github.com> Date: Fri, 26 Jul 2019 20:07:45 +1000 Subject: [PATCH 11/37] Show HA profit while casting HA on items (#9070) --- .../client/plugins/itemprices/ItemPricesOverlay.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java index 5682a6f2b2..b7de787305 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java @@ -94,6 +94,11 @@ class ItemPricesOverlay extends Overlay // Tooltip action type handling switch (action) { + case ITEM_USE_ON_WIDGET: + if (!menuEntry.getTarget().contains("High Level Alchemy") || !config.showAlchProfit()) + { + break; + } case WIDGET_DEFAULT: case ITEM_USE: case ITEM_FIRST_OPTION: From f005e18295e13b94e65fe69cb36e16aa59573f7a Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 26 Jul 2019 06:48:07 -0600 Subject: [PATCH 12/37] timetracking: Support Prifddinas patches --- .../timetracking/farming/FarmingWorld.java | 7 ++++ .../farming/PatchImplementation.java | 32 +++++++++++++++++-- .../plugins/timetracking/farming/Produce.java | 3 +- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java index d74d9027f3..4683f2feb9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java @@ -244,6 +244,13 @@ class FarmingWorld new FarmingPatch("", Varbits.FARMING_7907, PatchImplementation.REDWOOD) )); + add(new FarmingRegion("Prifddinas", 13151, + new FarmingPatch("North", Varbits.FARMING_4771, PatchImplementation.ALLOTMENT), + new FarmingPatch("South", Varbits.FARMING_4772, PatchImplementation.ALLOTMENT), + new FarmingPatch("", Varbits.FARMING_4773, PatchImplementation.FLOWER), + new FarmingPatch("", Varbits.FARMING_4775, PatchImplementation.CRYSTAL_TREE) + )); + // Finalize this.regions = Collections.unmodifiableMap(regions); Map> umtabs = new TreeMap<>(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java index 1aab9a7320..401269d34d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java @@ -224,7 +224,7 @@ public enum PatchImplementation } if (value >= 63 && value <= 69) { - // snape grass seedling,Snape grass plant[Inspect,Guide] 33674,33675,33676,33677,33678,33679,33680 + // Snape grass seedling,Snape grass plant[Inspect,Guide] 33674,33675,33676,33677,33678,33679,33680 return new PatchState(Produce.SNAPE_GRASS, CropState.GROWING, value - 63); } if (value >= 70 && value <= 73) @@ -2391,7 +2391,7 @@ public enum PatchImplementation } if (value >= 46 && value <= 51) { - // Diseased Poato cactus[Cure,Inspect,Guide] 33749,33750,33751,33752,33753,33754 + // Diseased Potato cactus[Cure,Inspect,Guide] 33749,33750,33751,33752,33753,33754 return new PatchState(Produce.POTATO_CACTUS, CropState.DISEASED, value - 45); } if (value >= 52 && value <= 57) @@ -2575,6 +2575,34 @@ public enum PatchImplementation } return null; } + }, + CRYSTAL_TREE(Tab.FRUIT_TREE, "Crystal Tree") + { + @Override + PatchState forVarbitValue(int value) + { + if (value >= 0 && value <= 3) + { + // Crystal tree patch[Rake,Inspect,Guide] 34910,34909,34908,34907 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); + } + if (value >= 8 && value <= 13) + { + // Crystal tree[Inspect,Guide] 34911,34912,34913,34914,34915,34916 + return new PatchState(Produce.CRYSTAL_TREE, CropState.GROWING, value - 8); + } + if (value == 14) + { + // Crystal tree[Check-health,Inspect,Guide] 34917 + return new PatchState(Produce.CRYSTAL_TREE, CropState.GROWING, Produce.CRYSTAL_TREE.getStages() - 1); + } + if (value == 15) + { + // Crystal tree[Chop-down,Inspect,Guide] 34918 + return new PatchState(Produce.CRYSTAL_TREE, CropState.HARVESTABLE, 0); + } + return null; + } }; @Nullable diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java index 66883eedba..bcb4e5ab0b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java @@ -129,7 +129,8 @@ public enum Produce SPIRIT_TREE("Spirit tree", ItemID.SPIRIT_TREE, 320, 13), CELASTRUS("Celastrus", ItemID.BATTLESTAFF, 160, 6, 0, 4), REDWOOD("Redwood", ItemID.REDWOOD_LOGS, 640, 11), - HESPORI("Hespori", NullItemID.NULL_23044, 640, 4, 0, 2); + HESPORI("Hespori", NullItemID.NULL_23044, 640, 4, 0, 2), + CRYSTAL_TREE("Crystal tree", ItemID.CRYSTAL_SHARDS, 80, 7); /** * User-visible name From 6fa2a3d7a59410cc19ea39d1eb6f3781e68c74dc Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 26 Jul 2019 07:31:20 -0600 Subject: [PATCH 13/37] agility: Support Prifddinas course --- .../java/net/runelite/client/plugins/agility/Courses.java | 1 + .../net/runelite/client/plugins/agility/Obstacles.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java index cc732561c0..09826ec3eb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java @@ -46,6 +46,7 @@ enum Courses SEERS(570.0, 435, 10806), POLLNIVNEACH(890.0, 540, 13358), RELLEKA(780.0, 475, 10553), + PRIFDDINAS(1199.0, 968, 12895), ARDOUGNE(793.0, 529, 10547); private final static Map coursesByRegion; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java index 004eddf9fb..ad07643db7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java @@ -91,7 +91,12 @@ class Obstacles NULL_18116, FLOORBOARDS_18117, FLOORBOARDS_18118, STAIRS_DOWN, WALL_17980, // Werewolf STEPPING_STONE_11643, HURDLE, HURDLE_11639, HURDLE_11640, PIPE_11657, SKULL_SLOPE, ZIP_LINE, - ZIP_LINE_11645, ZIP_LINE_11646 + ZIP_LINE_11645, ZIP_LINE_11646, + // Prifddinas + LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, ROPE_BRIDGE_36233, + TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238, + // Prifddinas portals + NULL_36241, NULL_36242, NULL_36243, NULL_36244, NULL_36245, NULL_36246 ); static final Multimap SHORTCUT_OBSTACLE_IDS; From 2aab1d5b1911e60b489d3ae88cb81649e307933c Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 12:35:52 -0400 Subject: [PATCH 14/37] loot tracker: add Elven Crystal Chest --- .../runelite/client/plugins/loottracker/LootTrackerPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 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 a58cd128bf..794984acbf 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 @@ -117,7 +117,8 @@ public class LootTrackerPlugin extends Plugin 5179, "Brimstone Chest", 11573, "Crystal Chest", 12093, "Larran's big chest", - 13113, "Larran's small chest" + 13113, "Larran's small chest", + 13151, "Elven Crystal Chest" ); @Inject From c801c055510cbaf33269141ef537524499c8f287 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 26 Jul 2019 13:41:39 -0400 Subject: [PATCH 15/37] grounditems: add despawn timers Co-authored-by: Matthew Smith --- .../plugins/grounditems/GroundItem.java | 17 +++- .../grounditems/GroundItemsConfig.java | 11 +++ .../grounditems/GroundItemsOverlay.java | 97 +++++++++++++++++++ .../grounditems/GroundItemsPlugin.java | 34 ++++++- .../client/plugins/grounditems/LootType.java | 32 ++++++ 5 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java index 2d81060bcd..fab3857fa6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java @@ -24,6 +24,9 @@ */ package net.runelite.client.plugins.grounditems; +import java.time.Instant; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import lombok.Builder; import lombok.Data; import lombok.Value; @@ -43,7 +46,14 @@ class GroundItem private int gePrice; private int offset; private boolean tradeable; - private boolean isMine; + @Nonnull + private LootType lootType; + /** + * Is dropped by me + */ + private boolean isDropped; + @Nullable + private Instant spawnTime; int getHaPrice() { @@ -55,6 +65,11 @@ class GroundItem return gePrice * quantity; } + boolean isMine() + { + return lootType != LootType.UNKNOWN; + } + @Value static class GroundItemKey { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java index f9c3a79e85..41cc1afa7f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java @@ -358,4 +358,15 @@ public interface GroundItemsConfig extends Config { return false; } + + @ConfigItem( + keyName = "groundItemTimers", + name = "Show despawn timers", + description = "Shows despawn timers for items you've dropped and received as loot", + position = 28 + ) + default boolean groundItemTimers() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java index 1406bb1747..9d909c300b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java @@ -31,6 +31,9 @@ import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Rectangle; +import java.time.Duration; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.Collection; @@ -50,8 +53,10 @@ import net.runelite.client.ui.overlay.OverlayLayer; import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayUtil; import net.runelite.client.ui.overlay.components.BackgroundComponent; +import net.runelite.client.ui.overlay.components.ProgressPieComponent; import net.runelite.client.ui.overlay.components.TextComponent; import net.runelite.client.util.StackFormatter; +import org.apache.commons.lang3.ArrayUtils; public class GroundItemsOverlay extends Overlay { @@ -66,6 +71,13 @@ public class GroundItemsOverlay extends Overlay private static final int STRING_GAP = 15; // Size of the hidden/highlight boxes private static final int RECTANGLE_SIZE = 8; + private static final Color PUBLIC_TIMER_COLOR = Color.YELLOW; + private static final Color PRIVATE_TIMER_COLOR = Color.GREEN; + private static final int TIMER_OVERLAY_DIAMETER = 10; + private static final Duration DESPAWN_TIME_INSTANCE = Duration.ofMinutes(30); + private static final Duration DESPAWN_TIME_LOOT = Duration.ofMinutes(2); + private static final Duration DESPAWN_TIME_DROP = Duration.ofMinutes(3); + private static final int KRAKEN_REGION = 9116; private final Client client; private final GroundItemsPlugin plugin; @@ -73,6 +85,7 @@ public class GroundItemsOverlay extends Overlay private final StringBuilder itemStringBuilder = new StringBuilder(); private final BackgroundComponent backgroundComponent = new BackgroundComponent(); private final TextComponent textComponent = new TextComponent(); + private final ProgressPieComponent progressPieComponent = new ProgressPieComponent(); private final Map offsetMap = new HashMap<>(); @Inject @@ -163,6 +176,7 @@ public class GroundItemsOverlay extends Overlay plugin.setHighlightBoxBounds(null); final boolean onlyShowLoot = config.onlyShowLoot(); + final boolean groundItemTimers = config.groundItemTimers(); for (GroundItem item : groundItemList) { @@ -333,6 +347,11 @@ public class GroundItemsOverlay extends Overlay drawRectangle(graphics, itemHighlightBox, topItem && mouseInHighlightBox ? Color.GREEN : color, highlighted != null, false); } + if (groundItemTimers || plugin.isHotKeyPressed()) + { + drawTimerOverlay(graphics, textX, textY, item); + } + textComponent.setText(itemString); textComponent.setColor(color); textComponent.setPosition(new java.awt.Point(textX, textY)); @@ -342,6 +361,79 @@ public class GroundItemsOverlay extends Overlay return null; } + private void drawTimerOverlay(Graphics2D graphics, int textX, int textY, GroundItem groundItem) + { + // We can only accurately guess despawn times for our own pvm loot and dropped items + if (groundItem.getLootType() != LootType.PVM && !groundItem.isDropped()) + { + return; + } + + // Loot appears to others after 1 minute, and despawns after 2 minutes + // Dropped items appear to others after 1 minute, and despawns after 3 minutes + // Items in instances never appear to anyone and despawn after 30 minutes + + Instant spawnTime = groundItem.getSpawnTime(); + if (spawnTime == null) + { + return; + } + + Instant despawnTime; + Instant now = Instant.now(); + Color fillColor; + if (client.isInInstancedRegion()) + { + // Items in the Kraken instance appear to never despawn? + if (isInKraken()) + { + return; + } + + despawnTime = spawnTime.plus(DESPAWN_TIME_INSTANCE); + fillColor = PRIVATE_TIMER_COLOR; + } + else + { + if (groundItem.isDropped()) + { + despawnTime = spawnTime.plus(DESPAWN_TIME_DROP); + } + else + { + despawnTime = spawnTime.plus(DESPAWN_TIME_LOOT); + } + + // If it has not yet been a minute, the item is private + if (spawnTime.plus(1, ChronoUnit.MINUTES).isAfter(now)) + { + fillColor = PRIVATE_TIMER_COLOR; + } + else + { + fillColor = PUBLIC_TIMER_COLOR; + } + } + + if (now.isBefore(spawnTime) || now.isAfter(despawnTime)) + { + // that's weird + return; + } + + float percent = (float) (now.toEpochMilli() - spawnTime.toEpochMilli()) / (despawnTime.toEpochMilli() - spawnTime.toEpochMilli()); + + progressPieComponent.setDiameter(TIMER_OVERLAY_DIAMETER); + // Shift over to not be on top of the text + int x = textX - TIMER_OVERLAY_DIAMETER; + int y = textY - TIMER_OVERLAY_DIAMETER / 2; + progressPieComponent.setPosition(new Point(x, y)); + progressPieComponent.setFill(fillColor); + progressPieComponent.setBorderColor(fillColor); + progressPieComponent.setProgress(1 - percent); // inverse so pie drains over time + progressPieComponent.render(graphics); + } + private void drawRectangle(Graphics2D graphics, Rectangle rect, Color color, boolean inList, boolean hiddenBox) { graphics.setColor(Color.BLACK); @@ -379,4 +471,9 @@ public class GroundItemsOverlay extends Overlay } + private boolean isInKraken() + { + return ArrayUtils.contains(client.getMapRegions(), KRAKEN_REGION); + } + } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java index 4830c3d59d..22899c3a69 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java @@ -27,10 +27,12 @@ package net.runelite.client.plugins.grounditems; import com.google.common.cache.CacheBuilder; import com.google.common.cache.LoadingCache; +import com.google.common.collect.EvictingQueue; import com.google.inject.Provides; import java.awt.Color; import java.awt.Rectangle; import static java.lang.Boolean.TRUE; +import java.time.Instant; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -38,6 +40,7 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Queue; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.TimeUnit; @@ -67,6 +70,7 @@ import net.runelite.api.events.ItemDespawned; import net.runelite.api.events.ItemQuantityChanged; import net.runelite.api.events.ItemSpawned; import net.runelite.api.events.MenuEntryAdded; +import net.runelite.api.events.MenuOptionClicked; import net.runelite.client.Notifier; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; @@ -164,6 +168,7 @@ public class GroundItemsPlugin extends Plugin private final Map priceChecks = new LinkedHashMap<>(); private LoadingCache highlightedItems; private LoadingCache hiddenItems; + private final Queue droppedItemQueue = EvictingQueue.create(16); // recently dropped items @Provides GroundItemsConfig provideConfig(ConfigManager configManager) @@ -226,6 +231,7 @@ public class GroundItemsPlugin extends Plugin if (existing != null) { existing.setQuantity(existing.getQuantity() + groundItem.getQuantity()); + // The spawn time remains set at the oldest spawn } boolean shouldNotify = !config.onlyShowLoot() && config.highlightedColor().equals(getHighlighted( @@ -259,6 +265,10 @@ public class GroundItemsPlugin extends Plugin else { groundItem.setQuantity(groundItem.getQuantity() - item.getQuantity()); + // When picking up an item when multiple stacks appear on the ground, + // it is not known which item is picked up, so we invalidate the spawn + // time + groundItem.setSpawnTime(null); } } @@ -283,14 +293,14 @@ public class GroundItemsPlugin extends Plugin public void onNpcLootReceived(NpcLootReceived npcLootReceived) { Collection items = npcLootReceived.getItems(); - lootReceived(items); + lootReceived(items, LootType.PVM); } @Subscribe public void onPlayerLootReceived(PlayerLootReceived playerLootReceived) { Collection items = playerLootReceived.getItems(); - lootReceived(items); + lootReceived(items, LootType.PVP); } @Subscribe @@ -341,7 +351,7 @@ public class GroundItemsPlugin extends Plugin }).toArray(MenuEntry[]::new)); } - private void lootReceived(Collection items) + private void lootReceived(Collection items, LootType lootType) { for (ItemStack itemStack : items) { @@ -350,7 +360,7 @@ public class GroundItemsPlugin extends Plugin GroundItem groundItem = collectedGroundItems.get(groundItemKey); if (groundItem != null) { - groundItem.setMine(true); + groundItem.setLootType(lootType); boolean shouldNotify = config.onlyShowLoot() && config.highlightedColor().equals(getHighlighted( groundItem.getName(), @@ -372,6 +382,7 @@ public class GroundItemsPlugin extends Plugin final ItemComposition itemComposition = itemManager.getItemComposition(itemId); final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId; final int alchPrice = Math.round(itemComposition.getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER); + final boolean dropped = tile.getWorldLocation().equals(client.getLocalPlayer().getWorldLocation()) && droppedItemQueue.remove(itemId); final GroundItem groundItem = GroundItem.builder() .id(itemId) @@ -382,6 +393,9 @@ public class GroundItemsPlugin extends Plugin .haPrice(alchPrice) .height(tile.getItemLayer().getHeight()) .tradeable(itemComposition.isTradeable()) + .lootType(LootType.UNKNOWN) + .isDropped(dropped) + .spawnTime(Instant.now()) .build(); @@ -667,4 +681,16 @@ public class GroundItemsPlugin extends Plugin notificationStringBuilder.append("!"); notifier.notify(notificationStringBuilder.toString()); } + + @Subscribe + public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked) + { + if (menuOptionClicked.getMenuAction() == MenuAction.ITEM_DROP) + { + int itemId = menuOptionClicked.getId(); + // Keep a queue of recently dropped items to better detect + // item spawns that are drops + droppedItemQueue.add(itemId); + } + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java new file mode 100644 index 0000000000..abd6c815e0 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.grounditems; + +enum LootType +{ + UNKNOWN, + PVP, + PVM; +} From d5bf137ca7a350f3818adaba8cf04274406c1a38 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 25 Jul 2019 11:54:49 -0400 Subject: [PATCH 16/37] zoom plugin: fix range bounds for ctrl zoom value config Co-authored-by: Adam --- .../net/runelite/client/plugins/zoom/ZoomConfig.java | 8 +++++++- .../net/runelite/client/plugins/zoom/ZoomPlugin.java | 10 ++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java index 1ed1c5700d..781e105298 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java @@ -34,6 +34,12 @@ public interface ZoomConfig extends Config { int OUTER_LIMIT_MIN = -400; int OUTER_LIMIT_MAX = 400; + /** + * The largest (most zoomed in) value that can be used without the client crashing. + * + * Larger values trigger an overflow in the engine's fov to scale code. + */ + int INNER_ZOOM_LIMIT = 1004; @ConfigItem( keyName = "inner", @@ -91,7 +97,7 @@ public interface ZoomConfig extends Config ) @Range( min = OUTER_LIMIT_MIN, - max = OUTER_LIMIT_MAX + max = INNER_ZOOM_LIMIT ) default int ctrlZoomValue() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomPlugin.java index 4b2e127bf9..b95a022f15 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomPlugin.java @@ -50,12 +50,6 @@ import net.runelite.client.plugins.PluginDescriptor; ) public class ZoomPlugin extends Plugin implements KeyListener { - /** - * The largest (most zoomed in) value that can be used without the client crashing. - * - * Larger values trigger an overflow in the engine's fov to scale code. - */ - private static final int INNER_ZOOM_LIMIT = 1004; private static final int DEFAULT_ZOOM_INCREMENT = 25; private boolean controlDown; @@ -98,7 +92,7 @@ public class ZoomPlugin extends Plugin implements KeyListener if ("innerZoomLimit".equals(event.getEventName()) && zoomConfig.innerLimit()) { - intStack[intStackSize - 1] = INNER_ZOOM_LIMIT; + intStack[intStackSize - 1] = ZoomConfig.INNER_ZOOM_LIMIT; return; } @@ -195,7 +189,7 @@ public class ZoomPlugin extends Plugin implements KeyListener if (zoomConfig.controlFunction() == ControlFunction.CONTROL_TO_RESET) { - final int zoomValue = Ints.constrainToRange(zoomConfig.ctrlZoomValue(), zoomConfig.OUTER_LIMIT_MIN, INNER_ZOOM_LIMIT); + final int zoomValue = Ints.constrainToRange(zoomConfig.ctrlZoomValue(), ZoomConfig.OUTER_LIMIT_MIN, ZoomConfig.INNER_ZOOM_LIMIT); clientThread.invokeLater(() -> client.runScript(ScriptID.CAMERA_DO_ZOOM, zoomValue, zoomValue)); } } From bcd6b52b262dfc109e7565118234dd8b731d5b7a Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 14:12:28 -0400 Subject: [PATCH 17/37] world map: add song of the elves quest location --- .../runelite/client/plugins/worldmap/QuestStartLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index cfa3d9fb12..5c0f51e7de 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -130,7 +130,7 @@ enum QuestStartLocation OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)), OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)), ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)), - PLAGUE_CITY(Quest.PLAGUE_CITY, new WorldPoint(2567, 3334, 0)), + PLAGUE_CITY_SONG_OF_THE_ELVES(new Quest[]{Quest.PLAGUE_CITY, Quest.SONG_OF_THE_ELVES}, new WorldPoint(2567, 3334, 0)), PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)), THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)), RAG_AND_BONE_MAN(new Quest[]{Quest.RAG_AND_BONE_MAN, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)), From fe8a01e4a67f7872af2c0bfe1ebc3e654bee7321 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 15:04:15 -0400 Subject: [PATCH 18/37] world map: add Prifddinas rare tree icons --- .../plugins/worldmap/RareTreeLocation.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java index 843d6eb645..452eef5bc7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java @@ -50,7 +50,10 @@ enum RareTreeLocation new WorldPoint(2899, 2897, 0), // Feldip Hills - new WorldPoint(2333, 3049, 0)), + new WorldPoint(2333, 3049, 0), + + // Prifddinas + new WorldPoint(3309, 6123, 0)), SWAYING("Swaying tree", 40, // The Fremennik Trials @@ -78,7 +81,11 @@ enum RareTreeLocation new WorldPoint(2726, 3501, 0), new WorldPoint(2728, 3481, 0), new WorldPoint(2748, 3466, 0), - new WorldPoint(2710, 3570, 0)), + new WorldPoint(2710, 3570, 0), + + // Prifddinas + new WorldPoint(2209, 3427, 0), + new WorldPoint(3233, 6179, 0)), MAHOGANY("Mahogany tree", 50, // Zeah @@ -92,7 +99,10 @@ enum RareTreeLocation new WorldPoint(3824, 3053, 0), // Karamja - new WorldPoint(2946, 2908, 0)), + new WorldPoint(2946, 2908, 0), + + // Prifddinas + new WorldPoint(3301, 6129, 0)), TEAK_MAHOGANY("Teak/Mahogany trees", 50, // Miscellania @@ -126,6 +136,10 @@ enum RareTreeLocation // Tirannwn new WorldPoint(2217, 3141, 0), + // Prifddinas + new WorldPoint(3288, 6066, 0), + new WorldPoint(3305, 6032, 0), + // Kandarin new WorldPoint(2315, 3610, 0), new WorldPoint(2331, 3514, 0), @@ -202,6 +216,9 @@ enum RareTreeLocation // Tirannwn new WorldPoint(2284, 3141, 0), + // Prifddinas + new WorldPoint(3229, 6101, 0), + // Kandarin new WorldPoint(2371, 3427, 0), new WorldPoint(2432, 3411, 0), From ae722647dcf1a767f282deb25411a4ff2303a030 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 16:37:59 -0400 Subject: [PATCH 19/37] world map: add Prifddinas tranportation icons --- .../client/plugins/worldmap/TransportationPointLocation.java | 4 ++++ 1 file changed, 4 insertions(+) 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 54bd7adfdc..85faf24359 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 @@ -114,6 +114,8 @@ enum TransportationPointLocation CHARTER_PORT_PHASMATYS("Charter Ship", new WorldPoint(3702, 3503, 0)), CHARTER_PORTSARIM("Charter Ship", new WorldPoint(3037, 3191, 0)), CHARTER_TYRAS("Charter Ship", new WorldPoint(2141, 3123, 0)), + CHARTER_PRIFDDINAS("Charter Ship", new WorldPoint(2156, 3331, 0)), + CHARTER_PRIFDDINAS_INSTANCE("Charter Ship", new WorldPoint(3180, 6083, 0)), //Minecarts/Carts MINE_CART_ARCEUUS("Minecart", new WorldPoint(1673, 3832, 0)), @@ -155,6 +157,7 @@ enum TransportationPointLocation SPIRITTREE_GNOMESTRONGHOLD("Spirit Tree", new WorldPoint(2459, 3446, 0)), SPIRITTREE_GNOMEVILLAGE("Spirit Tree", new WorldPoint(2538, 3166, 0)), SPIRITTREE_GRANDEXCHANGE("Spirit Tree", new WorldPoint(3184, 3510, 0)), + SPIRITTREE_PRIFDDINAS("Spirit Tree", new WorldPoint(3274, 6124, 0)), //Carpets CARPET_KHARID("Carpet to Bedabin/Pollnivneach/Uzer", new WorldPoint(3311, 3107, 0)), @@ -172,6 +175,7 @@ enum TransportationPointLocation TELEPORT_RUNE_ARDOUGNE("Teleport to Rune Essence", new WorldPoint(2681, 3325, 0)), TELEPORT_RUNE_YANILLE("Teleport to Rune Essence", new WorldPoint(2592, 3089, 0)), TELEPORT_SORCERESS_GARDEN("Teleport to Sorceress's Garden", new WorldPoint(3320, 3141, 0)), + TELEPORT_PRIFDDINAS_LIBRARY("Teleport to Priffdinas Library", new WorldPoint(3254, 6082, 2)), //Other ALTER_KOUREND_UNDERGROUND("Altar to Skotizo", new WorldPoint(1662, 10047, 0)), From 5cec9697154d9d94172abfc066a7bb5fbaea4b21 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 17:47:52 -0400 Subject: [PATCH 20/37] world map: add teleport crytal icon --- .../plugins/worldmap/TeleportLocationData.java | 2 ++ .../plugins/worldmap/teleport_crystal_icon.png | Bin 0 -> 373 bytes 2 files changed, 2 insertions(+) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/teleport_crystal_icon.png diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index 520f48ec3d..dfeaa200ca 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -139,6 +139,8 @@ enum TeleportLocationData PHARAOHS_SCEPTRE_JALEUSTROPHOS(TeleportType.OTHER, "Pharaoh's Sceptre", "Jaleustrophos (Agility Pyramid)", new WorldPoint(3341, 2827, 0), "pharaohs_sceptre_teleport_icon.png"), PHARAOHS_SCEPTRE_JALDRAOCHT(TeleportType.OTHER, "Pharaoh's Sceptre", "Jaldraocht (Desert Treasure Pyramid)", new WorldPoint(3232, 2897, 0), "pharaohs_sceptre_teleport_icon.png"), CAMULET_TEMPLE(TeleportType.OTHER, "Camulet", "Enakhra's Temple", new WorldPoint(3190, 2923, 0), "camulet_teleport_icon.png"), + TELEPORT_CRYSTAL_LLETYA(TeleportType.OTHER, "Teleport crystal", "Lletya", new WorldPoint(2330, 3172, 0), "teleport_crystal_icon.png"), + TELEPORT_CRYSTAL_PRIFDDINAS(TeleportType.OTHER, "Teleport crystal", "Prifddinas", new WorldPoint(3264, 6065, 0), "teleport_crystal_icon.png"), // Wilderness OBELISK_13(TeleportType.OTHER, "Obelisk", "13", new WorldPoint(3156, 3620, 0), "obelisk_icon.png"), diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/teleport_crystal_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/teleport_crystal_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0ae82e1a5ad50056684a2a7397c2c001a662d401 GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^{2Odj&r>Pp_T*!xsA%f>#Zjkm_DE6h{oq%YjQ;%N2 z!X@Y0Hfq zr{IP|X*We=dXFicmUAmJ@LhlE<7bPBhKZ{z=KDvcmh85zliMJ9mb+RlLo{{4Nv^{V z?`LX={9w>6<^Q^W-zuSP7ows%-}&sg%OBu=%Y4^r%ZNXJb8r9o5YG9L>33o>Z|3V8 RR=}WQ@O1TaS?83{1OVqHl&Amz literal 0 HcmV?d00001 From b8935e2493cb66d32252a31dc2fdac61302f5ceb Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 17:49:12 -0400 Subject: [PATCH 21/37] world map: elf camp -> Iorwerth camp teleport scroll --- .../runelite/client/plugins/worldmap/TeleportLocationData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index dfeaa200ca..15c864893f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -169,7 +169,7 @@ enum TeleportLocationData // Scrolls DIGSITE_SCROLL(TeleportType.SCROLL, "Digsite Teleport", new WorldPoint(3324, 3412, 0), "scroll_teleport_icon.png"), - ELF_CAMP_SCROLL(TeleportType.SCROLL, "Elf Camp Teleport", new WorldPoint(2193, 3257, 0), "scroll_teleport_icon.png"), + IORWERTH_CAMP_SCROLL(TeleportType.SCROLL, "Iorwerth Camp Teleport", new WorldPoint(2193, 3257, 0), "scroll_teleport_icon.png"), FELDIP_HILLS_SCROLL(TeleportType.SCROLL, "Feldip Hills Teleport", new WorldPoint(2542, 2925, 0), "scroll_teleport_icon.png"), LUMBERYARD_SCROLL(TeleportType.SCROLL, "Lumberyard Teleport", new WorldPoint(3303, 3487, 0), "scroll_teleport_icon.png"), LUNAR_ISLE_SCROLL(TeleportType.SCROLL, "Lunar Isle Teleport", new WorldPoint(2093, 3912, 0), "scroll_teleport_icon.png"), From 852969ef08bd23ff8bb85daa4a055fc6a066d1bd Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 17:59:20 -0400 Subject: [PATCH 22/37] world map: add Prifddinas farming patch icons --- .../client/plugins/worldmap/FarmingPatchLocation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java index 73b903ab26..bfb3e446ae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java @@ -40,7 +40,8 @@ enum FarmingPatchLocation new WorldPoint(3598, 3524, 0), new WorldPoint(3052, 3309, 0), new WorldPoint(2810, 3462, 0), - new WorldPoint(2663, 3375, 0) + new WorldPoint(2663, 3375, 0), + new WorldPoint(3289, 6100, 0) ), ANIMA_HERB("Anima/Herb", new WorldPoint(1235, 3724, 0)), BELLADONNA("Belladonna", new WorldPoint(3084, 3356, 0)), @@ -59,6 +60,9 @@ enum FarmingPatchLocation CELASTRUS_FRUIT_TREE("Celastrus/Fruit Tree", new WorldPoint(1242, 3755, 0) ), + CRYSTAL_TREE("Crystal Tree", + new WorldPoint(3292, 6120, 0) + ), FRUIT_TREE("Fruit Tree", new WorldPoint(2487, 3181, 0), new WorldPoint(2343, 3160, 0), From dfb93019af235f278479424bad25f81dfb63bc51 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 18:15:46 -0400 Subject: [PATCH 23/37] world map: add elven overpass shortcuts on Prifddinas map --- .../main/java/net/runelite/client/game/AgilityShortcut.java | 3 +++ 1 file changed, 3 insertions(+) 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 8e10ac081c..c07deefda9 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 @@ -143,6 +143,7 @@ public enum AgilityShortcut YANILLE_DUNGEON_MONKEY_BARS(57, "Monkey Bars", null, MONKEYBARS_23567), PHASMATYS_ECTOPOOL_SHORTCUT(58, "Weathered Wall", null , WEATHERED_WALL, WEATHERED_WALL_16526), ELVEN_OVERPASS_CLIFF_SCRAMBLE(59, "Rocks", new WorldPoint(2345, 3300, 0), ROCKS_16514, ROCKS_16515), + ELVEN_OVERPASS_CLIFF_SCRAMBLE_PRIFDDINAS(59, "Rocks", new WorldPoint(3369, 6052, 0), ROCKS_16514, ROCKS_16515), WILDERNESS_GWD_CLIMB_EAST(60, "Rocks", new WorldPoint(2943, 3770, 0), ROCKY_HANDHOLDS_26400, ROCKY_HANDHOLDS_26401, ROCKY_HANDHOLDS_26402, ROCKY_HANDHOLDS_26404, ROCKY_HANDHOLDS_26405, ROCKY_HANDHOLDS_26406), WILDERNESS_GWD_CLIMB_WEST(60, "Rocks", new WorldPoint(2928, 3760, 0), ROCKY_HANDHOLDS_26400, ROCKY_HANDHOLDS_26401, ROCKY_HANDHOLDS_26402, ROCKY_HANDHOLDS_26404, ROCKY_HANDHOLDS_26405, ROCKY_HANDHOLDS_26406), MOS_LEHARMLESS_STEPPING_STONE(60, "Stepping Stone", new WorldPoint(3710, 2970, 0), STEPPING_STONE_19042), @@ -164,6 +165,7 @@ public enum AgilityShortcut HEROES_GUILD_TUNNEL_WEST(67, "Crevice", new WorldPoint(2913, 9895, 0), CREVICE_9739, CREVICE_9740), YANILLE_DUNGEON_RUBBLE_CLIMB(67, "Pile of Rubble", null, PILE_OF_RUBBLE_23563, PILE_OF_RUBBLE_23564), ELVEN_OVERPASS_MEDIUM_CLIFF(68, "Rocks", new WorldPoint(2337, 3288, 0), ROCKS_16514, ROCKS_16515), + ELVEN_OVERPASS_MEDIUM_CLIFF_PRIFDDINAS(68, "Rocks", new WorldPoint(3361, 6040, 0), ROCKS_16514, ROCKS_16515), WEISS_OBSTACLES(68, "Shortcut", null, LITTLE_BOULDER, ROCKSLIDE_33184, ROCKSLIDE_33185, NULL_33327, NULL_33328, LEDGE_33190, ROCKSLIDE_33191, FALLEN_TREE_33192), ARCEUUS_ESSENSE_NORTH(69, "Rock Climb", new WorldPoint(1761, 3873, 0), ROCKS_34741), TAVERLEY_DUNGEON_PIPE_BLUE_DRAGON(70, "Pipe Squeeze", new WorldPoint(2886, 9798, 0), OBSTACLE_PIPE_16509), @@ -192,6 +194,7 @@ public enum AgilityShortcut BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_NORTH(83, "Stepping Stones", new WorldPoint(2685, 9547, 0), STEPPING_STONE_19040), BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_SOUTH(83, "Stepping Stones", new WorldPoint(2693, 9529, 0), STEPPING_STONE_19040), ELVEN_ADVANCED_CLIFF_SCRAMBLE(85, "Rocks", new WorldPoint(2337, 3253, 0), ROCKS_16514, ROCKS_16514), + ELVEN_ADVANCED_CLIFF_SCRAMBLE_PRIFDDINAS(85, "Rocks", new WorldPoint(3361, 6005, 0), ROCKS_16514, ROCKS_16514), KALPHITE_WALL(86, "Crevice", new WorldPoint(3214, 9508, 0), CREVICE_16465), BRIMHAVEN_DUNGEON_VINE_EAST(87, "Vine", new WorldPoint(2672, 9582, 0), VINE_26880, VINE_26882), BRIMHAVEN_DUNGEON_VINE_WEST(87, "Vine", new WorldPoint(2606, 9584, 0), VINE_26880, VINE_26882), From 65d7778835308eb9e0b9d7219a7a195cea0b4925 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 20:59:43 -0400 Subject: [PATCH 24/37] world map: add Iorwerths dungeon agility shortcut icons --- .../main/java/net/runelite/client/game/AgilityShortcut.java | 4 ++++ 1 file changed, 4 insertions(+) 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 c07deefda9..f09ab41217 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 @@ -187,12 +187,16 @@ public enum AgilityShortcut REVENANT_CAVES_ANKOU_NORTH(75, "Jump", new WorldPoint(3180, 10209, 0), PILLAR_31561), ZUL_ANDRA_ISLAND_CROSSING(76, "Stepping Stone", new WorldPoint(2156, 3073, 0), STEPPING_STONE_10663), SHILO_VILLAGE_STEPPING_STONES( 77, "Stepping Stones", new WorldPoint(2863, 2974, 0), STEPPING_STONE_16466), + IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_EAST(78, "Tight Gap", new WorldPoint(3221, 12441, 0), TIGHT_GAP), + IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_WEST(78, "Tight Gap", new WorldPoint(3215, 12441, 0), TIGHT_GAP_36693), KHARAZI_JUNGLE_VINE_CLIMB(79, "Vine", new WorldPoint(2897, 2939, 0), NULL_26884, NULL_26886), TAVERLEY_DUNGEON_SPIKED_BLADES(80, "Strange Floor", new WorldPoint(2877, 9813, 0), STRANGE_FLOOR), SLAYER_DUNGEON_CHASM_JUMP(81, "Spiked Blades", new WorldPoint(2770, 10003, 0), STRANGE_FLOOR_16544), LAVA_MAZE_NORTH_JUMP(82, "Stepping Stone", new WorldPoint(3092, 3880, 0), STEPPING_STONE_14917), BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_NORTH(83, "Stepping Stones", new WorldPoint(2685, 9547, 0), STEPPING_STONE_19040), BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_SOUTH(83, "Stepping Stones", new WorldPoint(2693, 9529, 0), STEPPING_STONE_19040), + IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_EAST(84, "Tight Gap", new WorldPoint(3241, 12420, 0), TIGHT_GAP_36694), + IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_WEST(84, "Tight Gap", new WorldPoint(3231, 12420, 0), TIGHT_GAP_36695), ELVEN_ADVANCED_CLIFF_SCRAMBLE(85, "Rocks", new WorldPoint(2337, 3253, 0), ROCKS_16514, ROCKS_16514), ELVEN_ADVANCED_CLIFF_SCRAMBLE_PRIFDDINAS(85, "Rocks", new WorldPoint(3361, 6005, 0), ROCKS_16514, ROCKS_16514), KALPHITE_WALL(86, "Crevice", new WorldPoint(3214, 9508, 0), CREVICE_16465), From 69340f1aa8a632100b0dbc13bc0bedc1b7e528a7 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 26 Jul 2019 21:04:32 -0400 Subject: [PATCH 25/37] world map: add gauntlet minigame icon --- .../net/runelite/client/plugins/worldmap/MinigameLocation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java index 1b87a8f067..4158308d1e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java @@ -70,7 +70,8 @@ enum MinigameLocation ANIMATION_ROOM("Animation Room", new WorldPoint(2853, 3537, 0)), DUMMY_ROOM("Dummy Room", new WorldPoint(2857, 3551, 0)), CATAPULT_ROOM("Catapult Room", new WorldPoint(2842, 3545, 0)), - SHOT_PUT_ROOM("Shot Put Room", new WorldPoint(2863, 3550, 0)); + SHOT_PUT_ROOM("Shot Put Room", new WorldPoint(2863, 3550, 0)), + THE_GAUNTLET("The Gauntlet", new WorldPoint(3223, 12505, 1)); private final String tooltip; private final WorldPoint location; From 2b7c48e0c8c2aa4a1301c0564b798a967dc0f27f Mon Sep 17 00:00:00 2001 From: psikoi Date: Sat, 20 Jul 2019 11:03:56 +0100 Subject: [PATCH 26/37] loot tracker: ignore player loot in LMS --- .../loottracker/LootTrackerPlugin.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) 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 a58cd128bf..eb732c3b2c 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 @@ -27,6 +27,7 @@ package net.runelite.client.plugins.loottracker; import com.google.common.collect.HashMultiset; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multiset; import com.google.common.collect.Multisets; import com.google.inject.Provides; @@ -87,6 +88,7 @@ import net.runelite.http.api.loottracker.GameItem; import net.runelite.http.api.loottracker.LootRecord; import net.runelite.http.api.loottracker.LootRecordType; import net.runelite.http.api.loottracker.LootTrackerClient; +import org.apache.commons.lang3.ArrayUtils; @PluginDescriptor( name = "Loot Tracker", @@ -120,6 +122,9 @@ public class LootTrackerPlugin extends Plugin 13113, "Larran's small chest" ); + // Last man standing map regions + private static final Set LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916); + @Inject private ClientToolbar clientToolbar; @@ -322,6 +327,12 @@ public class LootTrackerPlugin extends Plugin @Subscribe public void onPlayerLootReceived(final PlayerLootReceived playerLootReceived) { + // Ignore Last Man Standing player loots + if (isAtLMS()) + { + return; + } + final Player player = playerLootReceived.getPlayer(); final Collection items = playerLootReceived.getItems(); final String name = player.getName(); @@ -590,4 +601,22 @@ public class LootTrackerPlugin extends Plugin return trackerRecords; } + + /** + * Is player at the Last Man Standing minigame + */ + private boolean isAtLMS() + { + final int[] mapRegions = client.getMapRegions(); + + for (int region : LAST_MAN_STANDING_REGIONS) + { + if (ArrayUtils.contains(mapRegions, region)) + { + return true; + } + } + + return false; + } } From 965682df6f5287809c204a757765d501a09f9221 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 26 Jul 2019 21:03:50 -0400 Subject: [PATCH 27/37] loot tracker: fix HERBIBOAR_EVENT name typo --- .../client/plugins/loottracker/LootTrackerPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 eb732c3b2c..e56a46d329 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 @@ -105,7 +105,7 @@ public class LootTrackerPlugin extends Plugin // Herbiboar loot handling private static final String HERBIBOAR_LOOTED_MESSAGE = "You harvest herbs from the herbiboar, whereupon it escapes."; - private static final String HERBIBOR_EVENT = "Herbiboar"; + private static final String HERBIBOAR_EVENT = "Herbiboar"; // Hespori loot handling private static final String HESPORI_LOOTED_MESSAGE = "You have successfully cleared this patch for new crops."; @@ -442,7 +442,7 @@ public class LootTrackerPlugin extends Plugin if (message.equals(HERBIBOAR_LOOTED_MESSAGE)) { - eventType = HERBIBOR_EVENT; + eventType = HERBIBOAR_EVENT; takeInventorySnapshot(); return; @@ -486,7 +486,7 @@ public class LootTrackerPlugin extends Plugin @Subscribe public void onItemContainerChanged(ItemContainerChanged event) { - if (eventType != null && (CHEST_EVENT_TYPES.containsValue(eventType) || HERBIBOR_EVENT.equals(eventType) || HESPORI_EVENT.equals(eventType))) + if (eventType != null && (CHEST_EVENT_TYPES.containsValue(eventType) || HERBIBOAR_EVENT.equals(eventType) || HESPORI_EVENT.equals(eventType))) { if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY)) { From e5154893a40d7d04ecadb29445a5388e9ae7eae6 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Fri, 26 Jul 2019 21:01:15 -0600 Subject: [PATCH 28/37] Skybox: Add Prifddinas and Iorwerth dungeon --- .../runelite/client/plugins/skybox/skybox.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt b/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt index 872c5a95e3..4d37a271ef 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt @@ -56,7 +56,7 @@ // C // Sets the chunks relative to the last region/region1 to the current color and blending -bounds 18 19 60 162 +bounds 18 19 60 196 b 8 @@ -392,6 +392,9 @@ r 47 70 r 53 78 r 55 90 r 57 154 +R 42 94 45 96 +R 49 93 52 96 +r 52 92 #b2b595 r 40 67 @@ -948,4 +951,13 @@ R 19 19 21 20 // Cosmic entity's plane #040404 -r 32 75 \ No newline at end of file +r 32 75 + +b 0 +#000000 +// Song of the elves boss area +R 49 92 51 92 + +// Iorwerth dungeon +#030A0A +R 49 193 51 194 From 03674945d5eaa37c59b84105128e2019e9b5dabf Mon Sep 17 00:00:00 2001 From: dekvall Date: Sat, 27 Jul 2019 18:28:58 +0200 Subject: [PATCH 29/37] Increase timeout for smelting overlay to handle cannonballs (#9448) --- .../net/runelite/client/plugins/smelting/SmeltingOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java index 7a49c00144..6aa7d98f43 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java @@ -46,7 +46,7 @@ import net.runelite.client.ui.overlay.components.TitleComponent; class SmeltingOverlay extends Overlay { - private static final int SMELT_TIMEOUT = 5; + private static final int SMELT_TIMEOUT = 7; private final Client client; private final SmeltingPlugin plugin; From 00a4c627c545bd81f88008e3ea4e9a7ce5757e4f Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Tue, 5 Feb 2019 12:15:00 +0000 Subject: [PATCH 30/37] party: add party chat messages Signed-off-by: Tomas Slusny --- .../http/api/ws/WebsocketGsonFactory.java | 2 ++ .../ws/messages/party/PartyChatMessage.java | 33 +++++++++++++++++++ .../java/net/runelite/client/RuneLite.java | 4 +-- .../plugins/chatfilter/ChatFilterPlugin.java | 3 +- .../JagexPrintableCharMatcher.java | 2 +- .../java/net/runelite/client/util/Text.java | 2 ++ .../net/runelite/client/ws/PartyService.java | 31 ++++++++++++++++- 7 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java rename runelite-client/src/main/java/net/runelite/client/{plugins/chatfilter => util}/JagexPrintableCharMatcher.java (97%) diff --git a/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java b/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java index 589a538de3..9d4e46e6ea 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java @@ -34,6 +34,7 @@ import net.runelite.http.api.ws.messages.Handshake; import net.runelite.http.api.ws.messages.LoginResponse; import net.runelite.http.api.ws.messages.party.Join; import net.runelite.http.api.ws.messages.party.Part; +import net.runelite.http.api.ws.messages.party.PartyChatMessage; import net.runelite.http.api.ws.messages.party.UserJoin; import net.runelite.http.api.ws.messages.party.UserPart; import net.runelite.http.api.ws.messages.party.UserSync; @@ -52,6 +53,7 @@ public class WebsocketGsonFactory messages.add(UserJoin.class); messages.add(UserPart.class); messages.add(UserSync.class); + messages.add(PartyChatMessage.class); MESSAGES = messages; } diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java new file mode 100644 index 0000000000..480e2660c1 --- /dev/null +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019, Tomas Slusny + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.http.api.ws.messages.party; + +import lombok.Value; + +@Value +public class PartyChatMessage extends PartyMemberMessage +{ + private final String value; +} 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 e04379fb1e..e309734264 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -112,7 +112,7 @@ public class RuneLite private OverlayManager overlayManager; @Inject - private PartyService partyService; + private Provider partyService; @Inject private Provider itemManager; @@ -276,13 +276,13 @@ public class RuneLite eventBus.register(overlayManager); eventBus.register(drawManager); eventBus.register(infoBoxManager); - eventBus.register(partyService); if (!isOutdated) { // Initialize chat colors chatMessageManager.get().loadColors(); + eventBus.register(partyService.get()); eventBus.register(overlayRenderer.get()); eventBus.register(clanManager.get()); eventBus.register(itemManager.get()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java index 6a3db9266f..cd104e3ccd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java @@ -25,6 +25,7 @@ */ package net.runelite.client.plugins.chatfilter; +import com.google.common.base.CharMatcher; import com.google.common.base.Splitter; import com.google.inject.Provides; import java.util.ArrayList; @@ -62,7 +63,7 @@ public class ChatFilterPlugin extends Plugin private static final String CENSOR_MESSAGE = "Hey, everyone, I just tried to say something very silly!"; - private final JagexPrintableCharMatcher jagexPrintableCharMatcher = new JagexPrintableCharMatcher(); + private final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER; private final List filteredPatterns = new ArrayList<>(); @Inject diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/JagexPrintableCharMatcher.java b/runelite-client/src/main/java/net/runelite/client/util/JagexPrintableCharMatcher.java similarity index 97% rename from runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/JagexPrintableCharMatcher.java rename to runelite-client/src/main/java/net/runelite/client/util/JagexPrintableCharMatcher.java index 72591d71f0..41bc771e9d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/JagexPrintableCharMatcher.java +++ b/runelite-client/src/main/java/net/runelite/client/util/JagexPrintableCharMatcher.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client.plugins.chatfilter; +package net.runelite.client.util; import com.google.common.base.CharMatcher; diff --git a/runelite-client/src/main/java/net/runelite/client/util/Text.java b/runelite-client/src/main/java/net/runelite/client/util/Text.java index 6158b9a32f..78c08f16aa 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/Text.java +++ b/runelite-client/src/main/java/net/runelite/client/util/Text.java @@ -46,6 +46,8 @@ public class Text private static final Joiner COMMA_JOINER = Joiner.on(",").skipNulls(); + public static final CharMatcher JAGEX_PRINTABLE_CHAR_MATCHER = new JagexPrintableCharMatcher(); + /** * Splits comma separated values to list of strings * 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 caec527320..6a6e3aa120 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 @@ -33,13 +33,18 @@ import javax.inject.Singleton; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import net.runelite.api.ChatMessageType; import net.runelite.client.account.AccountSession; import net.runelite.client.account.SessionManager; +import net.runelite.client.chat.ChatMessageManager; +import net.runelite.client.chat.QueuedMessage; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.PartyChanged; +import static net.runelite.client.util.Text.JAGEX_PRINTABLE_CHAR_MATCHER; import net.runelite.http.api.ws.messages.party.Join; import net.runelite.http.api.ws.messages.party.Part; +import net.runelite.http.api.ws.messages.party.PartyChatMessage; import net.runelite.http.api.ws.messages.party.UserJoin; import net.runelite.http.api.ws.messages.party.UserPart; import net.runelite.http.api.ws.messages.party.UserSync; @@ -49,10 +54,12 @@ import net.runelite.http.api.ws.messages.party.UserSync; public class PartyService { public static final int PARTY_MAX = 15; + private static final int MAX_MESSAGE_LEN = 150; private final WSClient wsClient; private final SessionManager sessionManager; private final EventBus eventBus; + private final ChatMessageManager chat; private final List members = new ArrayList<>(); @Getter @@ -65,11 +72,12 @@ public class PartyService private String username; @Inject - private PartyService(final WSClient wsClient, final SessionManager sessionManager, final EventBus eventBus) + private PartyService(final WSClient wsClient, final SessionManager sessionManager, final EventBus eventBus, final ChatMessageManager chat) { this.wsClient = wsClient; this.sessionManager = sessionManager; this.eventBus = eventBus; + this.chat = chat; } public void changeParty(UUID newParty) @@ -141,6 +149,27 @@ public class PartyService members.removeIf(member -> member.getMemberId().equals(message.getMemberId())); } + @Subscribe + public void onPartyChatMessage(final PartyChatMessage message) + { + // Remove non-printable characters, and tags from message + String sentMesage = JAGEX_PRINTABLE_CHAR_MATCHER.retainFrom(message.getValue()) + .replaceAll("", ""); + + // Cap the mesage length + if (sentMesage.length() > MAX_MESSAGE_LEN) + { + sentMesage = sentMesage.substring(0, MAX_MESSAGE_LEN); + } + + chat.queue(QueuedMessage.builder() + .type(ChatMessageType.FRIENDSCHAT) + .sender("Party") + .name(getMemberById(message.getMemberId()).getName()) + .runeLiteFormattedMessage(sentMesage) + .build()); + } + public PartyMember getLocalMember() { return getMemberByName(username); From 51abc3614ada7fc02588336c4db109af40243f1e Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Tue, 5 Feb 2019 12:18:21 +0000 Subject: [PATCH 31/37] raids plugin: send raids layout message to party Signed-off-by: Tomas Slusny --- .../client/plugins/raids/RaidsPlugin.java | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java index ff668a1472..efa8f65195 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java @@ -65,6 +65,10 @@ import net.runelite.client.plugins.raids.solver.RotationSolver; import net.runelite.client.ui.overlay.OverlayManager; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; import net.runelite.client.util.Text; +import net.runelite.client.ws.PartyMember; +import net.runelite.client.ws.PartyService; +import net.runelite.client.ws.WSClient; +import net.runelite.http.api.ws.messages.party.PartyChatMessage; @PluginDescriptor( name = "Chambers Of Xeric", @@ -110,6 +114,12 @@ public class RaidsPlugin extends Plugin @Inject private ClientThread clientThread; + @Inject + private PartyService party; + + @Inject + private WSClient ws; + @Getter private final ArrayList roomWhitelist = new ArrayList<>(); @@ -305,15 +315,28 @@ public class RaidsPlugin extends Plugin final String rooms = getRaid().toRoomString(); final String raidData = "[" + layout + "]: " + rooms; - chatMessageManager.queue(QueuedMessage.builder() - .type(ChatMessageType.FRIENDSCHATNOTIFICATION) - .runeLiteFormattedMessage(new ChatMessageBuilder() - .append(ChatColorType.HIGHLIGHT) - .append("Layout: ") - .append(ChatColorType.NORMAL) - .append(raidData) - .build()) - .build()); + final String layoutMessage = new ChatMessageBuilder() + .append(ChatColorType.HIGHLIGHT) + .append("Layout: ") + .append(ChatColorType.NORMAL) + .append(raidData) + .build(); + + final PartyMember localMember = party.getLocalMember(); + + if (party.getMembers().isEmpty() || localMember == null) + { + chatMessageManager.queue(QueuedMessage.builder() + .type(ChatMessageType.FRIENDSCHATNOTIFICATION) + .runeLiteFormattedMessage(layoutMessage) + .build()); + } + else + { + final PartyChatMessage message = new PartyChatMessage(layoutMessage); + message.setMemberId(localMember.getMemberId()); + ws.send(message); + } } private void updateInfoBoxState() From 761ffd9fff361cf78f215736dfb38be23c026b0f Mon Sep 17 00:00:00 2001 From: TheStonedTurtle Date: Fri, 26 Jul 2019 02:11:28 -0700 Subject: [PATCH 32/37] loot tracker: add gauntlet support --- .../loottracker/LootTrackerPlugin.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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 e56a46d329..691efc56fa 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 @@ -112,6 +112,11 @@ public class LootTrackerPlugin extends Plugin private static final String HESPORI_EVENT = "Hespori"; private static final int HESPORI_REGION = 5021; + // Gauntlet loot handling + private static final String GAUNTLET_LOOTED_MESSAGE = "You open the chest."; + private static final String GAUNTLET_EVENT = "The Gauntlet"; + private static final int GAUNTLET_LOBBY_REGION = 12127; + // Chest loot handling private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!"; private static final Pattern LARRAN_LOOTED_PATTERN = Pattern.compile("You have opened Larran's (big|small) chest .*"); @@ -448,10 +453,19 @@ public class LootTrackerPlugin extends Plugin return; } - if (HESPORI_REGION == client.getLocalPlayer().getWorldLocation().getRegionID() && message.equals(HESPORI_LOOTED_MESSAGE)) + final int regionID = client.getLocalPlayer().getWorldLocation().getRegionID(); + if (HESPORI_REGION == regionID && message.equals(HESPORI_LOOTED_MESSAGE)) { eventType = HESPORI_EVENT; takeInventorySnapshot(); + return; + } + + if (GAUNTLET_LOBBY_REGION == regionID && message.equals(GAUNTLET_LOOTED_MESSAGE)) + { + eventType = GAUNTLET_EVENT; + takeInventorySnapshot(); + return; } // Check if message is for a clue scroll reward @@ -486,7 +500,10 @@ public class LootTrackerPlugin extends Plugin @Subscribe public void onItemContainerChanged(ItemContainerChanged event) { - if (eventType != null && (CHEST_EVENT_TYPES.containsValue(eventType) || HERBIBOAR_EVENT.equals(eventType) || HESPORI_EVENT.equals(eventType))) + if (CHEST_EVENT_TYPES.containsValue(eventType) + || HERBIBOAR_EVENT.equals(eventType) + || HESPORI_EVENT.equals(eventType) + || GAUNTLET_EVENT.equals(eventType)) { if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY)) { From 12f52e72faf8174d6048be7b0fee227f1971b538 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Sat, 27 Jul 2019 22:30:35 -0400 Subject: [PATCH 33/37] bosstimers: add Zalcano --- .../main/java/net/runelite/client/plugins/bosstimer/Boss.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java index 81ae775d12..b915db4e72 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java @@ -58,7 +58,8 @@ enum Boss KALPHITE_QUEEN(NpcID.KALPHITE_QUEEN_965, 30, ChronoUnit.SECONDS, ItemID.KALPHITE_PRINCESS), DUSK(NpcID.DUSK_7889, 2, ChronoUnit.MINUTES, ItemID.NOON), ALCHEMICAL_HYDRA(NpcID.ALCHEMICAL_HYDRA_8622, 25200, ChronoUnit.MILLIS, ItemID.IKKLE_HYDRA), - SARACHNIS(NpcID.SARACHNIS, 30, ChronoUnit.SECONDS, ItemID.SRARACHA); + SARACHNIS(NpcID.SARACHNIS, 30, ChronoUnit.SECONDS, ItemID.SRARACHA), + ZALCANO(NpcID.ZALCANO_9050, 21600, ChronoUnit.MILLIS, ItemID.SMOLCANO); private static final Map bosses; From bbf6552495a8cd2099122fbfa4ca5bcd1d8ea6a1 Mon Sep 17 00:00:00 2001 From: SebastiaanVanspauwen <43320258+SebastiaanVanspauwen@users.noreply.github.com> Date: Sun, 28 Jul 2019 05:16:59 +0200 Subject: [PATCH 34/37] chat commands: add Prifddinas agility course kc and pb --- .../chatcommands/ChatCommandsPlugin.java | 11 ++++++++--- .../chatcommands/ChatCommandsPluginTest.java | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 694542636f..5dde286d62 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -83,12 +83,12 @@ import org.apache.commons.text.WordUtils; @Slf4j public class ChatCommandsPlugin extends Plugin { - private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest) count is: (\\d+)"); + private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap) count is: (\\d+)"); private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); private static final Pattern BARROWS_PATTERN = Pattern.compile("Your Barrows chest count is: (\\d+)"); - private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("Fight duration: [0-9:]+. Personal best: ([0-9:]+)"); - private static final Pattern NEW_PB_PATTERN = Pattern.compile("Fight duration: ([0-9:]+) \\(new personal best\\)"); + private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?:Fight|Lap) duration: [0-9:]+. Personal best: ([0-9:]+)"); + private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?:Fight|Lap) duration: ([0-9:]+) \\(new personal best\\)"); private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); @@ -1346,6 +1346,11 @@ public class ChatCommandsPlugin extends Plugin case "raids 2": return "Theatre of Blood"; + // agility course + case "prif": + case "prifddinas": + return "Prifddinas Agility Course"; + default: return WordUtils.capitalize(boss); } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index ea96a7caec..4a486c767f 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -226,4 +226,22 @@ public class ChatCommandsPluginTest verify(configManager).setConfiguration("killcount.adam", "duel arena losses", 999); } + + @Test + public void testAgilityLap() + { + final String NEW_PB = "Lap duration: 1:01 (new personal best)."; + + when(client.getUsername()).thenReturn("Adam"); + + // This sets lastBoss + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Prifddinas Agility Course lap count is: 2.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB, null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("prifddinas agility course"), eq(61)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("prifddinas agility course"), eq(2)); + } } From 9469f25570dec37b325fb9fe203bee8976008234 Mon Sep 17 00:00:00 2001 From: AttackOfTheMoons <42690834+AttackOfTheMoons@users.noreply.github.com> Date: Sun, 28 Jul 2019 00:50:37 -1000 Subject: [PATCH 35/37] examine: Add support for examining Seed Vault items (#9431) --- .../net/runelite/api/widgets/WidgetID.java | 2 ++ .../net/runelite/api/widgets/WidgetInfo.java | 4 +++- .../client/plugins/examine/ExaminePlugin.java | 20 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index df79f322ef..8f008fe485 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -825,5 +825,7 @@ public class WidgetID static class SeedVault { static final int TITLE_CONTAINER = 2; + static final int ITEM_CONTAINER = 15; + static final int ITEM_TEXT = 16; } } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 9a22b724ae..a506001421 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -494,7 +494,9 @@ public enum WidgetInfo ITEMS_LOST_VALUE(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_VALUE), ITEMS_KEPT_MAX(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.MAX_ITEMS_KEPT_ON_DEATH), - SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER); + SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER), + SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER), + SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT); private final int groupId; private final int childId; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java index 900d2b86a2..2003808908 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java @@ -41,7 +41,9 @@ import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; +import static net.runelite.api.widgets.WidgetInfo.SEED_VAULT_ITEM_CONTAINER; import static net.runelite.api.widgets.WidgetInfo.TO_CHILD; import static net.runelite.api.widgets.WidgetInfo.TO_GROUP; import net.runelite.api.widgets.WidgetItem; @@ -309,6 +311,24 @@ public class ExaminePlugin extends Plugin return new int[]{widgetItem.getItemQuantity(), widgetItem.getItemId()}; } } + else if (WidgetID.SEED_VAULT_GROUP_ID == widgetGroup) + { + Widget[] children = client.getWidget(SEED_VAULT_ITEM_CONTAINER).getDynamicChildren(); + if (actionParam < children.length) + { + Widget widgetItem = children[actionParam]; + return new int[]{widgetItem.getItemQuantity(), widgetItem.getItemId()}; + } + } + else if (WidgetID.SEED_VAULT_INVENTORY_GROUP_ID == widgetGroup) + { + Widget[] children = widget.getDynamicChildren(); + if (actionParam < children.length) + { + Widget widgetItem = children[actionParam]; + return new int[]{widgetItem.getItemQuantity(), widgetItem.getItemId()}; + } + } return null; } From ac27c859a5e121551582b80702fcb1f572016766 Mon Sep 17 00:00:00 2001 From: Adam Witkowski Date: Sun, 28 Jul 2019 12:52:27 +0200 Subject: [PATCH 36/37] itemstats: Add support for Tai Bwo Wannai food (spiders on stick) (#9485) --- .../net/runelite/client/plugins/itemstats/ItemStatChanges.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java index bcce08ffe5..0cbc044266 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java @@ -92,6 +92,7 @@ public class ItemStatChanges add(combo(2, food(8), heal(RUN_ENERGY, 5)), PAPAYA_FRUIT); add(range(food(5), food(7)), THIN_SNAIL_MEAT); add(range(food(7), food(9)), FAT_SNAIL_MEAT); + add(range(food(7), food(10)), SPIDER_ON_STICK_6297, SPIDER_ON_SHAFT_6299); // Dorgeshuun Cuisine add(food(2), BAT_SHISH, COATED_FROGS_LEGS, FILLETS, FINGERS, FROGBURGER, FROGSPAWN_GUMBO, GREEN_GLOOP_SOUP, From 529570d91a3f10f487d702a84525fecfbc9935c2 Mon Sep 17 00:00:00 2001 From: William Collishaw Date: Sun, 28 Jul 2019 04:55:13 -0600 Subject: [PATCH 37/37] raids: Switch from Pattern splitting to Text.fromCSV (#9422) --- .../client/plugins/raids/RaidsPlugin.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java index efa8f65195..6508792768 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java @@ -29,7 +29,7 @@ import com.google.inject.Provides; import java.text.DecimalFormat; import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; +import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.inject.Inject; @@ -83,8 +83,7 @@ public class RaidsPlugin extends Plugin private static final String LEVEL_COMPLETE_MESSAGE = "level complete!"; private static final String RAID_COMPLETE_MESSAGE = "Congratulations - your raid is complete!"; private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###.##"); - static final DecimalFormat POINTS_FORMAT = new DecimalFormat("#,###"); - private static final String SPLIT_REGEX = "\\s*,\\s*"; + private static final DecimalFormat POINTS_FORMAT = new DecimalFormat("#,###"); private static final Pattern ROTATION_REGEX = Pattern.compile("\\[(.*?)]"); @Inject @@ -391,28 +390,28 @@ public class RaidsPlugin extends Plugin } else { - list.addAll(Arrays.asList(input.toLowerCase().split(SPLIT_REGEX))); + list.addAll(Text.fromCSV(input.toLowerCase())); } } int getRotationMatches() { String rotation = raid.getRotationString().toLowerCase(); - String[] bosses = rotation.split(SPLIT_REGEX); + List bosses = Text.fromCSV(rotation); if (rotationWhitelist.contains(rotation)) { - return bosses.length; + return bosses.size(); } for (String whitelisted : rotationWhitelist) { int matches = 0; - String[] whitelistedBosses = whitelisted.split(SPLIT_REGEX); + List whitelistedBosses = Text.fromCSV(whitelisted); - for (int i = 0; i < whitelistedBosses.length; i++) + for (int i = 0; i < whitelistedBosses.size(); i++) { - if (i < bosses.length && whitelistedBosses[i].equals(bosses[i])) + if (i < bosses.size() && whitelistedBosses.get(i).equals(bosses.get(i))) { matches++; }