From 98ca1bc0564cd64e78a09b0b1e18d8ffcfa15a88 Mon Sep 17 00:00:00 2001 From: William Maga Date: Sat, 19 Jan 2019 03:45:31 -0700 Subject: [PATCH 01/17] Add notification on NPC spawn --- .../plugins/npchighlight/MemorizedNpc.java | 9 +++ .../npchighlight/NpcIndicatorsConfig.java | 20 ++++++ .../npchighlight/NpcIndicatorsPlugin.java | 64 +++++++++++++++++-- .../plugins/npchighlight/NpcSceneOverlay.java | 23 ++----- .../npchighlight/NpcIndicatorsPluginTest.java | 6 ++ 5 files changed, 96 insertions(+), 26 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java index d9e1cad9a4..41ce059c42 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.npchighlight; +import java.time.Instant; import java.util.ArrayList; import java.util.List; import lombok.Getter; @@ -76,4 +77,12 @@ class MemorizedNpc this.npcSize = composition.getSize(); } } + + public double getSecondsFromRespawn(int tickCount, Instant lastTickUpdate) + { + final Instant now = Instant.now(); + final double baseTick = NpcIndicatorsPlugin.ESTIMATED_TICK_LENGTH * (diedOnTick + respawnTime - tickCount); + final double sinceLast = (now.toEpochMilli() - lastTickUpdate.toEpochMilli()) / 1000.0; + return Math.max(0.0, baseTick - sinceLast); + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java index 3e6b298cbb..0eb7f333fb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java @@ -107,4 +107,24 @@ public interface NpcIndicatorsConfig extends Config { return false; } + + @ConfigItem( + position = 7, + keyName = "notifyOnRespawn", + name = "Notify on Respawn", + description = "Enable notification on respawn") + default boolean getNotifyOnRespawn() + { + return false; + } + + @ConfigItem( + position = 8, + keyName = "notifyOnRespawnDelay", + name = "Notification Delay", + description = "Notify when NPC is x ms from respawning") + default int getNotifyOnRespawnDelay() + { + return -1; + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index 63a130c70e..d2eb9a5ddf 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -29,14 +29,11 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.inject.Provides; + +import java.text.DecimalFormat; +import java.text.NumberFormat; import java.time.Instant; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import javax.inject.Inject; import lombok.AccessLevel; import lombok.Getter; @@ -56,6 +53,7 @@ import net.runelite.api.events.GraphicsObjectCreated; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcSpawned; +import net.runelite.client.Notifier; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; @@ -76,6 +74,11 @@ public class NpcIndicatorsPlugin extends Plugin { private static final int MAX_ACTOR_VIEW_RANGE = 15; + public static final NumberFormat TIME_LEFT_FORMATTER = DecimalFormat.getInstance(Locale.US); + + // Estimated time of a game tick in seconds + public static final double ESTIMATED_TICK_LENGTH = 0.6; + // Option added to NPC menu private static final String TAG = "Tag"; @@ -85,6 +88,11 @@ public class NpcIndicatorsPlugin extends Plugin // Regex for splitting the hidden items in the config. private static final Splitter COMMA_SPLITTER = Splitter.on(",").omitEmptyStrings().trimResults(); + static + { + ((DecimalFormat)TIME_LEFT_FORMATTER).applyPattern("#0.0"); + } + @Inject private Client client; @@ -112,12 +120,21 @@ public class NpcIndicatorsPlugin extends Plugin @Inject private ClientThread clientThread; + @Inject + private Notifier notifier; + /** * NPCs to highlight */ @Getter(AccessLevel.PACKAGE) private final Set highlightedNpcs = new HashSet<>(); + /** + * NPCs to notify when close to spawning + */ + @Getter(AccessLevel.PACKAGE) + private final Set pendingNotificationNpcs = new HashSet<>(); + /** * Dead NPCs that should be displayed with a respawn indicator if the config is on. */ @@ -203,6 +220,7 @@ public class NpcIndicatorsPlugin extends Plugin overlayManager.remove(npcSceneOverlay); overlayManager.remove(npcMinimapOverlay); deadNpcsToDisplay.clear(); + pendingNotificationNpcs.clear(); memorizedNpcs.clear(); spawnedNpcsThisTick.clear(); despawnedNpcsThisTick.clear(); @@ -220,6 +238,7 @@ public class NpcIndicatorsPlugin extends Plugin { highlightedNpcs.clear(); deadNpcsToDisplay.clear(); + pendingNotificationNpcs.clear(); memorizedNpcs.forEach((id, npc) -> npc.setDiedOnTick(-1)); lastPlayerLocation = null; skipNextSpawnCheck = true; @@ -319,6 +338,12 @@ public class NpcIndicatorsPlugin extends Plugin if (memorizedNpcs.containsKey(npc.getIndex())) { despawnedNpcsThisTick.add(npc); + MemorizedNpc mn = memorizedNpcs.get(npc.getIndex()); + + if (!mn.getPossibleRespawnLocations().isEmpty()) + { + pendingNotificationNpcs.add(mn); + } } highlightedNpcs.remove(npc); @@ -340,6 +365,7 @@ public class NpcIndicatorsPlugin extends Plugin { removeOldHighlightedRespawns(); validateSpawnedNpcs(); + checkNotifyNpcs(); lastTickUpdate = Instant.now(); lastPlayerLocation = client.getLocalPlayer().getWorldLocation(); } @@ -477,6 +503,29 @@ public class NpcIndicatorsPlugin extends Plugin } } + private void checkNotifyNpcs() + { + if (!config.getNotifyOnRespawn()) + { + return; + } + + final double notifyDelay = ((double)config.getNotifyOnRespawnDelay()) / 1000; + final int tickCount = client.getTickCount(); + final String notifyDelayStr = notifyDelay > 0 + ? " is less than " + TIME_LEFT_FORMATTER.format(notifyDelay) + " seconds from respawn" + : " respawned."; + + for (MemorizedNpc npc : pendingNotificationNpcs) + { + if (npc.getSecondsFromRespawn(tickCount, lastTickUpdate) <= notifyDelay) + { + pendingNotificationNpcs.remove(npc); + notifier.notify(npc.getNpcName() + notifyDelayStr); + } + } + } + private void validateSpawnedNpcs() { if (skipNextSpawnCheck) @@ -485,6 +534,7 @@ public class NpcIndicatorsPlugin extends Plugin } else { + for (NPC npc : despawnedNpcsThisTick) { if (!teleportGraphicsObjectSpawnedThisTick.isEmpty()) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java index d4c8c356ec..ed3dd3170a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java @@ -30,10 +30,6 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Polygon; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.time.Instant; -import java.util.Locale; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.NPC; @@ -53,16 +49,6 @@ public class NpcSceneOverlay extends Overlay // a dark background private static final Color TEXT_COLOR = Color.WHITE; - // Estimated time of a game tick in seconds - private static final double ESTIMATED_TICK_LENGTH = 0.6; - - private static final NumberFormat TIME_LEFT_FORMATTER = DecimalFormat.getInstance(Locale.US); - - static - { - ((DecimalFormat)TIME_LEFT_FORMATTER).applyPattern("#0.0"); - } - private final Client client; private final NpcIndicatorsConfig config; private final NpcIndicatorsPlugin plugin; @@ -121,11 +107,10 @@ public class NpcSceneOverlay extends Overlay OverlayUtil.renderPolygon(graphics, poly, color); } - final Instant now = Instant.now(); - final double baseTick = ((npc.getDiedOnTick() + npc.getRespawnTime()) - client.getTickCount()) * ESTIMATED_TICK_LENGTH; - final double sinceLast = (now.toEpochMilli() - plugin.getLastTickUpdate().toEpochMilli()) / 1000.0; - final double timeLeft = Math.max(0.0, baseTick - sinceLast); - final String timeLeftStr = TIME_LEFT_FORMATTER.format(timeLeft); + final String timeLeftStr = NpcIndicatorsPlugin.TIME_LEFT_FORMATTER.format(npc.getSecondsFromRespawn( + client.getTickCount(), + plugin.getLastTickUpdate() + )); final int textWidth = graphics.getFontMetrics().stringWidth(timeLeftStr); final int textHeight = graphics.getFontMetrics().getAscent(); diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java index 87f69cceb3..e1617e0b57 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java @@ -33,6 +33,8 @@ import java.util.concurrent.ScheduledExecutorService; import javax.inject.Inject; import net.runelite.api.Client; import static org.junit.Assert.assertEquals; + +import net.runelite.client.Notifier; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -55,6 +57,10 @@ public class NpcIndicatorsPluginTest @Bind private NpcIndicatorsConfig npcIndicatorsConfig; + @Mock + @Bind + private Notifier notifier; + @Inject private NpcIndicatorsPlugin npcIndicatorsPlugin; From bee3299e1d9d54277f76f3043fee638e621b1273 Mon Sep 17 00:00:00 2001 From: William Maga Date: Sat, 19 Jan 2019 13:42:25 -0700 Subject: [PATCH 02/17] Refactor NpcIndicators functions --- .../plugins/npchighlight/MemorizedNpc.java | 9 ----- .../npchighlight/NpcIndicatorsPlugin.java | 36 +++++++++++++------ .../plugins/npchighlight/NpcSceneOverlay.java | 5 +-- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java index 41ce059c42..d9e1cad9a4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java @@ -24,7 +24,6 @@ */ package net.runelite.client.plugins.npchighlight; -import java.time.Instant; import java.util.ArrayList; import java.util.List; import lombok.Getter; @@ -77,12 +76,4 @@ class MemorizedNpc this.npcSize = composition.getSize(); } } - - public double getSecondsFromRespawn(int tickCount, Instant lastTickUpdate) - { - final Instant now = Instant.now(); - final double baseTick = NpcIndicatorsPlugin.ESTIMATED_TICK_LENGTH * (diedOnTick + respawnTime - tickCount); - final double sinceLast = (now.toEpochMilli() - lastTickUpdate.toEpochMilli()) / 1000.0; - return Math.max(0.0, baseTick - sinceLast); - } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index d2eb9a5ddf..9f793204ad 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -74,10 +74,15 @@ public class NpcIndicatorsPlugin extends Plugin { private static final int MAX_ACTOR_VIEW_RANGE = 15; - public static final NumberFormat TIME_LEFT_FORMATTER = DecimalFormat.getInstance(Locale.US); - // Estimated time of a game tick in seconds - public static final double ESTIMATED_TICK_LENGTH = 0.6; + private static final double ESTIMATED_TICK_LENGTH = 0.6; + + private static final NumberFormat TIME_LEFT_FORMATTER = DecimalFormat.getInstance(Locale.getDefault()); + + static + { + ((DecimalFormat)TIME_LEFT_FORMATTER).applyPattern("#0.0"); + } // Option added to NPC menu private static final String TAG = "Tag"; @@ -88,11 +93,6 @@ public class NpcIndicatorsPlugin extends Plugin // Regex for splitting the hidden items in the config. private static final Splitter COMMA_SPLITTER = Splitter.on(",").omitEmptyStrings().trimResults(); - static - { - ((DecimalFormat)TIME_LEFT_FORMATTER).applyPattern("#0.0"); - } - @Inject private Client client; @@ -417,6 +417,16 @@ public class NpcIndicatorsPlugin extends Plugin return new WorldPoint(currWP.getX() - dx, currWP.getY() - dy, currWP.getPlane()); } + public double getTimeLeftForNpc(MemorizedNpc npc) + { + final Instant now = Instant.now(); + final double baseTick = NpcIndicatorsPlugin.ESTIMATED_TICK_LENGTH * ( + npc.getDiedOnTick() + npc.getRespawnTime() - client.getTickCount() + ); + final double sinceLast = (now.toEpochMilli() - lastTickUpdate.toEpochMilli()) / 1000.0; + return Math.max(0.0, baseTick - sinceLast); + } + private void memorizeNpc(NPC npc) { final int npcIndex = npc.getIndex(); @@ -503,6 +513,11 @@ public class NpcIndicatorsPlugin extends Plugin } } + public String formatTime(double time) + { + return TIME_LEFT_FORMATTER.format(time); + } + private void checkNotifyNpcs() { if (!config.getNotifyOnRespawn()) @@ -511,14 +526,13 @@ public class NpcIndicatorsPlugin extends Plugin } final double notifyDelay = ((double)config.getNotifyOnRespawnDelay()) / 1000; - final int tickCount = client.getTickCount(); final String notifyDelayStr = notifyDelay > 0 - ? " is less than " + TIME_LEFT_FORMATTER.format(notifyDelay) + " seconds from respawn" + ? " is less than " + formatTime(notifyDelay) + " seconds from respawn" : " respawned."; for (MemorizedNpc npc : pendingNotificationNpcs) { - if (npc.getSecondsFromRespawn(tickCount, lastTickUpdate) <= notifyDelay) + if (getTimeLeftForNpc(npc) <= notifyDelay) { pendingNotificationNpcs.remove(npc); notifier.notify(npc.getNpcName() + notifyDelayStr); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java index ed3dd3170a..81d4e7f06b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java @@ -107,10 +107,7 @@ public class NpcSceneOverlay extends Overlay OverlayUtil.renderPolygon(graphics, poly, color); } - final String timeLeftStr = NpcIndicatorsPlugin.TIME_LEFT_FORMATTER.format(npc.getSecondsFromRespawn( - client.getTickCount(), - plugin.getLastTickUpdate() - )); + final String timeLeftStr = plugin.formatTime(plugin.getTimeLeftForNpc(npc)); final int textWidth = graphics.getFontMetrics().stringWidth(timeLeftStr); final int textHeight = graphics.getFontMetrics().getAscent(); From 89e1ce55cb93eb7a6107bdaa104ea76849cdd5e9 Mon Sep 17 00:00:00 2001 From: f0rmatme Date: Mon, 21 Oct 2019 00:55:50 -0700 Subject: [PATCH 03/17] update --- .../plugins/npchighlight/NpcIndicatorsPlugin.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index aff63ec15f..5393bcc191 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -231,6 +231,10 @@ public class NpcIndicatorsPlugin extends Plugin private boolean highlightMenuNames; @Getter(AccessLevel.PACKAGE) private boolean showRespawnTimer; + @Getter(AccessLevel.PACKAGE) + private boolean getNotifyOnRespawn; + @Getter(AccessLevel.PACKAGE) + private int getNotifyOnRespawnDelay; @Provides NpcIndicatorsConfig provideConfig(ConfigManager configManager) @@ -619,12 +623,12 @@ public class NpcIndicatorsPlugin extends Plugin private void checkNotifyNpcs() { - if (!config.getNotifyOnRespawn()) + if (!this.getNotifyOnRespawn) { return; } - final double notifyDelay = ((double)config.getNotifyOnRespawnDelay()) / 1000; + final double notifyDelay = ((double)this.getNotifyOnRespawnDelay) / 1000; final String notifyDelayStr = notifyDelay > 0 ? " is less than " + formatTime(notifyDelay) + " seconds from respawn" : " respawned."; @@ -736,5 +740,7 @@ public class NpcIndicatorsPlugin extends Plugin this.drawMinimapNames = config.drawMinimapNames(); this.highlightMenuNames = config.highlightMenuNames(); this.showRespawnTimer = config.showRespawnTimer(); + this.getNotifyOnRespawn = config.getNotifyOnRespawn(); + this.getNotifyOnRespawnDelay = config.getNotifyOnRespawnDelay(); } } From b60ecd8c474a43ff9ed7af6cc7f3430020843b12 Mon Sep 17 00:00:00 2001 From: f0rmatme Date: Mon, 21 Oct 2019 01:13:42 -0700 Subject: [PATCH 04/17] unused imports --- .../client/plugins/npchighlight/NpcSceneOverlay.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java index 5f539664f8..29f1b7b75d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java @@ -31,15 +31,10 @@ import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Shape; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.time.Instant; import java.util.List; -import java.util.Locale; import javax.inject.Inject; import javax.inject.Singleton; import net.runelite.api.Client; -import net.runelite.api.Constants; import net.runelite.api.NPC; import net.runelite.api.NPCDefinition; import net.runelite.api.Perspective; From 2aeea8efc28f3a7c2253ec95e6cce9eecb09b4b1 Mon Sep 17 00:00:00 2001 From: Dutta64 <38548565+dutta64@users.noreply.github.com> Date: Fri, 3 Jan 2020 01:18:25 -0700 Subject: [PATCH 05/17] Plugin: Hydra Helper Plugin * Refactoring * Add poison overlay * Add InteractingChanged event subscription to handle already-spawned npcs * Rename BabyHydra classes to 'Hydra' Plugin: Rename AlchemicalHydra plugin class files to prevent conflicts PR changes --- .../{Hydra.java => AlchemicalHydra.java} | 16 +- ...Config.java => AlchemicalHydraConfig.java} | 2 +- ...erlay.java => AlchemicalHydraOverlay.java} | 14 +- ...raPhase.java => AlchemicalHydraPhase.java} | 4 +- ...Plugin.java => AlchemicalHydraPlugin.java} | 32 +- ....java => AlchemicalHydraSceneOverlay.java} | 10 +- .../plugins/hydra/BabyHydraOverlay.java | 118 ----- .../client/plugins/hydra/BabyHydraPlugin.java | 253 ----------- .../plugins/hydra/BabyHydraPrayOverlay.java | 137 ------ .../runelite/client/plugins/hydra/Hydra.java | 73 +++ .../client/plugins/hydra/HydraAnimation.java | 61 +++ .../hydra/HydraAttackCounterOverlay.java | 171 +++++++ ...{BabyHydraConfig.java => HydraConfig.java} | 38 +- .../client/plugins/hydra/HydraPlugin.java | 421 ++++++++++++++++++ .../plugins/hydra/HydraPoisonOverlay.java | 111 +++++ ...a => HydraPrayerAttackCounterOverlay.java} | 52 ++- .../plugins/hydra/HydraPrayerOverlay.java | 167 +++++++ 17 files changed, 1104 insertions(+), 576 deletions(-) rename runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/{Hydra.java => AlchemicalHydra.java} (89%) rename runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/{HydraConfig.java => AlchemicalHydraConfig.java} (98%) rename runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/{HydraOverlay.java => AlchemicalHydraOverlay.java} (93%) rename runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/{HydraPhase.java => AlchemicalHydraPhase.java} (94%) rename runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/{HydraPlugin.java => AlchemicalHydraPlugin.java} (91%) rename runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/{HydraSceneOverlay.java => AlchemicalHydraSceneOverlay.java} (93%) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraOverlay.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPlugin.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPrayOverlay.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/Hydra.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAnimation.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAttackCounterOverlay.java rename runelite-client/src/main/java/net/runelite/client/plugins/hydra/{BabyHydraConfig.java => HydraConfig.java} (64%) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPlugin.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPoisonOverlay.java rename runelite-client/src/main/java/net/runelite/client/plugins/hydra/{BabyHydraIndicatorOverlay.java => HydraPrayerAttackCounterOverlay.java} (63%) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerOverlay.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydra.java similarity index 89% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydra.java index 3b332f3589..97782f5c8a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydra.java @@ -40,7 +40,7 @@ import net.runelite.client.util.ImageUtil; @Getter(AccessLevel.PACKAGE) @RequiredArgsConstructor @Singleton -class Hydra +class AlchemicalHydra { @Getter(AccessLevel.PACKAGE) @RequiredArgsConstructor @@ -61,7 +61,7 @@ class Hydra if (image == null) { BufferedImage tmp = spriteManager.getSprite(spriteID, 0); - image = tmp == null ? null : ImageUtil.resizeImage(tmp, HydraOverlay.IMGSIZE, HydraOverlay.IMGSIZE); + image = tmp == null ? null : ImageUtil.resizeImage(tmp, AlchemicalHydraOverlay.IMGSIZE, AlchemicalHydraOverlay.IMGSIZE); } return image; @@ -70,7 +70,7 @@ class Hydra private final NPC npc; - private HydraPhase phase = HydraPhase.ONE; + private AlchemicalHydraPhase phase = AlchemicalHydraPhase.ONE; private int attackCount = 0; private int nextSwitch = phase.getAttacksPerSwitch(); @@ -84,14 +84,14 @@ class Hydra @Setter(AccessLevel.PACKAGE) private boolean weakened = false; - void changePhase(HydraPhase newPhase) + void changePhase(AlchemicalHydraPhase newPhase) { phase = newPhase; nextSpecial = 3; attackCount = 0; weakened = false; - if (newPhase == HydraPhase.FOUR) + if (newPhase == AlchemicalHydraPhase.FOUR) { weakened = true; switchStyles(); @@ -101,9 +101,9 @@ class Hydra private void switchStyles() { - nextAttack = lastAttack == Hydra.AttackStyle.MAGIC - ? Hydra.AttackStyle.RANGED - : Hydra.AttackStyle.MAGIC; + nextAttack = lastAttack == AlchemicalHydra.AttackStyle.MAGIC + ? AlchemicalHydra.AttackStyle.RANGED + : AlchemicalHydra.AttackStyle.MAGIC; } void handleAttack(int id) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraConfig.java similarity index 98% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraConfig.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraConfig.java index 4cf308f3e7..90ac1350cb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraConfig.java @@ -32,7 +32,7 @@ import net.runelite.client.config.ConfigItem; import net.runelite.client.config.ConfigSection; @ConfigGroup("betterHydra") -public interface HydraConfig extends Config +public interface AlchemicalHydraConfig extends Config { @ConfigSection( keyName = "features", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraOverlay.java similarity index 93% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraOverlay.java index 38572c9ee2..e844f897b3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraOverlay.java @@ -47,11 +47,11 @@ import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.util.ImageUtil; @Singleton -class HydraOverlay extends Overlay +class AlchemicalHydraOverlay extends Overlay { static final int IMGSIZE = 36; - private final HydraPlugin plugin; + private final AlchemicalHydraPlugin plugin; private final Client client; private final SpriteManager spriteManager; private final PanelComponent panelComponent = new PanelComponent(); @@ -71,7 +71,7 @@ class HydraOverlay extends Overlay private int stunTicks; @Inject - HydraOverlay(final HydraPlugin plugin, final Client client, final SpriteManager spriteManager) + AlchemicalHydraOverlay(final AlchemicalHydraPlugin plugin, final Client client, final SpriteManager spriteManager) { this.plugin = plugin; this.client = client; @@ -83,7 +83,7 @@ class HydraOverlay extends Overlay @Override public Dimension render(Graphics2D graphics2D) { - final Hydra hydra = plugin.getHydra(); + final AlchemicalHydra hydra = plugin.getHydra(); panelComponent.getChildren().clear(); if (hydra == null) @@ -125,9 +125,9 @@ class HydraOverlay extends Overlay panelComponent.getChildren().add(stunComponent); } - private void addSpecOverlay(final Hydra hydra) + private void addSpecOverlay(final AlchemicalHydra hydra) { - final HydraPhase phase = hydra.getPhase(); + final AlchemicalHydraPhase phase = hydra.getPhase(); final int nextSpec = hydra.getNextSpecialRelative(); if (nextSpec > 3) @@ -152,7 +152,7 @@ class HydraOverlay extends Overlay panelComponent.getChildren().add(specComponent); } - private void addPrayOverlay(final Hydra hydra) + private void addPrayOverlay(final AlchemicalHydra hydra) { final Prayer nextPrayer = hydra.getNextAttack().getPrayer(); final int nextSwitch = hydra.getNextSwitch(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraPhase.java similarity index 94% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraPhase.java index 4fa739e6d8..97e577d6ef 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraPhase.java @@ -37,7 +37,7 @@ import net.runelite.client.util.ImageUtil; @Getter(AccessLevel.PACKAGE) @RequiredArgsConstructor -enum HydraPhase +enum AlchemicalHydraPhase { ONE(3, AnimationID.HYDRA_1_1, AnimationID.HYDRA_1_2, ProjectileID.HYDRA_POISON, 0, SpriteID.BIG_ASS_GUTHIX_SPELL, new WorldPoint(1371, 10263, 0)), TWO(3, AnimationID.HYDRA_2_1, AnimationID.HYDRA_2_2, 0, AnimationID.HYDRA_LIGHTNING, SpriteID.BIG_SPEC_TRANSFER, new WorldPoint(1371, 10272, 0)), @@ -61,7 +61,7 @@ enum HydraPhase if (specImage == null) { BufferedImage tmp = spriteManager.getSprite(specImageID, 0); - specImage = tmp == null ? null : ImageUtil.resizeImage(tmp, HydraOverlay.IMGSIZE, HydraOverlay.IMGSIZE); + specImage = tmp == null ? null : ImageUtil.resizeImage(tmp, AlchemicalHydraOverlay.IMGSIZE, AlchemicalHydraOverlay.IMGSIZE); } return specImage; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraPlugin.java similarity index 91% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraPlugin.java index 39f0cf3a52..c51dde9e2d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraPlugin.java @@ -56,7 +56,7 @@ import net.runelite.client.events.ConfigChanged; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginType; -import net.runelite.client.plugins.alchemicalhydra.Hydra.AttackStyle; +import net.runelite.client.plugins.alchemicalhydra.AlchemicalHydra.AttackStyle; import net.runelite.client.ui.overlay.OverlayManager; @PluginDescriptor( @@ -68,7 +68,7 @@ import net.runelite.client.ui.overlay.OverlayManager; ) @Slf4j @Singleton -public class HydraPlugin extends Plugin +public class AlchemicalHydraPlugin extends Plugin { private static final int[] HYDRA_REGIONS = { 5279, 5280, @@ -80,7 +80,7 @@ public class HydraPlugin extends Plugin private Map poisonProjectiles = new HashMap<>(); @Getter(AccessLevel.PACKAGE) - private Hydra hydra; + private AlchemicalHydra hydra; @Getter(AccessLevel.PACKAGE) private boolean counting; @@ -101,21 +101,21 @@ public class HydraPlugin extends Plugin private EventBus eventBus; @Inject - private HydraConfig config; + private AlchemicalHydraConfig config; @Inject - private HydraOverlay overlay; + private AlchemicalHydraOverlay overlay; @Inject - private HydraSceneOverlay sceneOverlay; + private AlchemicalHydraSceneOverlay sceneOverlay; @Inject private OverlayManager overlayManager; @Provides - HydraConfig provideConfig(ConfigManager configManager) + AlchemicalHydraConfig provideConfig(ConfigManager configManager) { - return configManager.getConfig(HydraConfig.class); + return configManager.getConfig(AlchemicalHydraConfig.class); } @Override @@ -235,7 +235,7 @@ public class HydraPlugin extends Plugin { if (npc.getId() == NpcID.ALCHEMICAL_HYDRA) { - hydra = new Hydra(npc); + hydra = new AlchemicalHydra(npc); addFightSubscriptions(); break; } @@ -252,7 +252,7 @@ public class HydraPlugin extends Plugin } eventBus.unregister("npcSpawned"); - hydra = new Hydra(event.getNpc()); + hydra = new AlchemicalHydra(event.getNpc()); addFightSubscriptions(); addOverlays(); } @@ -266,23 +266,23 @@ public class HydraPlugin extends Plugin return; } - HydraPhase phase = hydra.getPhase(); + AlchemicalHydraPhase phase = hydra.getPhase(); if (actor.getAnimation() == phase.getDeathAnim2() && - phase != HydraPhase.THREE // Else log's gonna say "Tried some weird shit" + phase != AlchemicalHydraPhase.THREE // Else log's gonna say "Tried some weird shit" || actor.getAnimation() == phase.getDeathAnim1() && - phase == HydraPhase.THREE) // We want the pray to switch ye ok ty + phase == AlchemicalHydraPhase.THREE) // We want the pray to switch ye ok ty { switch (phase) { case ONE: - hydra.changePhase(HydraPhase.TWO); + hydra.changePhase(AlchemicalHydraPhase.TWO); return; case TWO: - hydra.changePhase(HydraPhase.THREE); + hydra.changePhase(AlchemicalHydraPhase.THREE); return; case THREE: - hydra.changePhase(HydraPhase.FOUR); + hydra.changePhase(AlchemicalHydraPhase.FOUR); return; case FOUR: hydra = null; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraSceneOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraSceneOverlay.java similarity index 93% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraSceneOverlay.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraSceneOverlay.java index 257bf9f6b6..71e24470b8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraSceneOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/AlchemicalHydraSceneOverlay.java @@ -47,7 +47,7 @@ import net.runelite.client.ui.overlay.OverlayLayer; import net.runelite.client.ui.overlay.OverlayPosition; @Singleton -class HydraSceneOverlay extends Overlay +class AlchemicalHydraSceneOverlay extends Overlay { @Setter(AccessLevel.PACKAGE) private Color poisonBorder; @@ -61,11 +61,11 @@ class HydraSceneOverlay extends Overlay @Setter(AccessLevel.PACKAGE) private Color badFountain; - private final HydraPlugin plugin; + private final AlchemicalHydraPlugin plugin; private final Client client; @Inject - public HydraSceneOverlay(final Client client, final HydraPlugin plugin) + public AlchemicalHydraSceneOverlay(final Client client, final AlchemicalHydraPlugin plugin) { setPosition(OverlayPosition.DYNAMIC); setLayer(OverlayLayer.UNDER_WIDGETS); @@ -76,7 +76,7 @@ class HydraSceneOverlay extends Overlay @Override public Dimension render(Graphics2D graphics) { - Hydra hydra = plugin.getHydra(); + AlchemicalHydra hydra = plugin.getHydra(); final Map poisonProjectiles = plugin.getPoisonProjectiles(); if (plugin.isCounting() && !poisonProjectiles.isEmpty()) @@ -119,7 +119,7 @@ class HydraSceneOverlay extends Overlay graphics.fill(poisonTiles); } - private void drawFountain(Graphics2D graphics, Hydra hydra) + private void drawFountain(Graphics2D graphics, AlchemicalHydra hydra) { Collection fountainWorldPoint = WorldPoint.toLocalInstance(client, hydra.getPhase().getFountain()); // thanks if (fountainWorldPoint.size() > 1) // for diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraOverlay.java deleted file mode 100644 index c252ec0949..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraOverlay.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2018, https://openosrs.com - * 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.hydra; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics2D; -import javax.inject.Inject; -import javax.inject.Singleton; -import net.runelite.api.Client; -import net.runelite.api.NPC; -import net.runelite.api.Point; -import net.runelite.client.ui.FontManager; -import net.runelite.client.ui.overlay.Overlay; -import net.runelite.client.ui.overlay.OverlayLayer; -import net.runelite.client.ui.overlay.OverlayPosition; -import net.runelite.client.ui.overlay.OverlayPriority; -import net.runelite.client.ui.overlay.OverlayUtil; - -@Singleton -public class BabyHydraOverlay extends Overlay -{ - private final BabyHydraPlugin plugin; - - @Inject - private Client client; - - @Inject - private BabyHydraOverlay(final BabyHydraPlugin plugin) - { - this.plugin = plugin; - setLayer(OverlayLayer.ABOVE_SCENE); - setPosition(OverlayPosition.DYNAMIC); - setPriority(OverlayPriority.MED); - } - - @Override - public Dimension render(Graphics2D graphics) - { - for (NPC hydra : client.getNpcs()) - { - if (hydra == null || hydra.getName() == null) - { - continue; - } - if (hydra.getName().equalsIgnoreCase("Hydra") && plugin.getHydras().containsKey(hydra.getIndex())) - { - int val = plugin.getHydras().get(hydra.getIndex()); - if (val != 0) - { - if (plugin.isBoldText()) - { - graphics.setFont(FontManager.getRunescapeBoldFont()); - } - if (plugin.getHydraattacks().containsKey(hydra.getIndex())) - { - int attack = plugin.getHydraattacks().get(hydra.getIndex()); - - Point textLocation = hydra.getCanvasTextLocation(graphics, "TEMP!!", hydra.getLogicalHeight() + 100); - - if (textLocation != null && attack == 8261) - { - if (val == 3) - { - OverlayUtil.renderTextLocation(graphics, textLocation, "MAGE", Color.BLUE); - } - else - { - OverlayUtil.renderTextLocation(graphics, textLocation, "RANGE", Color.GREEN); - } - } - else if (textLocation != null && attack == 8262) - { - if (val == 3) - { - OverlayUtil.renderTextLocation(graphics, textLocation, "RANGE", Color.GREEN); - } - else - { - OverlayUtil.renderTextLocation(graphics, textLocation, "MAGE", Color.BLUE); - } - } - } - Point hydraPoint = hydra.getCanvasTextLocation(graphics, Integer.toString(val), hydra.getLogicalHeight() + 40); - if (hydraPoint != null) - { - OverlayUtil.renderTextLocation(graphics, hydraPoint, Integer.toString(val), Color.WHITE); - } - } - } - - } - graphics.setFont(FontManager.getRunescapeFont()); - return null; - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPlugin.java deleted file mode 100644 index dc063bdcc3..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPlugin.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (c) 2018, https://openosrs.com - * 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.hydra; - -import com.google.inject.Provides; -import java.util.HashMap; -import java.util.Map; -import javax.inject.Inject; -import javax.inject.Singleton; -import lombok.AccessLevel; -import lombok.Getter; -import net.runelite.api.Actor; -import net.runelite.api.Client; -import net.runelite.api.NPC; -import net.runelite.api.events.AnimationChanged; -import net.runelite.api.events.NpcDespawned; -import net.runelite.api.events.NpcSpawned; -import net.runelite.client.config.ConfigManager; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.events.ConfigChanged; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; -import net.runelite.client.ui.overlay.OverlayManager; - -@PluginDescriptor( - name = "Hydra Helper", - description = "Overlays for small hydras", - tags = {"Hydra", "Helper", "you", "probably", "want", "the", "other", "one"}, - type = PluginType.PVM, - enabledByDefault = false -) -@Singleton -public class BabyHydraPlugin extends Plugin -{ - @Inject - private OverlayManager overlayManager; - - @Inject - private BabyHydraConfig config; - - @Inject - private BabyHydraOverlay hydraOverlay; - - @Inject - private BabyHydraPrayOverlay hydraPrayOverlay; - - @Inject - private BabyHydraIndicatorOverlay hydraIndicatorOverlay; - - @Inject - private Client client; - - @Provides - BabyHydraConfig provideConfig(ConfigManager configManager) - { - return configManager.getConfig(BabyHydraConfig.class); - } - - @Getter(AccessLevel.PACKAGE) - private Map hydras = new HashMap<>(); - - @Getter(AccessLevel.PACKAGE) - private Map hydraattacks = new HashMap<>(); - - @Getter(AccessLevel.PACKAGE) - private NPC hydra; - - private boolean TextIndicator; - @Getter(AccessLevel.PACKAGE) - private boolean BoldText; - private boolean PrayerHelper; - - @Override - protected void startUp() - { - updateConfig(); - - if (this.TextIndicator) - { - overlayManager.add(hydraOverlay); - } - if (this.PrayerHelper) - { - overlayManager.add(hydraPrayOverlay); - overlayManager.add(hydraIndicatorOverlay); - } - } - - @Override - protected void shutDown() - { - overlayManager.remove(hydraOverlay); - overlayManager.remove(hydraPrayOverlay); - overlayManager.remove(hydraIndicatorOverlay); - hydras.clear(); - hydraattacks.clear(); - } - - @Subscribe - private void onConfigChanged(ConfigChanged event) - { - if (!event.getGroup().equals("hydra")) - { - return; - } - - updateConfig(); - - if (event.getKey().equals("textindicators")) - { - if (Boolean.parseBoolean(event.getNewValue())) - { - overlayManager.add(hydraOverlay); - } - else - { - overlayManager.remove(hydraOverlay); - } - } - else if (event.getKey().equals("prayerhelper")) - { - if (Boolean.parseBoolean(event.getNewValue())) - { - overlayManager.add(hydraPrayOverlay); - overlayManager.add(hydraIndicatorOverlay); - } - else - { - overlayManager.remove(hydraPrayOverlay); - overlayManager.remove(hydraIndicatorOverlay); - } - } - } - - @Subscribe - private void onNpcSpawned(NpcSpawned event) - { - NPC hydra = event.getNpc(); - if (hydra.getCombatLevel() != 0 && hydra.getName() != null && hydra.getName().equalsIgnoreCase("Hydra") && !hydras.containsKey(hydra.getIndex())) - { - hydras.put(hydra.getIndex(), 3); - } - } - - @Subscribe - private void onNpcDespawned(NpcDespawned event) - { - NPC hydra = event.getNpc(); - if (hydra.getCombatLevel() != 0 && hydra.getName() != null && hydra.getName().equalsIgnoreCase("Hydra")) - { - hydras.remove(hydra.getIndex()); - hydraattacks.remove(hydra.getIndex()); - } - } - - @Subscribe - private void onAnimationChanged(AnimationChanged event) - { - Actor monster = event.getActor(); - Actor local = client.getLocalPlayer(); - if (!(monster instanceof NPC) || local == null) - { - return; - } - NPC hydra = (NPC) monster; - - if (hydra.getCombatLevel() == 0 || hydra.getName() == null) - { - return; - } - - if (!hydra.getName().equalsIgnoreCase("Hydra") || !hydras.containsKey(hydra.getIndex())) - { - return; - } - - if (hydra.getAnimation() != 8261 && hydra.getAnimation() != 8262) - { - return; - } - - if (hydra.getInteracting() != null && hydra.getInteracting() == local) - { - this.hydra = hydra; - } - - if (hydraattacks.containsKey(hydra.getIndex())) - { - int lastattack = hydraattacks.get(hydra.getIndex()); - hydraattacks.replace(hydra.getIndex(), hydra.getAnimation()); - - if (lastattack != hydra.getAnimation()) - { - hydras.replace(hydra.getIndex(), 2); - } - else - { - int currval = hydras.get(hydra.getIndex()); - if (currval == 1) - { - hydras.replace(hydra.getIndex(), 3); - } - else - { - hydras.replace(hydra.getIndex(), currval - 1); - } - } - } - else - { - hydraattacks.put(hydra.getIndex(), hydra.getAnimation()); - int currval = hydras.get(hydra.getIndex()); - if (currval == 1) - { - hydras.replace(hydra.getIndex(), 3); - } - else - { - hydras.replace(hydra.getIndex(), currval - 1); - } - } - } - - private void updateConfig() - { - this.TextIndicator = config.TextIndicator(); - this.BoldText = config.BoldText(); - this.PrayerHelper = config.PrayerHelper(); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPrayOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPrayOverlay.java deleted file mode 100644 index 67b5703bb7..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraPrayOverlay.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2018, https://openosrs.com - * 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.hydra; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import javax.inject.Inject; -import javax.inject.Singleton; -import net.runelite.api.Client; -import net.runelite.api.Prayer; -import net.runelite.api.SpriteID; -import net.runelite.client.game.SpriteManager; -import net.runelite.client.ui.overlay.Overlay; -import net.runelite.client.ui.overlay.OverlayPosition; -import net.runelite.client.ui.overlay.OverlayPriority; -import net.runelite.client.ui.overlay.components.ComponentConstants; -import net.runelite.client.ui.overlay.components.ImageComponent; -import net.runelite.client.ui.overlay.components.PanelComponent; - -@Singleton -public class BabyHydraPrayOverlay extends Overlay -{ - private final BabyHydraPlugin plugin; - - private static final Color NOT_ACTIVATED_BACKGROUND_COLOR = new Color(150, 0, 0, 150); - private BufferedImage prayMage; - private BufferedImage prayRanged; - private final PanelComponent imagePanelComponent = new PanelComponent(); - - @Inject - private SpriteManager spriteManager; - - @Inject - private Client client; - - @Inject - private BabyHydraPrayOverlay(final BabyHydraPlugin plugin, final SpriteManager spriteManager) - { - this.plugin = plugin; - this.spriteManager = spriteManager; - setPosition(OverlayPosition.BOTTOM_RIGHT); - setPriority(OverlayPriority.HIGH); - } - - @Override - public Dimension render(Graphics2D graphics) - { - if (prayMage == null) - { - prayMage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0); - } - if (prayRanged == null) - { - prayRanged = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0); - } - - if (plugin.getHydra() != null && plugin.getHydras().containsKey(plugin.getHydra().getIndex())) - { - int val = plugin.getHydras().get(plugin.getHydra().getIndex()); - if (val != 0 && plugin.getHydraattacks().containsKey(plugin.getHydra().getIndex())) - { - int attack = plugin.getHydraattacks().get(plugin.getHydra().getIndex()); - if (attack == 8261) - { - if (val == 3) - { - imagePanelComponent.getChildren().clear(); - imagePanelComponent.getChildren().add(new ImageComponent(prayMage)); - imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC) - ? ComponentConstants.STANDARD_BACKGROUND_COLOR - : NOT_ACTIVATED_BACKGROUND_COLOR); - - return imagePanelComponent.render(graphics); - } - else - { - imagePanelComponent.getChildren().clear(); - imagePanelComponent.getChildren().add(new ImageComponent(prayRanged)); - imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES) - ? ComponentConstants.STANDARD_BACKGROUND_COLOR - : NOT_ACTIVATED_BACKGROUND_COLOR); - - return imagePanelComponent.render(graphics); - } - } - else if (attack == 8262) - { - if (val == 3) - { - imagePanelComponent.getChildren().clear(); - imagePanelComponent.getChildren().add(new ImageComponent(prayRanged)); - imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES) - ? ComponentConstants.STANDARD_BACKGROUND_COLOR - : NOT_ACTIVATED_BACKGROUND_COLOR); - - return imagePanelComponent.render(graphics); - } - else - { - imagePanelComponent.getChildren().clear(); - imagePanelComponent.getChildren().add(new ImageComponent(prayMage)); - imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC) - ? ComponentConstants.STANDARD_BACKGROUND_COLOR - : NOT_ACTIVATED_BACKGROUND_COLOR); - - return imagePanelComponent.render(graphics); - } - } - } - } - return null; - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/Hydra.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/Hydra.java new file mode 100644 index 0000000000..e1540682a9 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/Hydra.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2020, Dutta64 + * 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.hydra; + +import java.awt.Graphics2D; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; +import net.runelite.api.NPC; +import net.runelite.api.Point; + +public class Hydra +{ + static final int MAX_ATTACK_COUNT = 3; + + private final NPC npc; + + @Getter(AccessLevel.PACKAGE) + private int attackCount; + + @Getter(AccessLevel.PACKAGE) + @Setter(AccessLevel.PACKAGE) + private HydraAnimation hydraAnimation; + + public Hydra(final NPC npc) + { + this.npc = npc; + this.attackCount = MAX_ATTACK_COUNT; + this.hydraAnimation = null; + } + + void updateAttackCount() + { + attackCount = attackCount == 1 ? MAX_ATTACK_COUNT : --attackCount; + } + + void resetAttackCount() + { + attackCount = MAX_ATTACK_COUNT; + } + + Point getCanvasTextLocation(final Graphics2D graphics, final String text, final int zOffset) + { + return npc.getCanvasTextLocation(graphics, text, zOffset); + } + + int getLogicalHeight() + { + return npc.getLogicalHeight(); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAnimation.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAnimation.java new file mode 100644 index 0000000000..05f4bc6f3a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAnimation.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020, Dutta64 + * 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.hydra; + +import java.awt.Color; +import java.util.Objects; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum HydraAnimation +{ + RANGE(8261, "RANGE", new Color(0, 255, 0)), + MAGIC(8262, "MAGIC", new Color(52, 152, 219)), + POISON(8263, "POISON", new Color(255, 0, 0)); // Not used currently + + @Getter(AccessLevel.PACKAGE) + private final int id; + + @Getter(AccessLevel.PACKAGE) + private final String text; + + @Getter(AccessLevel.PACKAGE) + private final Color color; + + public static HydraAnimation fromId(final int id) + { + for (final HydraAnimation hydraAnimation : HydraAnimation.values()) + { + if (Objects.equals(hydraAnimation.id, id)) + { + return hydraAnimation; + } + } + + throw new IllegalArgumentException(); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAttackCounterOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAttackCounterOverlay.java new file mode 100644 index 0000000000..da429d5976 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraAttackCounterOverlay.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2018, https://openosrs.com + * Copyright (c) 2020, Dutta64 + * 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.hydra; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.util.HashMap; +import java.util.Map; +import javax.inject.Inject; +import javax.inject.Singleton; +import lombok.AccessLevel; +import lombok.Setter; +import net.runelite.api.Client; +import net.runelite.api.NPC; +import net.runelite.api.Point; +import net.runelite.client.ui.FontManager; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayLayer; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.OverlayPriority; +import net.runelite.client.ui.overlay.OverlayUtil; + +@Singleton +public class HydraAttackCounterOverlay extends Overlay +{ + private final HydraPlugin hydraPlugin; + + private final Client client; + + @Setter(AccessLevel.PACKAGE) + private Map hydras; + + @Setter(AccessLevel.PACKAGE) + private boolean isBoldAttackCounterOverlay; + + @Inject + private HydraAttackCounterOverlay(final HydraPlugin hydraPlugin, final Client client) + { + this.hydraPlugin = hydraPlugin; + this.client = client; + this.hydras = new HashMap<>(); + this.isBoldAttackCounterOverlay = false; + setLayer(OverlayLayer.ABOVE_SCENE); + setPosition(OverlayPosition.DYNAMIC); + setPriority(OverlayPriority.MED); + } + + @Override + public Dimension render(final Graphics2D graphics) + { + if (!hydraPlugin.isPlayerAtHydraRegion()) + { + return null; + } + + for (final NPC npc : client.getNpcs()) + { + final Hydra hydra = hydras.get(npc.getIndex()); + + if (hydra == null) + { + continue; + } + + if (isBoldAttackCounterOverlay) + { + graphics.setFont(FontManager.getRunescapeBoldFont()); + } + else + { + graphics.setFont(FontManager.getRunescapeFont()); + } + + renderAnimationAttackType(graphics, hydra); + renderAttackCount(graphics, hydra); + } + + return null; + } + + private void renderAnimationAttackType(final Graphics2D graphics, final Hydra hydra) + { + final HydraAnimation hydraAnimation = hydra.getHydraAnimation(); + + if (hydraAnimation == null) + { + return; + } + + final int heightOffset = 100; + + final Point textLocation = hydra.getCanvasTextLocation(graphics, "TEMP!", + hydra.getLogicalHeight() + heightOffset); + + if (textLocation == null) + { + return; + } + + final boolean attackCountIsMax = hydra.getAttackCount() == Hydra.MAX_ATTACK_COUNT; + + switch (hydraAnimation) + { + case RANGE: + if (attackCountIsMax) + { + OverlayUtil.renderTextLocation(graphics, textLocation, HydraAnimation.MAGIC.getText(), + HydraAnimation.MAGIC.getColor()); + } + else + { + OverlayUtil.renderTextLocation(graphics, textLocation, HydraAnimation.RANGE.getText(), + HydraAnimation.RANGE.getColor()); + } + break; + case MAGIC: + if (attackCountIsMax) + { + OverlayUtil.renderTextLocation(graphics, textLocation, HydraAnimation.RANGE.getText(), + HydraAnimation.RANGE.getColor()); + } + else + { + OverlayUtil.renderTextLocation(graphics, textLocation, HydraAnimation.MAGIC.getText(), + HydraAnimation.MAGIC.getColor()); + } + break; + default: + break; + } + } + + private void renderAttackCount(final Graphics2D graphics, final Hydra hydra) + { + final int attackCount = hydra.getAttackCount(); + + final int heightOffset = 30; + + final Point textLocation = hydra.getCanvasTextLocation(graphics, Integer.toString(attackCount), + hydra.getLogicalHeight() + heightOffset); + + if (textLocation != null) + { + OverlayUtil.renderTextLocation(graphics, textLocation, Integer.toString(attackCount), Color.WHITE); + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraConfig.java similarity index 64% rename from runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraConfig.java rename to runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraConfig.java index a92a3789ea..9733fbfcf3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraConfig.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, https://openosrs.com + * Copyright (c) 2020, Dutta64 * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,38 +30,49 @@ import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; @ConfigGroup("hydra") -public interface BabyHydraConfig extends Config +public interface HydraConfig extends Config { @ConfigItem( position = 1, - keyName = "textindicators", - name = "Text Indicator", - description = "Configures if text indicator is shown above hydra's or not." + keyName = "attackCounterOverlay", + name = "Attack Counter Overlay", + description = "Configures if an attack counter overlay is shown." ) - default boolean TextIndicator() + default boolean isAttackCounterOverlay() { return true; } @ConfigItem( position = 2, - keyName = "countersize", - name = "Bold indicator", - description = "Configures if text indicator is bold or not." + keyName = "boldAttackCounterOverlay", + name = "Bold Attack Counter", + description = "Configures if the attack counter is bold.
Attack Counter Overlay must be enabled." ) - default boolean BoldText() + default boolean isBoldAttackCounterOverlay() { return false; } @ConfigItem( position = 3, - keyName = "prayerhelper", - name = "Prayer Helper", - description = "Configures if prayer helper is shown or not." + keyName = "prayerOverlay", + name = "Prayer Overlay", + description = "Configures if a prayer overlay is shown.
This overlay includes a mini attack counter." ) - default boolean PrayerHelper() + default boolean isPrayerOverlay() + { + return true; + } + + @ConfigItem( + position = 4, + keyName = "poisonProjectileOverlay", + name = "Poison Projectile Overlay", + description = "Configures if a poison projectile overlay is shown." + ) + default boolean isPoisonOverlay() { return true; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPlugin.java new file mode 100644 index 0000000000..eef36dff89 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPlugin.java @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2018, https://openosrs.com + * Copyright (c) 2020, Dutta64 + * 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.hydra; + +import com.google.inject.Provides; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.inject.Inject; +import javax.inject.Singleton; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.Actor; +import net.runelite.api.Client; +import net.runelite.api.NPC; +import net.runelite.api.Player; +import net.runelite.api.Projectile; +import net.runelite.api.ProjectileID; +import net.runelite.api.coords.LocalPoint; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.AnimationChanged; +import net.runelite.api.events.InteractingChanged; +import net.runelite.api.events.NpcDespawned; +import net.runelite.api.events.NpcSpawned; +import net.runelite.api.events.ProjectileMoved; +import net.runelite.client.config.ConfigManager; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.plugins.PluginType; +import net.runelite.client.ui.overlay.OverlayManager; + +@PluginDescriptor( + name = "Hydra Helper", + description = "Overlays for normal Hydras.", + tags = {"hydra", "helper", "baby", "small", "normal", "regular"}, + type = PluginType.PVM, + enabledByDefault = false +) +@Slf4j +@Singleton +public class HydraPlugin extends Plugin +{ + static final Set VALID_HYDRA_ANIMATIONS = EnumSet.of( + HydraAnimation.RANGE, + HydraAnimation.MAGIC + ); + + private static final String CONFIG_GROUP_NAME = "hydra"; + private static final String CONFIG_ITEM_ATTACK_COUNTER = "attackCounterOverlay"; + private static final String CONFIG_ITEM_PRAYER_OVERLAY = "prayerOverlay"; + private static final String CONFIG_ITEM_POISON_PROJECTILE_OVERLAY = "poisonProjectileOverlay"; + private static final String CONFIG_ITEM_BOLD_ATTACK_COUNTER_OVERLAY = "boldAttackCounterOverlay"; + + private static final String NPC_NAME_HYDRA = "Hydra"; + + private static final int HYDRA_REGION_1 = 5279; + private static final int HYDRA_REGION_2 = 5280; + + @Inject + private Client client; + + @Inject + private HydraConfig hydraConfig; + + @Inject + private OverlayManager overlayManager; + + @Inject + private HydraAttackCounterOverlay hydraAttackCounterOverlay; + + @Inject + private HydraPrayerOverlay hydraPrayerOverlay; + + @Inject + private HydraPrayerAttackCounterOverlay hydraPrayerAttackCounterOverlay; + + @Inject + private HydraPoisonOverlay hydraPoisonOverlay; + + private final Map hydras = new HashMap<>(); + + private final Map poisonProjectiles = new HashMap<>(); + + @Getter(AccessLevel.PACKAGE) + private NPC interactingNpc = null; + + @Provides + HydraConfig provideConfig(final ConfigManager configManager) + { + return configManager.getConfig(HydraConfig.class); + } + + @Override + protected void startUp() + { + if (hydraConfig.isAttackCounterOverlay()) + { + overlayManager.add(hydraAttackCounterOverlay); + } + + if (hydraConfig.isPrayerOverlay()) + { + overlayManager.add(hydraPrayerOverlay); + overlayManager.add(hydraPrayerAttackCounterOverlay); + } + + if (hydraConfig.isPoisonOverlay()) + { + overlayManager.add(hydraPoisonOverlay); + } + + hydraAttackCounterOverlay.setBoldAttackCounterOverlay(hydraConfig.isBoldAttackCounterOverlay()); + + hydraAttackCounterOverlay.setHydras(hydras); + hydraPrayerOverlay.setHydras(hydras); + hydraPrayerAttackCounterOverlay.setHydras(hydras); + + hydraPoisonOverlay.setPoisonProjectiles(poisonProjectiles); + + resetHydras(); + poisonProjectiles.clear(); + } + + @Override + protected void shutDown() + { + overlayManager.remove(hydraAttackCounterOverlay); + overlayManager.remove(hydraPrayerOverlay); + overlayManager.remove(hydraPrayerAttackCounterOverlay); + overlayManager.remove(hydraPoisonOverlay); + resetHydras(); + poisonProjectiles.clear(); + + } + + @Subscribe + private void onConfigChanged(final ConfigChanged event) + { + if (!event.getGroup().equals(CONFIG_GROUP_NAME)) + { + return; + } + + final boolean newConfigValue = Boolean.parseBoolean(event.getNewValue()); + + switch (event.getKey()) + { + case CONFIG_ITEM_ATTACK_COUNTER: + if (newConfigValue) + { + overlayManager.add(hydraAttackCounterOverlay); + } + else + { + overlayManager.remove(hydraAttackCounterOverlay); + } + break; + case CONFIG_ITEM_PRAYER_OVERLAY: + if (newConfigValue) + { + overlayManager.add(hydraPrayerOverlay); + overlayManager.add(hydraPrayerAttackCounterOverlay); + } + else + { + overlayManager.remove(hydraPrayerOverlay); + overlayManager.remove(hydraPrayerAttackCounterOverlay); + } + break; + case CONFIG_ITEM_POISON_PROJECTILE_OVERLAY: + if (newConfigValue) + { + overlayManager.add(hydraPoisonOverlay); + } + else + { + overlayManager.remove(hydraPoisonOverlay); + } + break; + case CONFIG_ITEM_BOLD_ATTACK_COUNTER_OVERLAY: + hydraAttackCounterOverlay.setBoldAttackCounterOverlay(hydraConfig.isBoldAttackCounterOverlay()); + break; + default: + break; + } + } + + @Subscribe + private void onNpcSpawned(final NpcSpawned event) + { + final NPC npc = event.getNpc(); + + if (isActorHydra(npc)) + { + addHydra(npc); + } + } + + @Subscribe + private void onNpcDespawned(final NpcDespawned event) + { + final NPC npc = event.getNpc(); + + if (isActorHydra(npc)) + { + removeHydra(npc); + poisonProjectiles.clear(); + } + } + + @Subscribe + private void onInteractingChanged(final InteractingChanged event) + { + final Actor source = event.getSource(); + + if (!isActorHydra(source)) + { + return; + } + + final NPC npc = (NPC) source; + + addHydra(npc); + updateInteractingNpc(npc); + } + + @Subscribe + private void onAnimationChanged(final AnimationChanged event) + { + final Actor actor = event.getActor(); + + if (!isActorHydra(actor)) + { + return; + } + + final NPC npc = (NPC) event.getActor(); + + addHydra(npc); + updateInteractingNpc(npc); + + HydraAnimation hydraAnimation; + + try + { + hydraAnimation = HydraAnimation.fromId(npc.getAnimation()); + } + catch (final IllegalArgumentException e) + { + hydraAnimation = null; + } + + if (hydraAnimation == null || !VALID_HYDRA_ANIMATIONS.contains(hydraAnimation)) + { + // If the animation is not range/magic then do nothing. + return; + } + + final Hydra hydra = hydras.get(npc.getIndex()); + + if (hydra.getHydraAnimation() == null) + { + // If this is the first observed animation then set it + hydra.setHydraAnimation(hydraAnimation); + } + else + { + if (!Objects.equals(hydra.getHydraAnimation(), hydraAnimation)) + { + // If the animation switched from range/magic then set it and reset attack count + hydra.setHydraAnimation(hydraAnimation); + hydra.resetAttackCount(); + } + } + + hydra.updateAttackCount(); + + if (!poisonProjectiles.isEmpty()) + { + updatePoisonProjectiles(); + } + } + + /** + * See net.runelite.client.plugins.alchemicalhydra.AlchemicalHydraPlugin + * Copyright (c) 2019, Lucas + * + * @param event event object + */ + @Subscribe + private void onProjectileMoved(final ProjectileMoved event) + { + if (interactingNpc == null || client.getGameCycle() >= event.getProjectile().getStartMovementCycle()) + { + return; + } + + final Projectile projectile = event.getProjectile(); + + final int projectileId = projectile.getId(); + + if (projectileId == ProjectileID.HYDRA_POISON) + { + poisonProjectiles.put(event.getPosition(), projectile); + } + } + + /** + * See net.runelite.client.plugins.alchemicalhydra.AlchemicalHydraPlugin + * Copyright (c) 2019, Lucas + */ + private void updatePoisonProjectiles() + { + final Set expiredPoisonProjectiles = new HashSet<>(); + + for (final Map.Entry entry : poisonProjectiles.entrySet()) + { + if (entry.getValue().getEndCycle() < client.getGameCycle()) + { + expiredPoisonProjectiles.add(entry.getKey()); + } + } + + for (final LocalPoint projectileLocalPoint : expiredPoisonProjectiles) + { + poisonProjectiles.remove(projectileLocalPoint); + } + } + + boolean isPlayerAtHydraRegion() + { + final Player player = client.getLocalPlayer(); + + if (player == null) + { + return false; + } + + final WorldPoint worldPoint = player.getWorldLocation(); + + if (worldPoint == null) + { + return false; + } + + final int regionId = worldPoint.getRegionID(); + + return regionId == HYDRA_REGION_1 || regionId == HYDRA_REGION_2; + } + + private static boolean isActorHydra(final Actor actor) + { + return Objects.equals(actor.getName(), NPC_NAME_HYDRA); + } + + private void updateInteractingNpc(final NPC npc) + { + if (!Objects.equals(interactingNpc, npc) && + Objects.equals(npc.getInteracting(), client.getLocalPlayer())) + { + interactingNpc = npc; + } + } + + private void addHydra(final NPC npc) + { + final int npcIndex = npc.getIndex(); + + if (!hydras.containsKey(npcIndex)) + { + hydras.put(npcIndex, new Hydra(npc)); + } + } + + private void removeHydra(final NPC npc) + { + final int npcIndex = npc.getIndex(); + + hydras.remove(npcIndex); + + if (Objects.equals(interactingNpc, npc)) + { + interactingNpc = null; + } + } + + private void resetHydras() + { + hydras.clear(); + interactingNpc = null; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPoisonOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPoisonOverlay.java new file mode 100644 index 0000000000..847f4af5df --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPoisonOverlay.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2018, https://openosrs.com + * Copyright (c) 2020, Dutta64 + * 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.hydra; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Polygon; +import java.awt.geom.Area; +import java.util.HashMap; +import java.util.Map; +import javax.inject.Inject; +import javax.inject.Singleton; +import lombok.AccessLevel; +import lombok.Setter; +import net.runelite.api.Client; +import static net.runelite.api.Perspective.getCanvasTileAreaPoly; +import net.runelite.api.Projectile; +import net.runelite.api.coords.LocalPoint; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayLayer; +import net.runelite.client.ui.overlay.OverlayPosition; + +@Singleton +public class HydraPoisonOverlay extends Overlay +{ + private static final Color poisonBorder = new Color(255, 0, 0, 100);; + private static final Color poisonFill = new Color(255, 0, 0, 50);; + + private final Client client; + + @Setter(AccessLevel.PACKAGE) + private Map poisonProjectiles; + + @Inject + public HydraPoisonOverlay(final Client client) + { + this.client = client; + this.poisonProjectiles = new HashMap<>(); + setPosition(OverlayPosition.DYNAMIC); + setLayer(OverlayLayer.UNDER_WIDGETS); + } + + @Override + public Dimension render(final Graphics2D graphics) + { + if (!poisonProjectiles.isEmpty()) + { + drawPoisonArea(graphics, poisonProjectiles); + } + + return null; + } + + /** + * See net.runelite.client.plugins.alchemicalhydra.AlchemicalHydraSceneOverlay + * Copyright (c) 2019, Lucas + * + * @param graphics graphics object + * @param poisonProjectiles poisonProjectiles object + */ + private void drawPoisonArea(final Graphics2D graphics, final Map poisonProjectiles) + { + final Area poisonTiles = new Area(); + + for (final Map.Entry entry : poisonProjectiles.entrySet()) + { + if (entry.getValue().getEndCycle() < client.getGameCycle()) + { + continue; + } + + final LocalPoint point = entry.getKey(); + final Polygon poly = getCanvasTileAreaPoly(client, point, 3); + + if (poly != null) + { + poisonTiles.add(new Area(poly)); + } + } + + graphics.setPaintMode(); + graphics.setColor(poisonBorder); + graphics.draw(poisonTiles); + graphics.setColor(poisonFill); + graphics.fill(poisonTiles); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraIndicatorOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerAttackCounterOverlay.java similarity index 63% rename from runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraIndicatorOverlay.java rename to runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerAttackCounterOverlay.java index 6d87a08567..54075f119f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/BabyHydraIndicatorOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerAttackCounterOverlay.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, https://openosrs.com + * Copyright (c) 2020, Dutta64 * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,8 +27,13 @@ package net.runelite.client.plugins.hydra; import java.awt.Dimension; import java.awt.Graphics2D; +import java.util.HashMap; +import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; +import lombok.AccessLevel; +import lombok.Setter; +import net.runelite.api.NPC; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayPriority; @@ -35,34 +41,48 @@ import net.runelite.client.ui.overlay.components.LineComponent; import net.runelite.client.ui.overlay.components.PanelComponent; @Singleton -public class BabyHydraIndicatorOverlay extends Overlay +public class HydraPrayerAttackCounterOverlay extends Overlay { - private final BabyHydraPlugin plugin; + private final HydraPlugin hydraPlugin; - private final PanelComponent panelComponent = new PanelComponent(); + private final PanelComponent panelComponent; + + @Setter(AccessLevel.PACKAGE) + private Map hydras; @Inject - private BabyHydraIndicatorOverlay(final BabyHydraPlugin plugin) + private HydraPrayerAttackCounterOverlay(final HydraPlugin hydraPlugin) { - this.plugin = plugin; + this.hydraPlugin = hydraPlugin; + this.panelComponent = new PanelComponent(); + this.panelComponent.setPreferredSize(new Dimension(14, 0)); + this.hydras = new HashMap<>(); setPosition(OverlayPosition.BOTTOM_RIGHT); setPriority(OverlayPriority.MED); - panelComponent.setPreferredSize(new Dimension(14, 0)); } @Override - public Dimension render(Graphics2D graphics) + public Dimension render(final Graphics2D graphics) { - if (plugin.getHydra() != null && plugin.getHydras().containsKey(plugin.getHydra().getIndex())) + final NPC npc = hydraPlugin.getInteractingNpc(); + + if (npc == null) { - int val = plugin.getHydras().get(plugin.getHydra().getIndex()); - if (val != 0) - { - panelComponent.getChildren().clear(); - panelComponent.getChildren().add(LineComponent.builder().right(Integer.toString(val)).build()); - return panelComponent.render(graphics); - } + return null; } - return null; + + final Hydra hydra = hydras.get(npc.getIndex()); + + if (hydra == null) + { + return null; + } + + final String attackCount = String.valueOf(hydra.getAttackCount()); + + panelComponent.getChildren().clear(); + panelComponent.getChildren().add(LineComponent.builder().right(attackCount).build()); + + return panelComponent.render(graphics); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerOverlay.java new file mode 100644 index 0000000000..c74fdb1ad4 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hydra/HydraPrayerOverlay.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2018, https://openosrs.com + * Copyright (c) 2020, Dutta64 + * 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.hydra; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.util.HashMap; +import java.util.Map; +import javax.inject.Inject; +import javax.inject.Singleton; +import lombok.AccessLevel; +import lombok.Setter; +import net.runelite.api.Client; +import net.runelite.api.NPC; +import net.runelite.api.Prayer; +import net.runelite.api.SpriteID; +import net.runelite.client.game.SpriteManager; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.OverlayPriority; +import net.runelite.client.ui.overlay.components.ImageComponent; +import net.runelite.client.ui.overlay.components.PanelComponent; + +@Singleton +public class HydraPrayerOverlay extends Overlay +{ + private static final Color ACTIVATED_BACKGROUND_COLOR = new Color(0, 150, 0, 150); + private static final Color NOT_ACTIVATED_BACKGROUND_COLOR = new Color(150, 0, 0, 150); + + private final HydraPlugin hydraPlugin; + + private final Client client; + + private final SpriteManager spriteManager; + + private final PanelComponent panelComponent; + + @Setter(AccessLevel.PACKAGE) + private Map hydras; + + private BufferedImage bufferedImageRange; + private BufferedImage bufferedImageMagic; + + @Inject + private HydraPrayerOverlay(final HydraPlugin hydraPlugin, final Client client, final SpriteManager spriteManager) + { + this.hydraPlugin = hydraPlugin; + this.client = client; + this.spriteManager = spriteManager; + this.panelComponent = new PanelComponent(); + this.hydras = new HashMap<>(); + this.bufferedImageRange = null; + this.bufferedImageMagic = null; + setPosition(OverlayPosition.BOTTOM_RIGHT); + setPriority(OverlayPriority.HIGH); + } + + @Override + public Dimension render(final Graphics2D graphics) + { + final NPC npc = hydraPlugin.getInteractingNpc(); + + if (npc == null) + { + return null; + } + + final Hydra hydra = hydras.get(npc.getIndex()); + + if (hydra == null) + { + return null; + } + + final HydraAnimation hydraAnimation = hydra.getHydraAnimation(); + + if (hydraAnimation == null || !HydraPlugin.VALID_HYDRA_ANIMATIONS.contains(hydraAnimation)) + { + return null; + } + + if (bufferedImageMagic == null) + { + bufferedImageMagic = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0); + } + + if (bufferedImageRange == null) + { + bufferedImageRange = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0); + } + + final boolean attackCountIsMax = hydra.getAttackCount() == Hydra.MAX_ATTACK_COUNT; + + switch (hydraAnimation) + { + case RANGE: + if (attackCountIsMax) + { + return renderPanelMagic(graphics); + } + else + { + return renderPanelRange(graphics); + } + case MAGIC: + if (attackCountIsMax) + { + return renderPanelRange(graphics); + } + else + { + return renderPanelMagic(graphics); + } + default: + break; + } + + return null; + } + + private Dimension renderPanelMagic(final Graphics2D graphics) + { + panelComponent.getChildren().clear(); + panelComponent.getChildren().add(new ImageComponent(bufferedImageMagic)); + panelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC) + ? ACTIVATED_BACKGROUND_COLOR + : NOT_ACTIVATED_BACKGROUND_COLOR); + + return panelComponent.render(graphics); + } + + private Dimension renderPanelRange(final Graphics2D graphics) + { + panelComponent.getChildren().clear(); + panelComponent.getChildren().add(new ImageComponent(bufferedImageRange)); + panelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES) + ? ACTIVATED_BACKGROUND_COLOR + : NOT_ACTIVATED_BACKGROUND_COLOR); + + return panelComponent.render(graphics); + } +} From 9192ed51f2454e57bbb5a6012e12e7a7475d363e Mon Sep 17 00:00:00 2001 From: Ganom Date: Tue, 14 Jan 2020 21:53:56 -0500 Subject: [PATCH 06/17] tmorph: use interactive panel rather than complex strings. database: GenerateClasses now uses proper directory. --- .../client/database/GenerateClasses.java | 2 +- .../client/database/data/DefaultCatalog.java | 6 +- .../client/database/data/Indexes.java | 17 +- .../runelite/client/database/data/Keys.java | 24 +- .../runelite/client/database/data/Public.java | 16 +- .../runelite/client/database/data/Tables.java | 18 +- .../data/tables/Loottrackerevents.java | 47 +- .../database/data/tables/Loottrackerlink.java | 65 +-- .../database/data/tables/Loottrackerloot.java | 45 +- .../database/data/tables/TmorphSets.java | 196 +++++++ .../client/database/data/tables/User.java | 43 +- .../records/LoottrackereventsRecord.java | 66 +-- .../tables/records/LoottrackerlinkRecord.java | 81 +-- .../tables/records/LoottrackerlootRecord.java | 54 +- .../data/tables/records/TmorphSetsRecord.java | 503 ++++++++++++++++++ .../data/tables/records/UserRecord.java | 42 +- .../runelite/client/plugins/tmorph/Parse.java | 47 -- .../client/plugins/tmorph/TMorph.java | 131 ++--- .../client/plugins/tmorph/TMorphConfig.java | 80 --- .../client/plugins/tmorph/TmorphSet.java | 41 ++ .../client/plugins/tmorph/ui/EquipSlot.java | 123 +++++ .../client/plugins/tmorph/ui/TPanel.java | 439 +++++++++++++++ 22 files changed, 1496 insertions(+), 590 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/database/data/tables/TmorphSets.java create mode 100644 runelite-client/src/main/java/net/runelite/client/database/data/tables/records/TmorphSetsRecord.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TmorphSet.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java diff --git a/runelite-client/src/main/java/net/runelite/client/database/GenerateClasses.java b/runelite-client/src/main/java/net/runelite/client/database/GenerateClasses.java index dc595527d5..f6125b55e1 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/GenerateClasses.java +++ b/runelite-client/src/main/java/net/runelite/client/database/GenerateClasses.java @@ -26,7 +26,7 @@ public class GenerateClasses ) .withTarget(new Target() .withPackageName("net.runelite.client.database.data") - .withDirectory("runelite-client/src/main/java/net/runelite/client/database/data") + .withDirectory("runelite-client/src/main/java/") ) ); diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/DefaultCatalog.java b/runelite-client/src/main/java/net/runelite/client/database/data/DefaultCatalog.java index 4a2a9d4eff..139bcaf234 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/DefaultCatalog.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/DefaultCatalog.java @@ -7,7 +7,7 @@ package net.runelite.client.database.data; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import org.jooq.Schema; import org.jooq.impl.CatalogImpl; @@ -18,7 +18,7 @@ import org.jooq.impl.CatalogImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -26,7 +26,7 @@ import org.jooq.impl.CatalogImpl; public class DefaultCatalog extends CatalogImpl { - private static final long serialVersionUID = 836257769; + private static final long serialVersionUID = -102989253; /** * The reference instance of diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/Indexes.java b/runelite-client/src/main/java/net/runelite/client/database/data/Indexes.java index b736e0093e..72626efa54 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/Indexes.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/Indexes.java @@ -4,10 +4,11 @@ package net.runelite.client.database.data; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.tables.Loottrackerevents; import net.runelite.client.database.data.tables.Loottrackerlink; import net.runelite.client.database.data.tables.Loottrackerloot; +import net.runelite.client.database.data.tables.TmorphSets; import net.runelite.client.database.data.tables.User; import org.jooq.Index; import org.jooq.OrderField; @@ -20,7 +21,7 @@ import org.jooq.impl.Internal; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -33,11 +34,13 @@ public class Indexes // ------------------------------------------------------------------------- public static final Index PRIMARY_KEY_B = Indexes0.PRIMARY_KEY_B; + public static final Index FK_LOOTTRACKERDROP_INDEX_6 = Indexes0.FK_LOOTTRACKERDROP_INDEX_6; public static final Index FK_LOOTTRACKEREVENT_INDEX_6 = Indexes0.FK_LOOTTRACKEREVENT_INDEX_6; - public static final Index FK_LOOTTRACKERLOOT_INDEX_6 = Indexes0.FK_LOOTTRACKERLOOT_INDEX_6; - public static final Index PRIMARY_KEY_6B = Indexes0.PRIMARY_KEY_6B; + public static final Index FK_USER_INDEX_6 = Indexes0.FK_USER_INDEX_6; public static final Index PRIMARY_KEY_6 = Indexes0.PRIMARY_KEY_6; + public static final Index TMORPH_SETS_SET_NAME_UINDEX = Indexes0.TMORPH_SETS_SET_NAME_UINDEX; public static final Index PRIMARY_KEY_2 = Indexes0.PRIMARY_KEY_2; + public static final Index UN_USERNAME_INDEX_2 = Indexes0.UN_USERNAME_INDEX_2; // ------------------------------------------------------------------------- // [#1459] distribute members to avoid static initialisers > 64kb @@ -46,10 +49,12 @@ public class Indexes private static class Indexes0 { public static Index PRIMARY_KEY_B = Internal.createIndex("PRIMARY_KEY_B", Loottrackerevents.LOOTTRACKEREVENTS, new OrderField[]{Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID}, true); + public static Index FK_LOOTTRACKERDROP_INDEX_6 = Internal.createIndex("FK_LOOTTRACKERDROP_INDEX_6", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID}, false); public static Index FK_LOOTTRACKEREVENT_INDEX_6 = Internal.createIndex("FK_LOOTTRACKEREVENT_INDEX_6", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID}, false); - public static Index FK_LOOTTRACKERLOOT_INDEX_6 = Internal.createIndex("FK_LOOTTRACKERLOOT_INDEX_6", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID}, false); - public static Index PRIMARY_KEY_6B = Internal.createIndex("PRIMARY_KEY_6B", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.LINKUNIQUEID}, true); + public static Index FK_USER_INDEX_6 = Internal.createIndex("FK_USER_INDEX_6", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.USERUNIQUEID}, false); public static Index PRIMARY_KEY_6 = Internal.createIndex("PRIMARY_KEY_6", Loottrackerloot.LOOTTRACKERLOOT, new OrderField[]{Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID}, true); + public static Index TMORPH_SETS_SET_NAME_UINDEX = Internal.createIndex("TMORPH_SETS_SET_NAME_UINDEX", TmorphSets.TMORPH_SETS, new OrderField[]{TmorphSets.TMORPH_SETS.SET_NAME}, true); public static Index PRIMARY_KEY_2 = Internal.createIndex("PRIMARY_KEY_2", User.USER, new OrderField[]{User.USER.UNIQUEID}, true); + public static Index UN_USERNAME_INDEX_2 = Internal.createIndex("UN_USERNAME_INDEX_2", User.USER, new OrderField[]{User.USER.USERNAME}, true); } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/Keys.java b/runelite-client/src/main/java/net/runelite/client/database/data/Keys.java index fc561055c9..2f01544f08 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/Keys.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/Keys.java @@ -4,7 +4,7 @@ package net.runelite.client.database.data; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.tables.Loottrackerevents; import net.runelite.client.database.data.tables.Loottrackerlink; import net.runelite.client.database.data.tables.Loottrackerloot; @@ -25,7 +25,7 @@ import org.jooq.impl.Internal; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -42,17 +42,17 @@ public class Keys // UNIQUE and PRIMARY KEY definitions // ------------------------------------------------------------------------- - public static final UniqueKey PK_EVENTUNIQUEID = UniqueKeys0.PK_EVENTUNIQUEID; - public static final UniqueKey PK_LOOTTRACKERLINK = UniqueKeys0.PK_LOOTTRACKERLINK; - public static final UniqueKey PK_LOOTUNIQUEID = UniqueKeys0.PK_LOOTUNIQUEID; + public static final UniqueKey PK_LOOTTRACKEREVENTS = UniqueKeys0.PK_LOOTTRACKEREVENTS; + public static final UniqueKey PK_LOOTTRACKERDROPS = UniqueKeys0.PK_LOOTTRACKERDROPS; public static final UniqueKey PK_USER = UniqueKeys0.PK_USER; + public static final UniqueKey UN_USERNAME = UniqueKeys0.UN_USERNAME; // ------------------------------------------------------------------------- // FOREIGN KEY definitions // ------------------------------------------------------------------------- public static final ForeignKey FK_LOOTTRACKEREVENT = ForeignKeys0.FK_LOOTTRACKEREVENT; - public static final ForeignKey FK_LOOTTRACKERLOOT = ForeignKeys0.FK_LOOTTRACKERLOOT; + public static final ForeignKey FK_LOOTTRACKERDROP = ForeignKeys0.FK_LOOTTRACKERDROP; public static final ForeignKey FK_USER = ForeignKeys0.FK_USER; // ------------------------------------------------------------------------- @@ -61,16 +61,16 @@ public class Keys private static class UniqueKeys0 { - public static final UniqueKey PK_EVENTUNIQUEID = Internal.createUniqueKey(Loottrackerevents.LOOTTRACKEREVENTS, "PK_EVENTUNIQUEID", Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID); - public static final UniqueKey PK_LOOTTRACKERLINK = Internal.createUniqueKey(Loottrackerlink.LOOTTRACKERLINK, "PK_LOOTTRACKERLINK", Loottrackerlink.LOOTTRACKERLINK.LINKUNIQUEID); - public static final UniqueKey PK_LOOTUNIQUEID = Internal.createUniqueKey(Loottrackerloot.LOOTTRACKERLOOT, "PK_LOOTUNIQUEID", Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID); + public static final UniqueKey PK_LOOTTRACKEREVENTS = Internal.createUniqueKey(Loottrackerevents.LOOTTRACKEREVENTS, "PK_LOOTTRACKEREVENTS", Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID); + public static final UniqueKey PK_LOOTTRACKERDROPS = Internal.createUniqueKey(Loottrackerloot.LOOTTRACKERLOOT, "PK_LOOTTRACKERDROPS", Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID); public static final UniqueKey PK_USER = Internal.createUniqueKey(User.USER, "PK_USER", User.USER.UNIQUEID); + public static final UniqueKey UN_USERNAME = Internal.createUniqueKey(User.USER, "UN_USERNAME", User.USER.USERNAME); } private static class ForeignKeys0 { - public static final ForeignKey FK_LOOTTRACKEREVENT = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_EVENTUNIQUEID, Loottrackerlink.LOOTTRACKERLINK, "FK_LOOTTRACKEREVENT", Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID); - public static final ForeignKey FK_LOOTTRACKERLOOT = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_LOOTUNIQUEID, Loottrackerlink.LOOTTRACKERLINK, "FK_LOOTTRACKERLOOT", Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID); - public static final ForeignKey FK_USER = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_USER, Loottrackerlink.LOOTTRACKERLINK, "FK_USER", Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID); + public static final ForeignKey FK_LOOTTRACKEREVENT = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_LOOTTRACKEREVENTS, Loottrackerlink.LOOTTRACKERLINK, "FK_LOOTTRACKEREVENT", Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID); + public static final ForeignKey FK_LOOTTRACKERDROP = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_LOOTTRACKERDROPS, Loottrackerlink.LOOTTRACKERLINK, "FK_LOOTTRACKERDROP", Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID); + public static final ForeignKey FK_USER = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_USER, Loottrackerlink.LOOTTRACKERLINK, "FK_USER", Loottrackerlink.LOOTTRACKERLINK.USERUNIQUEID); } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/Public.java b/runelite-client/src/main/java/net/runelite/client/database/data/Public.java index 7120f8ad40..b560fe5538 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/Public.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/Public.java @@ -7,10 +7,11 @@ package net.runelite.client.database.data; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.tables.Loottrackerevents; import net.runelite.client.database.data.tables.Loottrackerlink; import net.runelite.client.database.data.tables.Loottrackerloot; +import net.runelite.client.database.data.tables.TmorphSets; import net.runelite.client.database.data.tables.User; import org.jooq.Catalog; import org.jooq.Table; @@ -23,7 +24,7 @@ import org.jooq.impl.SchemaImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -31,7 +32,7 @@ import org.jooq.impl.SchemaImpl; public class Public extends SchemaImpl { - private static final long serialVersionUID = 1499404561; + private static final long serialVersionUID = 1268129010; /** * The reference instance of PUBLIC @@ -53,6 +54,11 @@ public class Public extends SchemaImpl */ public final Loottrackerloot LOOTTRACKERLOOT = net.runelite.client.database.data.tables.Loottrackerloot.LOOTTRACKERLOOT; + /** + * The table PUBLIC.TMORPH_SETS. + */ + public final TmorphSets TMORPH_SETS = net.runelite.client.database.data.tables.TmorphSets.TMORPH_SETS; + /** * The table PUBLIC.USER. */ @@ -67,9 +73,6 @@ public class Public extends SchemaImpl } - /** - * {@inheritDoc} - */ @Override public Catalog getCatalog() { @@ -90,6 +93,7 @@ public class Public extends SchemaImpl Loottrackerevents.LOOTTRACKEREVENTS, Loottrackerlink.LOOTTRACKERLINK, Loottrackerloot.LOOTTRACKERLOOT, + TmorphSets.TMORPH_SETS, User.USER); } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/Tables.java b/runelite-client/src/main/java/net/runelite/client/database/data/Tables.java index f55ce70631..0b8ca41d45 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/Tables.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/Tables.java @@ -4,10 +4,11 @@ package net.runelite.client.database.data; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.tables.Loottrackerevents; import net.runelite.client.database.data.tables.Loottrackerlink; import net.runelite.client.database.data.tables.Loottrackerloot; +import net.runelite.client.database.data.tables.TmorphSets; import net.runelite.client.database.data.tables.User; @@ -17,7 +18,7 @@ import net.runelite.client.database.data.tables.User; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -28,20 +29,25 @@ public class Tables /** * The table PUBLIC.LOOTTRACKEREVENTS. */ - public static final Loottrackerevents LOOTTRACKEREVENTS = net.runelite.client.database.data.tables.Loottrackerevents.LOOTTRACKEREVENTS; + public static final Loottrackerevents LOOTTRACKEREVENTS = Loottrackerevents.LOOTTRACKEREVENTS; /** * The table PUBLIC.LOOTTRACKERLINK. */ - public static final Loottrackerlink LOOTTRACKERLINK = net.runelite.client.database.data.tables.Loottrackerlink.LOOTTRACKERLINK; + public static final Loottrackerlink LOOTTRACKERLINK = Loottrackerlink.LOOTTRACKERLINK; /** * The table PUBLIC.LOOTTRACKERLOOT. */ - public static final Loottrackerloot LOOTTRACKERLOOT = net.runelite.client.database.data.tables.Loottrackerloot.LOOTTRACKERLOOT; + public static final Loottrackerloot LOOTTRACKERLOOT = Loottrackerloot.LOOTTRACKERLOOT; + + /** + * The table PUBLIC.TMORPH_SETS. + */ + public static final TmorphSets TMORPH_SETS = TmorphSets.TMORPH_SETS; /** * The table PUBLIC.USER. */ - public static final User USER = net.runelite.client.database.data.tables.User.USER; + public static final User USER = User.USER; } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerevents.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerevents.java index d139de8d1f..5bceae62d6 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerevents.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerevents.java @@ -8,7 +8,7 @@ import java.sql.Timestamp; import java.util.Arrays; import java.util.List; import java.util.UUID; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.Indexes; import net.runelite.client.database.data.Keys; import net.runelite.client.database.data.Public; @@ -18,6 +18,7 @@ import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Row4; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -32,7 +33,7 @@ import org.jooq.impl.TableImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -40,7 +41,7 @@ import org.jooq.impl.TableImpl; public class Loottrackerevents extends TableImpl { - private static final long serialVersionUID = -824670812; + private static final long serialVersionUID = 1578403652; /** * The reference instance of PUBLIC.LOOTTRACKEREVENTS @@ -59,22 +60,22 @@ public class Loottrackerevents extends TableImpl /** * The column PUBLIC.LOOTTRACKEREVENTS.UNIQUEID. */ - public final TableField UNIQUEID = createField("UNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField UNIQUEID = createField(DSL.name("UNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKEREVENTS.EVENTID. */ - public final TableField EVENTID = createField("EVENTID", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, ""); + public final TableField EVENTID = createField(DSL.name("EVENTID"), org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKEREVENTS.TYPE. */ - public final TableField TYPE = createField("TYPE", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, ""); + public final TableField TYPE = createField(DSL.name("TYPE"), org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKEREVENTS.TIME. */ - public final TableField TIME = createField("TIME", org.jooq.impl.SQLDataType.TIMESTAMP.precision(6).nullable(false), this, ""); + public final TableField TIME = createField(DSL.name("TIME"), org.jooq.impl.SQLDataType.TIMESTAMP.precision(6).nullable(false), this, ""); /** * Create a PUBLIC.LOOTTRACKEREVENTS table reference @@ -115,54 +116,36 @@ public class Loottrackerevents extends TableImpl super(child, key, LOOTTRACKEREVENTS); } - /** - * {@inheritDoc} - */ @Override public Schema getSchema() { return Public.PUBLIC; } - /** - * {@inheritDoc} - */ @Override public List getIndexes() { return Arrays.asList(Indexes.PRIMARY_KEY_B); } - /** - * {@inheritDoc} - */ @Override public UniqueKey getPrimaryKey() { - return Keys.PK_EVENTUNIQUEID; + return Keys.PK_LOOTTRACKEREVENTS; } - /** - * {@inheritDoc} - */ @Override public List> getKeys() { - return Arrays.>asList(Keys.PK_EVENTUNIQUEID); + return Arrays.>asList(Keys.PK_LOOTTRACKEREVENTS); } - /** - * {@inheritDoc} - */ @Override public Loottrackerevents as(String alias) { return new Loottrackerevents(DSL.name(alias), this); } - /** - * {@inheritDoc} - */ @Override public Loottrackerevents as(Name alias) { @@ -186,4 +169,14 @@ public class Loottrackerevents extends TableImpl { return new Loottrackerevents(name, null); } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() + { + return (Row4) super.fieldsRow(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerlink.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerlink.java index c720d8e5f5..f800608007 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerlink.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerlink.java @@ -7,7 +7,7 @@ package net.runelite.client.database.data.tables; import java.util.Arrays; import java.util.List; import java.util.UUID; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.Indexes; import net.runelite.client.database.data.Keys; import net.runelite.client.database.data.Public; @@ -17,10 +17,10 @@ import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Row4; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; -import org.jooq.UniqueKey; import org.jooq.impl.DSL; import org.jooq.impl.TableImpl; @@ -31,7 +31,7 @@ import org.jooq.impl.TableImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -39,7 +39,7 @@ import org.jooq.impl.TableImpl; public class Loottrackerlink extends TableImpl { - private static final long serialVersionUID = 1145289106; + private static final long serialVersionUID = -1694278583; /** * The reference instance of PUBLIC.LOOTTRACKERLINK @@ -58,22 +58,22 @@ public class Loottrackerlink extends TableImpl /** * The column PUBLIC.LOOTTRACKERLINK.LINKUNIQUEID. */ - public final TableField LINKUNIQUEID = createField("LINKUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField LINKUNIQUEID = createField(DSL.name("LINKUNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKERLINK.EVENTUNIQUEID. */ - public final TableField EVENTUNIQUEID = createField("EVENTUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField EVENTUNIQUEID = createField(DSL.name("EVENTUNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKERLINK.DROPUNIQUEID. */ - public final TableField DROPUNIQUEID = createField("DROPUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField DROPUNIQUEID = createField(DSL.name("DROPUNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKERLINK.USERUNIQUEID. */ - public final TableField USERUNIQUEID = createField("USERUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField USERUNIQUEID = createField(DSL.name("USERUNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * Create a PUBLIC.LOOTTRACKERLINK table reference @@ -114,49 +114,22 @@ public class Loottrackerlink extends TableImpl super(child, key, LOOTTRACKERLINK); } - /** - * {@inheritDoc} - */ @Override public Schema getSchema() { return Public.PUBLIC; } - /** - * {@inheritDoc} - */ @Override public List getIndexes() { - return Arrays.asList(Indexes.FK_LOOTTRACKEREVENT_INDEX_6, Indexes.FK_LOOTTRACKERLOOT_INDEX_6, Indexes.PRIMARY_KEY_6B); + return Arrays.asList(Indexes.FK_LOOTTRACKERDROP_INDEX_6, Indexes.FK_LOOTTRACKEREVENT_INDEX_6, Indexes.FK_USER_INDEX_6); } - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() - { - return Keys.PK_LOOTTRACKERLINK; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() - { - return Arrays.>asList(Keys.PK_LOOTTRACKERLINK); - } - - /** - * {@inheritDoc} - */ @Override public List> getReferences() { - return Arrays.>asList(Keys.FK_LOOTTRACKEREVENT, Keys.FK_LOOTTRACKERLOOT, Keys.FK_USER); + return Arrays.>asList(Keys.FK_LOOTTRACKEREVENT, Keys.FK_LOOTTRACKERDROP, Keys.FK_USER); } public Loottrackerevents loottrackerevents() @@ -166,7 +139,7 @@ public class Loottrackerlink extends TableImpl public Loottrackerloot loottrackerloot() { - return new Loottrackerloot(this, Keys.FK_LOOTTRACKERLOOT); + return new Loottrackerloot(this, Keys.FK_LOOTTRACKERDROP); } public User user() @@ -174,18 +147,12 @@ public class Loottrackerlink extends TableImpl return new User(this, Keys.FK_USER); } - /** - * {@inheritDoc} - */ @Override public Loottrackerlink as(String alias) { return new Loottrackerlink(DSL.name(alias), this); } - /** - * {@inheritDoc} - */ @Override public Loottrackerlink as(Name alias) { @@ -209,4 +176,14 @@ public class Loottrackerlink extends TableImpl { return new Loottrackerlink(name, null); } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() + { + return (Row4) super.fieldsRow(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerloot.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerloot.java index 6ea79852d8..a9d6b574a3 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerloot.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/Loottrackerloot.java @@ -7,7 +7,7 @@ package net.runelite.client.database.data.tables; import java.util.Arrays; import java.util.List; import java.util.UUID; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.Indexes; import net.runelite.client.database.data.Keys; import net.runelite.client.database.data.Public; @@ -17,6 +17,7 @@ import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Row3; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -31,7 +32,7 @@ import org.jooq.impl.TableImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -39,7 +40,7 @@ import org.jooq.impl.TableImpl; public class Loottrackerloot extends TableImpl { - private static final long serialVersionUID = 1952959378; + private static final long serialVersionUID = 1461948279; /** * The reference instance of PUBLIC.LOOTTRACKERLOOT @@ -58,17 +59,17 @@ public class Loottrackerloot extends TableImpl /** * The column PUBLIC.LOOTTRACKERLOOT.UNIQUEID. */ - public final TableField UNIQUEID = createField("UNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField UNIQUEID = createField(DSL.name("UNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKERLOOT.ITEMID. */ - public final TableField ITEMID = createField("ITEMID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField ITEMID = createField(DSL.name("ITEMID"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); /** * The column PUBLIC.LOOTTRACKERLOOT.QUANTITY. */ - public final TableField QUANTITY = createField("QUANTITY", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField QUANTITY = createField(DSL.name("QUANTITY"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); /** * Create a PUBLIC.LOOTTRACKERLOOT table reference @@ -109,54 +110,36 @@ public class Loottrackerloot extends TableImpl super(child, key, LOOTTRACKERLOOT); } - /** - * {@inheritDoc} - */ @Override public Schema getSchema() { return Public.PUBLIC; } - /** - * {@inheritDoc} - */ @Override public List getIndexes() { return Arrays.asList(Indexes.PRIMARY_KEY_6); } - /** - * {@inheritDoc} - */ @Override public UniqueKey getPrimaryKey() { - return Keys.PK_LOOTUNIQUEID; + return Keys.PK_LOOTTRACKERDROPS; } - /** - * {@inheritDoc} - */ @Override public List> getKeys() { - return Arrays.>asList(Keys.PK_LOOTUNIQUEID); + return Arrays.>asList(Keys.PK_LOOTTRACKERDROPS); } - /** - * {@inheritDoc} - */ @Override public Loottrackerloot as(String alias) { return new Loottrackerloot(DSL.name(alias), this); } - /** - * {@inheritDoc} - */ @Override public Loottrackerloot as(Name alias) { @@ -180,4 +163,14 @@ public class Loottrackerloot extends TableImpl { return new Loottrackerloot(name, null); } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() + { + return (Row3) super.fieldsRow(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/TmorphSets.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/TmorphSets.java new file mode 100644 index 0000000000..fcc76b8504 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/TmorphSets.java @@ -0,0 +1,196 @@ +/* + * This file is generated by jOOQ. + */ +package net.runelite.client.database.data.tables; + + +import java.util.Arrays; +import java.util.List; +import javax.annotation.processing.Generated; +import net.runelite.client.database.data.Indexes; +import net.runelite.client.database.data.Public; +import net.runelite.client.database.data.tables.records.TmorphSetsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row10; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.3" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class TmorphSets extends TableImpl +{ + + private static final long serialVersionUID = -2027086786; + + /** + * The reference instance of PUBLIC.TMORPH_SETS + */ + public static final TmorphSets TMORPH_SETS = new TmorphSets(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() + { + return TmorphSetsRecord.class; + } + + /** + * The column PUBLIC.TMORPH_SETS.SET_NAME. + */ + public final TableField SET_NAME = createField(DSL.name("SET_NAME"), org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.HELMET. + */ + public final TableField HELMET = createField(DSL.name("HELMET"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.CAPE. + */ + public final TableField CAPE = createField(DSL.name("CAPE"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.AMULET. + */ + public final TableField AMULET = createField(DSL.name("AMULET"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.WEAPON. + */ + public final TableField WEAPON = createField(DSL.name("WEAPON"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.TORSO. + */ + public final TableField TORSO = createField(DSL.name("TORSO"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.SHIELD. + */ + public final TableField SHIELD = createField(DSL.name("SHIELD"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.LEGS. + */ + public final TableField LEGS = createField(DSL.name("LEGS"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.HANDS. + */ + public final TableField HANDS = createField(DSL.name("HANDS"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.TMORPH_SETS.BOOTS. + */ + public final TableField BOOTS = createField(DSL.name("BOOTS"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a PUBLIC.TMORPH_SETS table reference + */ + public TmorphSets() + { + this(DSL.name("TMORPH_SETS"), null); + } + + /** + * Create an aliased PUBLIC.TMORPH_SETS table reference + */ + public TmorphSets(String alias) + { + this(DSL.name(alias), TMORPH_SETS); + } + + /** + * Create an aliased PUBLIC.TMORPH_SETS table reference + */ + public TmorphSets(Name alias) + { + this(alias, TMORPH_SETS); + } + + private TmorphSets(Name alias, Table aliased) + { + this(alias, aliased, null); + } + + private TmorphSets(Name alias, Table aliased, Field[] parameters) + { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TmorphSets(Table child, ForeignKey key) + { + super(child, key, TMORPH_SETS); + } + + @Override + public Schema getSchema() + { + return Public.PUBLIC; + } + + @Override + public List getIndexes() + { + return Arrays.asList(Indexes.TMORPH_SETS_SET_NAME_UINDEX); + } + + @Override + public TmorphSets as(String alias) + { + return new TmorphSets(DSL.name(alias), this); + } + + @Override + public TmorphSets as(Name alias) + { + return new TmorphSets(alias, this); + } + + /** + * Rename this table + */ + @Override + public TmorphSets rename(String name) + { + return new TmorphSets(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TmorphSets rename(Name name) + { + return new TmorphSets(name, null); + } + + // ------------------------------------------------------------------------- + // Row10 type methods + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() + { + return (Row10) super.fieldsRow(); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/User.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/User.java index b9295a486d..15588c223d 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/tables/User.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/User.java @@ -7,7 +7,7 @@ package net.runelite.client.database.data.tables; import java.util.Arrays; import java.util.List; import java.util.UUID; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.Indexes; import net.runelite.client.database.data.Keys; import net.runelite.client.database.data.Public; @@ -17,6 +17,7 @@ import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Row2; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -31,7 +32,7 @@ import org.jooq.impl.TableImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -39,7 +40,7 @@ import org.jooq.impl.TableImpl; public class User extends TableImpl { - private static final long serialVersionUID = 270848699; + private static final long serialVersionUID = -668009102; /** * The reference instance of PUBLIC.USER @@ -58,12 +59,12 @@ public class User extends TableImpl /** * The column PUBLIC.USER.UNIQUEID. */ - public final TableField UNIQUEID = createField("UNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); + public final TableField UNIQUEID = createField(DSL.name("UNIQUEID"), org.jooq.impl.SQLDataType.UUID.nullable(false), this, ""); /** * The column PUBLIC.USER.USERNAME. */ - public final TableField USERNAME = createField("USERNAME", org.jooq.impl.SQLDataType.VARCHAR(12).nullable(false), this, ""); + public final TableField USERNAME = createField(DSL.name("USERNAME"), org.jooq.impl.SQLDataType.VARCHAR(12).nullable(false), this, ""); /** * Create a PUBLIC.USER table reference @@ -104,54 +105,36 @@ public class User extends TableImpl super(child, key, USER); } - /** - * {@inheritDoc} - */ @Override public Schema getSchema() { return Public.PUBLIC; } - /** - * {@inheritDoc} - */ @Override public List getIndexes() { - return Arrays.asList(Indexes.PRIMARY_KEY_2); + return Arrays.asList(Indexes.PRIMARY_KEY_2, Indexes.UN_USERNAME_INDEX_2); } - /** - * {@inheritDoc} - */ @Override public UniqueKey getPrimaryKey() { return Keys.PK_USER; } - /** - * {@inheritDoc} - */ @Override public List> getKeys() { - return Arrays.>asList(Keys.PK_USER); + return Arrays.>asList(Keys.PK_USER, Keys.UN_USERNAME); } - /** - * {@inheritDoc} - */ @Override public User as(String alias) { return new User(DSL.name(alias), this); } - /** - * {@inheritDoc} - */ @Override public User as(Name alias) { @@ -175,4 +158,14 @@ public class User extends TableImpl { return new User(name, null); } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() + { + return (Row2) super.fieldsRow(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/LoottrackereventsRecord.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/LoottrackereventsRecord.java index 9bd71f4468..00f0095252 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/LoottrackereventsRecord.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/LoottrackereventsRecord.java @@ -6,7 +6,7 @@ package net.runelite.client.database.data.tables.records; import java.sql.Timestamp; import java.util.UUID; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.tables.Loottrackerevents; import org.jooq.Field; import org.jooq.Record1; @@ -21,7 +21,7 @@ import org.jooq.impl.UpdatableRecordImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -29,7 +29,7 @@ import org.jooq.impl.UpdatableRecordImpl; public class LoottrackereventsRecord extends UpdatableRecordImpl implements Record4 { - private static final long serialVersionUID = -1505143967; + private static final long serialVersionUID = -1418522415; /** * Setter for PUBLIC.LOOTTRACKEREVENTS.UNIQUEID. @@ -99,9 +99,6 @@ public class LoottrackereventsRecord extends UpdatableRecordImpl key() { @@ -112,135 +109,90 @@ public class LoottrackereventsRecord extends UpdatableRecordImpl fieldsRow() { return (Row4) super.fieldsRow(); } - /** - * {@inheritDoc} - */ @Override public Row4 valuesRow() { return (Row4) super.valuesRow(); } - /** - * {@inheritDoc} - */ @Override public Field field1() { return Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID; } - /** - * {@inheritDoc} - */ @Override public Field field2() { return Loottrackerevents.LOOTTRACKEREVENTS.EVENTID; } - /** - * {@inheritDoc} - */ @Override public Field field3() { return Loottrackerevents.LOOTTRACKEREVENTS.TYPE; } - /** - * {@inheritDoc} - */ @Override public Field field4() { return Loottrackerevents.LOOTTRACKEREVENTS.TIME; } - /** - * {@inheritDoc} - */ @Override public UUID component1() { return getUniqueid(); } - /** - * {@inheritDoc} - */ @Override public String component2() { return getEventid(); } - /** - * {@inheritDoc} - */ @Override public String component3() { return getType(); } - /** - * {@inheritDoc} - */ @Override public Timestamp component4() { return getTime(); } - /** - * {@inheritDoc} - */ @Override public UUID value1() { return getUniqueid(); } - /** - * {@inheritDoc} - */ @Override public String value2() { return getEventid(); } - /** - * {@inheritDoc} - */ @Override public String value3() { return getType(); } - /** - * {@inheritDoc} - */ @Override public Timestamp value4() { return getTime(); } - /** - * {@inheritDoc} - */ @Override public LoottrackereventsRecord value1(UUID value) { @@ -248,9 +200,6 @@ public class LoottrackereventsRecord extends UpdatableRecordImpl implements Record4 +public class LoottrackerlinkRecord extends TableRecordImpl implements Record4 { - private static final long serialVersionUID = 1985117517; + private static final long serialVersionUID = -1701074584; /** * Setter for PUBLIC.LOOTTRACKERLINK.LINKUNIQUEID. @@ -94,152 +93,94 @@ public class LoottrackerlinkRecord extends UpdatableRecordImpl key() - { - return (Record1) super.key(); - } - // ------------------------------------------------------------------------- // Record4 type implementation // ------------------------------------------------------------------------- - /** - * {@inheritDoc} - */ @Override public Row4 fieldsRow() { return (Row4) super.fieldsRow(); } - /** - * {@inheritDoc} - */ @Override public Row4 valuesRow() { return (Row4) super.valuesRow(); } - /** - * {@inheritDoc} - */ @Override public Field field1() { return Loottrackerlink.LOOTTRACKERLINK.LINKUNIQUEID; } - /** - * {@inheritDoc} - */ @Override public Field field2() { return Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID; } - /** - * {@inheritDoc} - */ @Override public Field field3() { return Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID; } - /** - * {@inheritDoc} - */ @Override public Field field4() { return Loottrackerlink.LOOTTRACKERLINK.USERUNIQUEID; } - /** - * {@inheritDoc} - */ @Override public UUID component1() { return getLinkuniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID component2() { return getEventuniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID component3() { return getDropuniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID component4() { return getUseruniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID value1() { return getLinkuniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID value2() { return getEventuniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID value3() { return getDropuniqueid(); } - /** - * {@inheritDoc} - */ @Override public UUID value4() { return getUseruniqueid(); } - /** - * {@inheritDoc} - */ @Override public LoottrackerlinkRecord value1(UUID value) { @@ -247,9 +188,6 @@ public class LoottrackerlinkRecord extends UpdatableRecordImpl implements Record3 { - private static final long serialVersionUID = -1894768090; + private static final long serialVersionUID = 693470968; /** * Setter for PUBLIC.LOOTTRACKERLOOT.UNIQUEID. @@ -82,9 +82,6 @@ public class LoottrackerlootRecord extends UpdatableRecordImpl key() { @@ -95,108 +92,72 @@ public class LoottrackerlootRecord extends UpdatableRecordImpl fieldsRow() { return (Row3) super.fieldsRow(); } - /** - * {@inheritDoc} - */ @Override public Row3 valuesRow() { return (Row3) super.valuesRow(); } - /** - * {@inheritDoc} - */ @Override public Field field1() { return Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID; } - /** - * {@inheritDoc} - */ @Override public Field field2() { return Loottrackerloot.LOOTTRACKERLOOT.ITEMID; } - /** - * {@inheritDoc} - */ @Override public Field field3() { return Loottrackerloot.LOOTTRACKERLOOT.QUANTITY; } - /** - * {@inheritDoc} - */ @Override public UUID component1() { return getUniqueid(); } - /** - * {@inheritDoc} - */ @Override public Integer component2() { return getItemid(); } - /** - * {@inheritDoc} - */ @Override public Integer component3() { return getQuantity(); } - /** - * {@inheritDoc} - */ @Override public UUID value1() { return getUniqueid(); } - /** - * {@inheritDoc} - */ @Override public Integer value2() { return getItemid(); } - /** - * {@inheritDoc} - */ @Override public Integer value3() { return getQuantity(); } - /** - * {@inheritDoc} - */ @Override public LoottrackerlootRecord value1(UUID value) { @@ -204,9 +165,6 @@ public class LoottrackerlootRecord extends UpdatableRecordImpl implements Record10 +{ + + private static final long serialVersionUID = 546214401; + + /** + * Setter for PUBLIC.TMORPH_SETS.SET_NAME. + */ + public void setSetName(String value) + { + set(0, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.SET_NAME. + */ + public String getSetName() + { + return (String) get(0); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.HELMET. + */ + public void setHelmet(Integer value) + { + set(1, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.HELMET. + */ + public Integer getHelmet() + { + return (Integer) get(1); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.CAPE. + */ + public void setCape(Integer value) + { + set(2, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.CAPE. + */ + public Integer getCape() + { + return (Integer) get(2); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.AMULET. + */ + public void setAmulet(Integer value) + { + set(3, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.AMULET. + */ + public Integer getAmulet() + { + return (Integer) get(3); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.WEAPON. + */ + public void setWeapon(Integer value) + { + set(4, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.WEAPON. + */ + public Integer getWeapon() + { + return (Integer) get(4); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.TORSO. + */ + public void setTorso(Integer value) + { + set(5, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.TORSO. + */ + public Integer getTorso() + { + return (Integer) get(5); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.SHIELD. + */ + public void setShield(Integer value) + { + set(6, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.SHIELD. + */ + public Integer getShield() + { + return (Integer) get(6); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.LEGS. + */ + public void setLegs(Integer value) + { + set(7, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.LEGS. + */ + public Integer getLegs() + { + return (Integer) get(7); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.HANDS. + */ + public void setHands(Integer value) + { + set(8, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.HANDS. + */ + public Integer getHands() + { + return (Integer) get(8); + } + + /** + * Setter for PUBLIC.TMORPH_SETS.BOOTS. + */ + public void setBoots(Integer value) + { + set(9, value); + } + + /** + * Getter for PUBLIC.TMORPH_SETS.BOOTS. + */ + public Integer getBoots() + { + return (Integer) get(9); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() + { + return (Row10) super.fieldsRow(); + } + + @Override + public Row10 valuesRow() + { + return (Row10) super.valuesRow(); + } + + @Override + public Field field1() + { + return TmorphSets.TMORPH_SETS.SET_NAME; + } + + @Override + public Field field2() + { + return TmorphSets.TMORPH_SETS.HELMET; + } + + @Override + public Field field3() + { + return TmorphSets.TMORPH_SETS.CAPE; + } + + @Override + public Field field4() + { + return TmorphSets.TMORPH_SETS.AMULET; + } + + @Override + public Field field5() + { + return TmorphSets.TMORPH_SETS.WEAPON; + } + + @Override + public Field field6() + { + return TmorphSets.TMORPH_SETS.TORSO; + } + + @Override + public Field field7() + { + return TmorphSets.TMORPH_SETS.SHIELD; + } + + @Override + public Field field8() + { + return TmorphSets.TMORPH_SETS.LEGS; + } + + @Override + public Field field9() + { + return TmorphSets.TMORPH_SETS.HANDS; + } + + @Override + public Field field10() + { + return TmorphSets.TMORPH_SETS.BOOTS; + } + + @Override + public String component1() + { + return getSetName(); + } + + @Override + public Integer component2() + { + return getHelmet(); + } + + @Override + public Integer component3() + { + return getCape(); + } + + @Override + public Integer component4() + { + return getAmulet(); + } + + @Override + public Integer component5() + { + return getWeapon(); + } + + @Override + public Integer component6() + { + return getTorso(); + } + + @Override + public Integer component7() + { + return getShield(); + } + + @Override + public Integer component8() + { + return getLegs(); + } + + @Override + public Integer component9() + { + return getHands(); + } + + @Override + public Integer component10() + { + return getBoots(); + } + + @Override + public String value1() + { + return getSetName(); + } + + @Override + public Integer value2() + { + return getHelmet(); + } + + @Override + public Integer value3() + { + return getCape(); + } + + @Override + public Integer value4() + { + return getAmulet(); + } + + @Override + public Integer value5() + { + return getWeapon(); + } + + @Override + public Integer value6() + { + return getTorso(); + } + + @Override + public Integer value7() + { + return getShield(); + } + + @Override + public Integer value8() + { + return getLegs(); + } + + @Override + public Integer value9() + { + return getHands(); + } + + @Override + public Integer value10() + { + return getBoots(); + } + + @Override + public TmorphSetsRecord value1(String value) + { + setSetName(value); + return this; + } + + @Override + public TmorphSetsRecord value2(Integer value) + { + setHelmet(value); + return this; + } + + @Override + public TmorphSetsRecord value3(Integer value) + { + setCape(value); + return this; + } + + @Override + public TmorphSetsRecord value4(Integer value) + { + setAmulet(value); + return this; + } + + @Override + public TmorphSetsRecord value5(Integer value) + { + setWeapon(value); + return this; + } + + @Override + public TmorphSetsRecord value6(Integer value) + { + setTorso(value); + return this; + } + + @Override + public TmorphSetsRecord value7(Integer value) + { + setShield(value); + return this; + } + + @Override + public TmorphSetsRecord value8(Integer value) + { + setLegs(value); + return this; + } + + @Override + public TmorphSetsRecord value9(Integer value) + { + setHands(value); + return this; + } + + @Override + public TmorphSetsRecord value10(Integer value) + { + setBoots(value); + return this; + } + + @Override + public TmorphSetsRecord values(String value1, Integer value2, Integer value3, Integer value4, Integer value5, Integer value6, Integer value7, Integer value8, Integer value9, Integer value10) + { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TmorphSetsRecord + */ + public TmorphSetsRecord() + { + super(TmorphSets.TMORPH_SETS); + } + + /** + * Create a detached, initialised TmorphSetsRecord + */ + public TmorphSetsRecord(String setName, Integer helmet, Integer cape, Integer amulet, Integer weapon, Integer torso, Integer shield, Integer legs, Integer hands, Integer boots) + { + super(TmorphSets.TMORPH_SETS); + + set(0, setName); + set(1, helmet); + set(2, cape); + set(3, amulet); + set(4, weapon); + set(5, torso); + set(6, shield); + set(7, legs); + set(8, hands); + set(9, boots); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/UserRecord.java b/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/UserRecord.java index b57e450a8e..2aeec56d34 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/UserRecord.java +++ b/runelite-client/src/main/java/net/runelite/client/database/data/tables/records/UserRecord.java @@ -5,7 +5,7 @@ package net.runelite.client.database.data.tables.records; import java.util.UUID; -import javax.annotation.Generated; +import javax.annotation.processing.Generated; import net.runelite.client.database.data.tables.User; import org.jooq.Field; import org.jooq.Record1; @@ -20,7 +20,7 @@ import org.jooq.impl.UpdatableRecordImpl; @Generated( value = { "http://www.jooq.org", - "jOOQ version:3.11.12" + "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @@ -28,7 +28,7 @@ import org.jooq.impl.UpdatableRecordImpl; public class UserRecord extends UpdatableRecordImpl implements Record2 { - private static final long serialVersionUID = 628808107; + private static final long serialVersionUID = 2077804101; /** * Setter for PUBLIC.USER.UNIQUEID. @@ -66,9 +66,6 @@ public class UserRecord extends UpdatableRecordImpl implements Recor // Primary key information // ------------------------------------------------------------------------- - /** - * {@inheritDoc} - */ @Override public Record1 key() { @@ -79,81 +76,54 @@ public class UserRecord extends UpdatableRecordImpl implements Recor // Record2 type implementation // ------------------------------------------------------------------------- - /** - * {@inheritDoc} - */ @Override public Row2 fieldsRow() { return (Row2) super.fieldsRow(); } - /** - * {@inheritDoc} - */ @Override public Row2 valuesRow() { return (Row2) super.valuesRow(); } - /** - * {@inheritDoc} - */ @Override public Field field1() { return User.USER.UNIQUEID; } - /** - * {@inheritDoc} - */ @Override public Field field2() { return User.USER.USERNAME; } - /** - * {@inheritDoc} - */ @Override public UUID component1() { return getUniqueid(); } - /** - * {@inheritDoc} - */ @Override public String component2() { return getUsername(); } - /** - * {@inheritDoc} - */ @Override public UUID value1() { return getUniqueid(); } - /** - * {@inheritDoc} - */ @Override public String value2() { return getUsername(); } - /** - * {@inheritDoc} - */ @Override public UserRecord value1(UUID value) { @@ -161,9 +131,6 @@ public class UserRecord extends UpdatableRecordImpl implements Recor return this; } - /** - * {@inheritDoc} - */ @Override public UserRecord value2(String value) { @@ -171,9 +138,6 @@ public class UserRecord extends UpdatableRecordImpl implements Recor return this; } - /** - * {@inheritDoc} - */ @Override public UserRecord values(UUID value1, String value2) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java deleted file mode 100644 index fa4ba34ec8..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.runelite.client.plugins.tmorph; - -import java.util.Arrays; -import java.util.Map; -import javax.inject.Singleton; - -@Singleton -public class Parse -{ - public static boolean parse(String value) - { - try - { - final StringBuilder sb = new StringBuilder(); - - for (String str : value.split("\n")) - { - if (!str.startsWith("//")) - { - sb.append(str).append("\n"); - } - } - final Map tmp = TMorph.getNEWLINE_SPLITTER().withKeyValueSeparator(':').split(sb); - - for (Map.Entry entry : tmp.entrySet()) - { - if (!TMorph.getKit().containsKey(entry.getValue())) - { - return false; - } - - final int[] ints = Arrays.stream(entry.getKey().split(",")).map(String::trim).mapToInt(Integer::parseInt).toArray(); - - if (ints.length <= 1) - { - return false; - } - } - - return true; - } - catch (Exception ex) - { - return false; - } - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java index 6398a84b30..4aa3755c33 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java @@ -27,32 +27,38 @@ import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; import com.google.inject.Provides; import java.awt.Color; +import java.awt.image.BufferedImage; import java.util.Arrays; +import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import lombok.AccessLevel; import lombok.Getter; +import lombok.Setter; import net.runelite.api.Actor; -import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.Player; import net.runelite.api.events.AnimationChanged; -import net.runelite.api.events.CommandExecuted; +import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.SpotAnimationChanged; import net.runelite.api.kit.KitType; import net.runelite.api.widgets.WidgetInfo; +import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.ConfigChanged; +import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginType; -import net.runelite.client.util.Clipboard; -import net.runelite.client.util.ColorUtil; +import net.runelite.client.plugins.tmorph.ui.TPanel; +import net.runelite.client.ui.ClientToolbar; +import net.runelite.client.ui.NavigationButton; +import net.runelite.client.util.ImageUtil; import org.apache.commons.lang3.ObjectUtils; @PluginDescriptor( @@ -79,7 +85,7 @@ public class TMorph extends Plugin kit = builder.build(); } - @Getter(AccessLevel.PACKAGE) + @Getter(AccessLevel.PUBLIC) private static final Splitter NEWLINE_SPLITTER = Splitter .on("\n") .omitEmptyStrings() @@ -94,15 +100,26 @@ public class TMorph extends Plugin @Inject private EventBus eventBus; - private Map set1; - private Map set2; - private Map set3; + @Inject + private ClientToolbar clientToolbar; + + @Inject + private ClientThread clientThread; + + @Inject + private ItemManager itemManager; + + + private TPanel panel; + private NavigationButton navButton; private int animation; private int globalAnimSwap; private int globalGraphicSwap; private int graphic; private int targetAnimation; private int targetGraphic; + @Setter + private Map panelMorph = new HashMap<>(); @Provides TMorphConfig provideConfig(ConfigManager configManager) @@ -113,8 +130,20 @@ public class TMorph extends Plugin @Override protected void startUp() { + final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "nav.png"); + + panel = injector.getInstance(TPanel.class); + + navButton = NavigationButton.builder() + .tooltip("TMorph") + .icon(icon) + .priority(100) + .panel(panel) + .build(); + + clientToolbar.addNavigation(navButton); + updateConfig(); - addSubscriptions(); } @Override @@ -123,72 +152,20 @@ public class TMorph extends Plugin eventBus.unregister(this); } - private void addSubscriptions() + @Subscribe + public void onGameStateChanged(GameStateChanged event) { - eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged); - eventBus.subscribe(GameTick.class, this, this::onGameTick); - eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged); - eventBus.subscribe(CommandExecuted.class, this, this::onCommandExecuted); - } - - private void onCommandExecuted(CommandExecuted event) - { - final String[] args = event.getArguments(); - - if (event.getCommand().equals("tmorph")) + if (event.getGameState() == GameState.LOGIN_SCREEN) { - try + clientThread.invokeLater(() -> { - if (args[0].equals("copy")) - { - final StringBuilder sb = new StringBuilder(); - final Player player = client.getLocalPlayer(); - - if (player == null - || player.getPlayerAppearance() == null - || client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null - || client.getViewportWidget() == null) - { - return; - } - - for (KitType kitType : KitType.values()) - { - if (kitType.equals(KitType.RING) || kitType.equals(KitType.AMMUNITION)) - { - continue; - } - - final int id = player.getPlayerAppearance().getEquipmentId(kitType); - - if (id == -1) - { - continue; - } - - sb.append(id); - sb.append(",-1"); - sb.append(":"); - sb.append(kitType.getName()); - sb.append("\n"); - } - client.addChatMessage(ChatMessageType.GAMEMESSAGE, "TMorph", ColorUtil.prependColorTag("Your current gear has been copied to your clipboard", COLOR), null); - Clipboard.store(sb.toString()); - } - else - { - client.addChatMessage(ChatMessageType.GAMEMESSAGE, "TMorph", ColorUtil.prependColorTag("Invalid syntax, do ::tmorph copy", Color.RED), null); - } - } - catch (Exception e) - { - client.addChatMessage(ChatMessageType.GAMEMESSAGE, "TMorph", ColorUtil.prependColorTag("Invalid syntax, do ::tmorph copy", Color.RED), null); - } + panel.populateSlots(); + }); } } @Subscribe - private void onConfigChanged(ConfigChanged event) + public void onConfigChanged(ConfigChanged event) { if (event.getGroup().equals("TMorph")) { @@ -196,7 +173,8 @@ public class TMorph extends Plugin } } - private void onSpotAnimationChanged(SpotAnimationChanged event) + @Subscribe + public void onSpotAnimationChanged(SpotAnimationChanged event) { final Actor actor = event.getActor(); @@ -218,7 +196,8 @@ public class TMorph extends Plugin } } - private void onAnimationChanged(AnimationChanged event) + @Subscribe + public void onAnimationChanged(AnimationChanged event) { final Actor actor = event.getActor(); @@ -240,7 +219,8 @@ public class TMorph extends Plugin } } - private void onGameTick(GameTick event) + @Subscribe + public void onGameTick(GameTick event) { if (client.getGameState() != GameState.LOGGED_IN) { @@ -257,12 +237,10 @@ public class TMorph extends Plugin return; } - updateGear(set1, player); - updateGear(set2, player); - updateGear(set3, player); + updateGear(panelMorph, player); } - private void updateGear(Map map, Player player) + public void updateGear(Map map, Player player) { if (map == null || map.isEmpty()) { @@ -308,9 +286,6 @@ public class TMorph extends Plugin private void updateConfig() { - this.set1 = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config.set1()); - this.set2 = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config.set2()); - this.set3 = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config.set3()); this.animation = config.animationSwap(); this.globalAnimSwap = config.globalAnimSwap(); this.globalGraphicSwap = config.globalGraphicSwap(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java index 404fadf453..c7b9c63e52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java @@ -27,76 +27,10 @@ import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; import net.runelite.client.config.ConfigSection; -import net.runelite.client.config.ConfigTitleSection; -import net.runelite.client.config.Title; @ConfigGroup("TMorph") public interface TMorphConfig extends Config { - @ConfigTitleSection( - keyName = "swaps", - name = "Morphers", - description = "", - position = 1 - ) - default Title swaps() - { - return new Title(); - } - - @ConfigItem( - keyName = "mageSwap", - name = "Swap Set 1", - description = "
Proper Format is id,id:Slot" + - "
For example: 6570,21295:Cape" + - "
Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
", - titleSection = "swaps", - position = 1, - parse = true, - clazz = Parse.class, - method = "parse" - ) - default String set1() - { - return ""; - } - - @ConfigItem( - keyName = "rangeSwap", - name = "Swap Set 2", - description = "
Proper Format is id,id:Slot" + - "
For example: 6570,21295:Cape" + - "
Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
", - titleSection = "swaps", - position = 2, - parse = true, - clazz = Parse.class, - method = "parse" - ) - default String set2() - { - return ""; - } - - @ConfigItem( - keyName = "meleeSwap", - name = "Swap Set 3", - description = "
Proper Format is id,id:Slot" + - "
For example: 6570,21295:Cape" + - "
Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
", - titleSection = "swaps", - position = 3, - parse = true, - clazz = Parse.class, - method = "parse" - ) - default String set3() - { - return ""; - } - - //////////////////Experimental Functions - @ConfigSection( position = 4, keyName = "experimentalSection", @@ -203,18 +137,4 @@ public interface TMorphConfig extends Config { return 0; } - - @ConfigTitleSection( - keyName = "copy", - name = "
If you would like to copy your equipped" + - "
gear, type \"::tmorph copy\" in chat." + - "
This will copy your gear to your" + - "
clipboard for easy copy paste.
", - description = "", - position = 50 - ) - default Title copy() - { - return new Title(); - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TmorphSet.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TmorphSet.java new file mode 100644 index 0000000000..d4514c336b --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TmorphSet.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019, ganom + * 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.tmorph; + +import lombok.Data; + +@Data +public class TmorphSet +{ + private String name; + private int helmet; + private int cape; + private int amulet; + private int weapon; + private int torso; + private int shield; + private int legs; + private int hands; + private int boots; +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java new file mode 100644 index 0000000000..fd66f287e0 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2019, ganom + * 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.tmorph.ui; + +import java.awt.Component; +import java.awt.Dimension; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.swing.ImageIcon; +import javax.swing.JComboBox; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.kit.KitType; +import net.runelite.client.game.ItemManager; +import net.runelite.client.plugins.tmorph.TMorph; +import net.runelite.client.ui.ColorScheme; +import net.runelite.client.ui.components.ComboBoxIconEntry; +import net.runelite.client.ui.components.ComboBoxListRenderer; +import net.runelite.client.util.AsyncBufferedImage; +import net.runelite.client.util.ImageUtil; +import net.runelite.http.api.item.ItemEquipmentStats; +import net.runelite.http.api.item.ItemStats; +import org.pushingpixels.substance.internal.utils.SubstanceDropDownButton; + +@Getter +public class EquipSlot extends JComboBox +{ + private final ComboBoxIconEntry original; + private Map boxMap; + private KitType kitType; + + EquipSlot(KitType kitType) + { + super(); + this.kitType = kitType; + this.boxMap = new LinkedHashMap<>(); + setPreferredSize(new Dimension(220, 42)); + setBackground(ColorScheme.DARK_GRAY_COLOR); + setRenderer(new ComboBoxListRenderer()); + original = new ComboBoxIconEntry( + new ImageIcon(ImageUtil.getResourceStreamFromClass(TMorph.class, kitType.getName().toLowerCase() + ".png")), + kitType.getName(), + null + ); + addItem(original); + setSelectedIndex(0); + for (Component component : getComponents()) + { + if (component instanceof SubstanceDropDownButton) + { + remove(component); + } + } + } + + public void populate(Client client, ItemManager itemManager) + { + assert client.isClientThread() : "Populate must be called on client thread"; + + for (int i = 0; i < client.getItemCount(); i++) + { + ItemStats stats = itemManager.getItemStats(i, false); + + if (stats == null) + { + continue; + } + + if (!stats.isEquipable()) + { + continue; + } + + ItemEquipmentStats equipment = stats.getEquipment(); + + if (equipment == null) + { + continue; + } + + if (equipment.getSlot() != kitType.getIndex()) + { + continue; + } + + AsyncBufferedImage image = itemManager.getImage(i); + + if (image == null) + { + continue; + } + + final ComboBoxIconEntry entry = new ComboBoxIconEntry( + new ImageIcon(image), + client.getItemDefinition(i).getName(), + client.getItemDefinition(i) + ); + boxMap.put(i, entry); + addItem(entry); + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java new file mode 100644 index 0000000000..654b665e1e --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java @@ -0,0 +1,439 @@ +/* + * Copyright (c) 2019, ganom + * 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.tmorph.ui; + +import com.google.common.collect.ImmutableSet; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.event.ItemEvent; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import javax.inject.Inject; +import javax.swing.Box; +import javax.swing.BoxLayout; +import static javax.swing.BoxLayout.Y_AXIS; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.border.EmptyBorder; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.Client; +import net.runelite.api.GameState; +import net.runelite.api.ItemDefinition; +import net.runelite.api.Player; +import net.runelite.api.kit.KitType; +import static net.runelite.api.kit.KitType.AMULET; +import static net.runelite.api.kit.KitType.BOOTS; +import static net.runelite.api.kit.KitType.CAPE; +import static net.runelite.api.kit.KitType.HANDS; +import static net.runelite.api.kit.KitType.HELMET; +import static net.runelite.api.kit.KitType.LEGS; +import static net.runelite.api.kit.KitType.SHIELD; +import static net.runelite.api.kit.KitType.TORSO; +import static net.runelite.api.kit.KitType.WEAPON; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetInfo; +import net.runelite.client.database.DatabaseManager; +import static net.runelite.client.database.data.Tables.TMORPH_SETS; +import net.runelite.client.database.data.tables.records.TmorphSetsRecord; +import net.runelite.client.game.ItemManager; +import net.runelite.client.plugins.tmorph.TMorph; +import net.runelite.client.plugins.tmorph.TmorphSet; +import net.runelite.client.ui.PluginPanel; +import net.runelite.client.ui.components.ComboBoxIconEntry; +import net.runelite.client.util.Clipboard; +import org.jooq.Record; +import org.jooq.Result; +import org.jooq.TableField; +import org.jooq.impl.SQLDataType; + +@Slf4j +public class TPanel extends PluginPanel +{ + private static final Set BLACKLIST = ImmutableSet.of(KitType.AMMUNITION, KitType.RING, KitType.HEAD, KitType.JAW); + + private final Client client; + private final DatabaseManager databaseManager; + private final ItemManager itemManager; + private final TMorph plugin; + + private final JComboBox selector; + private final Map equipSlots; + private final Map kitToId; + private final Map setMap; + private final ExecutorService executor; + private JPanel equipPanel; + + @Inject + public TPanel( + final Client client, + final DatabaseManager databaseManager, + final ItemManager itemManager, + final TMorph plugin + ) + { + super(false); + this.client = client; + this.databaseManager = databaseManager; + this.itemManager = itemManager; + this.plugin = plugin; + this.equipSlots = new LinkedHashMap<>(); + this.kitToId = new HashMap<>(); + this.setMap = new HashMap<>(); + this.selector = new JComboBox<>(); + this.executor = Executors.newSingleThreadExecutor(); + init(); + } + + private void init() + { + selector.addItem(""); + selector.setSelectedIndex(0); + selector.addActionListener((e) -> + { + String name = (String) selector.getSelectedItem(); + Result recs = databaseManager.getDsl() + .selectFrom(TMORPH_SETS) + .where(TMORPH_SETS.SET_NAME.eq(name)) + .fetch(); + + for (TmorphSetsRecord rec : recs) + { + for (Map.Entry entry : equipSlots.entrySet()) + { + int id = rec.getValue(kitToField(entry.getKey())); + EquipSlot es = entry.getValue(); + es.setSelectedItem(es.getBoxMap().getOrDefault(id, es.getOriginal())); + } + } + }); + + final JLabel title = new JLabel(); + title.setText("Tmorph Sets"); + title.setForeground(Color.WHITE); + title.setHorizontalAlignment(JLabel.CENTER); + title.setVerticalAlignment(JLabel.CENTER); + + final JPanel titleAndMarkersPanel = new JPanel(); + titleAndMarkersPanel.setLayout(new BorderLayout()); + titleAndMarkersPanel.add(title, BorderLayout.CENTER); + + final JPanel northAnchoredPanel = new JPanel(); + northAnchoredPanel.setLayout(new BoxLayout(northAnchoredPanel, Y_AXIS)); + northAnchoredPanel.setBorder(new EmptyBorder(0, 0, 10, 0)); + northAnchoredPanel.add(titleAndMarkersPanel); + northAnchoredPanel.add(Box.createRigidArea(new Dimension(0, 10))); + northAnchoredPanel.add(selector); + + final JPanel lol = new JPanel(); + final JPanel containerPanel = new JPanel(); + + final JLabel caption = new JLabel(); + caption.setText("Current Morph"); + caption.setForeground(Color.WHITE); + caption.setHorizontalAlignment(JLabel.CENTER); + caption.setVerticalAlignment(JLabel.CENTER); + + final JPanel captionPanel = new JPanel(); + captionPanel.add(caption); + + equipPanel = new JPanel(); + equipPanel.setLayout(new GridLayout(15, 1, 1, 1)); + addSlots(); + + containerPanel.setLayout(new BorderLayout()); + containerPanel.add(captionPanel, BorderLayout.NORTH); + containerPanel.add(equipPanel, BorderLayout.CENTER); + + lol.add(containerPanel); + + final JPanel contentPanel = new JPanel(); + final BoxLayout contentLayout = new BoxLayout(contentPanel, Y_AXIS); + contentPanel.setLayout(contentLayout); + contentPanel.add(lol); + + final JPanel contentWrapper = new JPanel(new BorderLayout()); + contentWrapper.add(Box.createGlue(), BorderLayout.CENTER); + contentWrapper.add(contentPanel, BorderLayout.NORTH); + final JScrollPane contentWrapperPane = new JScrollPane(contentWrapper); + contentWrapperPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + + setLayout(new BorderLayout()); + setBorder(new EmptyBorder(10, 10, 10, 10)); + add(northAnchoredPanel, BorderLayout.NORTH); + add(contentWrapperPane, BorderLayout.CENTER); + executor.submit(this::populateSelector); + } + + private void populateSelector() + { + if (!databaseManager.checkTableExists("TMORPH_SETS")) + { + databaseManager.getDsl().createTable(TMORPH_SETS) + .column(TMORPH_SETS.SET_NAME, SQLDataType.VARCHAR(255).nullable(false)) + .column(TMORPH_SETS.HELMET, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.CAPE, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.AMULET, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.WEAPON, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.TORSO, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.SHIELD, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.LEGS, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.HANDS, SQLDataType.INTEGER.nullable(false)) + .column(TMORPH_SETS.BOOTS, SQLDataType.INTEGER.nullable(false)) + .execute(); + } + + Result recs = databaseManager.getDsl().selectFrom(TMORPH_SETS).fetch(); + setMap.clear(); + selector.removeAllItems(); + selector.addItem("Select your set..."); + selector.setSelectedIndex(0); + + for (Record record : recs) + { + TmorphSet tmo = new TmorphSet(); + String name = record.getValue(TMORPH_SETS.SET_NAME); + tmo.setName(name); + tmo.setHelmet(record.getValue(TMORPH_SETS.HELMET)); + tmo.setCape(record.getValue(TMORPH_SETS.CAPE)); + tmo.setAmulet(record.getValue(TMORPH_SETS.AMULET)); + tmo.setWeapon(record.getValue(TMORPH_SETS.WEAPON)); + tmo.setTorso(record.getValue(TMORPH_SETS.TORSO)); + tmo.setShield(record.getValue(TMORPH_SETS.SHIELD)); + tmo.setLegs(record.getValue(TMORPH_SETS.LEGS)); + tmo.setHands(record.getValue(TMORPH_SETS.HANDS)); + tmo.setBoots(record.getValue(TMORPH_SETS.BOOTS)); + setMap.put(name, tmo); + selector.addItem(name); + } + } + + private void addSlots() + { + int i = 0; + + for (KitType kitType : KitType.values()) + { + if (BLACKLIST.contains(kitType)) + { + continue; + } + + final EquipSlot equip = new EquipSlot(kitType); + + equip.addItemListener((e) -> + { + if (e.getStateChange() == ItemEvent.SELECTED) + { + ComboBoxIconEntry combo = (ComboBoxIconEntry) e.getItem(); + + if (combo.getData() == null) + { + return; + } + + ItemDefinition def = (ItemDefinition) combo.getData(); + KitType type = null; + + for (Map.Entry entry : equipSlots.entrySet()) + { + if (entry.getValue() == e.getSource()) + { + type = entry.getKey(); + break; + } + } + + if (type == null) + { + return; + } + + if (kitToId.containsKey(type)) + { + kitToId.replace(type, def.getId()); + } + else + { + kitToId.put(type, def.getId()); + } + + if (client.getGameState() == GameState.LOGGED_IN) + { + Map s = generate(); + } + } + }); + + equipSlots.put(kitType, equip); + equipPanel.add(equip); + i++; + } + + final JButton setButton = new JButton("Set Active Morph"); + setButton.addActionListener((e) -> plugin.setPanelMorph(generate())); + equipPanel.add(setButton); + + final JButton saveButton = new JButton("Save Active Morph"); + saveButton.addActionListener((e) -> + { + final String result = JOptionPane.showInputDialog(saveButton, "What would you like to name the set?"); + + Result records = databaseManager.getDsl() + .selectFrom(TMORPH_SETS) + .where(TMORPH_SETS.SET_NAME.eq(result)) + .fetch(); + + boolean exists = records.isNotEmpty(); + + if (!exists) + { + databaseManager.getDsl().insertInto(TMORPH_SETS) + .set(TMORPH_SETS.SET_NAME, result) + .set(TMORPH_SETS.HELMET, kitToId.getOrDefault(HELMET, -1)) + .set(TMORPH_SETS.CAPE, kitToId.getOrDefault(CAPE, -1)) + .set(TMORPH_SETS.AMULET, kitToId.getOrDefault(AMULET, -1)) + .set(TMORPH_SETS.WEAPON, kitToId.getOrDefault(WEAPON, -1)) + .set(TMORPH_SETS.TORSO, kitToId.getOrDefault(TORSO, -1)) + .set(TMORPH_SETS.SHIELD, kitToId.getOrDefault(SHIELD, -1)) + .set(TMORPH_SETS.LEGS, kitToId.getOrDefault(LEGS, -1)) + .set(TMORPH_SETS.HANDS, kitToId.getOrDefault(HANDS, -1)) + .set(TMORPH_SETS.BOOTS, kitToId.getOrDefault(BOOTS, -1)) + .execute(); + executor.submit(this::populateSelector); + } + else + { + databaseManager.getDsl().update(TMORPH_SETS) + .set(TMORPH_SETS.HELMET, kitToId.getOrDefault(HELMET, -1)) + .set(TMORPH_SETS.CAPE, kitToId.getOrDefault(CAPE, -1)) + .set(TMORPH_SETS.AMULET, kitToId.getOrDefault(AMULET, -1)) + .set(TMORPH_SETS.WEAPON, kitToId.getOrDefault(WEAPON, -1)) + .set(TMORPH_SETS.TORSO, kitToId.getOrDefault(TORSO, -1)) + .set(TMORPH_SETS.SHIELD, kitToId.getOrDefault(SHIELD, -1)) + .set(TMORPH_SETS.LEGS, kitToId.getOrDefault(LEGS, -1)) + .set(TMORPH_SETS.HANDS, kitToId.getOrDefault(HANDS, -1)) + .set(TMORPH_SETS.BOOTS, kitToId.getOrDefault(BOOTS, -1)) + .where(TMORPH_SETS.SET_NAME.eq(result)) + .execute(); + } + }); + equipPanel.add(saveButton); + } + + public void populateSlots() + { + for (EquipSlot slot : equipSlots.values()) + { + slot.populate(client, itemManager); + } + } + + public Map generate() + { + final StringBuilder sb = new StringBuilder(); + final Player player = client.getLocalPlayer(); + + if (player == null + || player.getPlayerAppearance() == null + || client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null + || client.getViewportWidget() == null) + { + return new HashMap<>(); + } + + for (KitType kitType : KitType.values()) + { + if (BLACKLIST.contains(kitType)) + { + continue; + } + + final Widget widget = client.getWidget(kitType.getWidgetInfo()); + + if (widget == null || widget.getDynamicChildren() == null || widget.getDynamicChildren().length < 1) + { + continue; + } + + final int id = itemManager.canonicalize(widget.getDynamicChildren()[1].getItemId()); + final int kitId = kitToId.getOrDefault(kitType, -1); + + if (kitId == -1) + { + continue; + } + + sb.append(id); + sb.append(","); + sb.append(kitId); + sb.append(":"); + sb.append(kitType.getName()); + sb.append("\n"); + } + + final String s = sb.toString(); + Clipboard.store(s); + + return plugin.getNEWLINE_SPLITTER() + .withKeyValueSeparator(":") + .split(s); + } + + private TableField kitToField(KitType kitType) + { + switch (kitType) + { + case HELMET: + return TMORPH_SETS.HELMET; + case CAPE: + return TMORPH_SETS.CAPE; + case AMULET: + return TMORPH_SETS.AMULET; + case WEAPON: + return TMORPH_SETS.WEAPON; + case TORSO: + return TMORPH_SETS.TORSO; + case SHIELD: + return TMORPH_SETS.SHIELD; + case LEGS: + return TMORPH_SETS.LEGS; + case HANDS: + return TMORPH_SETS.HANDS; + case BOOTS: + return TMORPH_SETS.BOOTS; + default: + return null; + } + } +} From d0c8119136cd2f013ab2b3b160ed1f96d135df1b Mon Sep 17 00:00:00 2001 From: Ganom Date: Tue, 14 Jan 2020 21:59:34 -0500 Subject: [PATCH 07/17] kittype: include widgetinfo for the equipment widgets. --- .../java/net/runelite/api/kit/KitType.java | 31 ++++++++++--------- .../net/runelite/api/widgets/WidgetID.java | 13 +++++++- .../net/runelite/api/widgets/WidgetInfo.java | 14 ++++++++- 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/kit/KitType.java b/runelite-api/src/main/java/net/runelite/api/kit/KitType.java index 67876def5b..0ecf57790a 100644 --- a/runelite-api/src/main/java/net/runelite/api/kit/KitType.java +++ b/runelite-api/src/main/java/net/runelite/api/kit/KitType.java @@ -26,6 +26,7 @@ package net.runelite.api.kit; import lombok.AllArgsConstructor; import lombok.Getter; +import net.runelite.api.widgets.WidgetInfo; /** * Represents an equipment slot in a players composition. @@ -39,19 +40,19 @@ import lombok.Getter; @AllArgsConstructor public enum KitType { - HELMET("Helmet", 0), - CAPE("Cape", 1), - AMULET("Amulet", 2), - WEAPON("Weapon", 3), - TORSO("Torso", 4), - SHIELD("Shield", 5), - LEGS("Legs", 7), - HEAD("Head", 8), - HANDS("Hands", 9), - BOOTS("Boots", 10), - JAW("Jaw", 11), - RING("Ring", 12), - AMMUNITION("Ammo", 13); + HELMET("Helmet", 0, WidgetInfo.EQUIPMENT_HELMET), + CAPE("Cape", 1, WidgetInfo.EQUIPMENT_CAPE), + AMULET("Amulet", 2, WidgetInfo.EQUIPMENT_AMULET), + WEAPON("Weapon", 3, WidgetInfo.EQUIPMENT_WEAPON), + TORSO("Torso", 4, WidgetInfo.EQUIPMENT_BODY), + SHIELD("Shield", 5, WidgetInfo.EQUIPMENT_SHIELD), + LEGS("Legs", 7, WidgetInfo.EQUIPMENT_LEGS), + HEAD("Head", 8, null), + HANDS("Hands", 9, WidgetInfo.EQUIPMENT_GLOVES), + BOOTS("Boots", 10, WidgetInfo.EQUIPMENT_BOOTS), + JAW("Jaw", 11, null), + RING("Ring", 12, WidgetInfo.EQUIPMENT_RING), + AMMUNITION("Ammo", 13, WidgetInfo.EQUIPMENT_AMMO); private final String name; @@ -59,4 +60,6 @@ public enum KitType * Gets the raw equipment index for use in {PlayerAppearance#getEquipmentIds()}. */ private final int index; -} + + private final WidgetInfo widgetInfo; +} \ No newline at end of file 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 ea6d38f898..a0c945ccdd 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 @@ -315,6 +315,17 @@ public class WidgetID static class Equipment { + static final int HELMET = 14; + static final int CAPE = 15; + static final int AMULET = 16; + static final int WEAPON = 17; + static final int BODY = 18; + static final int SHIELD = 19; + static final int LEGS = 20; + static final int GLOVES = 21; + static final int BOOTS = 22; + static final int RING = 23; + static final int AMMO = 24; static final int INVENTORY_ITEM_CONTAINER = 0; } @@ -1201,4 +1212,4 @@ public class WidgetID { static final int CONTAINER = 0; } -} +} \ No newline at end of file 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 d4bfeb2a07..44896bdb66 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 @@ -63,6 +63,18 @@ public enum WidgetInfo EQUIPMENT(WidgetID.EQUIPMENT_GROUP_ID, 0), EQUIPMENT_INVENTORY_ITEMS_CONTAINER(WidgetID.EQUIPMENT_INVENTORY_GROUP_ID, WidgetID.Equipment.INVENTORY_ITEM_CONTAINER), + EQUIPMENT_HELMET(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.HELMET), + EQUIPMENT_CAPE(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.CAPE), + EQUIPMENT_AMULET(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.AMULET), + EQUIPMENT_WEAPON(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.WEAPON), + EQUIPMENT_BODY(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.BODY), + EQUIPMENT_SHIELD(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.SHIELD), + EQUIPMENT_LEGS(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.LEGS), + EQUIPMENT_GLOVES(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.GLOVES), + EQUIPMENT_BOOTS(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.BOOTS), + EQUIPMENT_RING(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.RING), + EQUIPMENT_AMMO(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.AMMO), + EMOTE_WINDOW(WidgetID.EMOTES_GROUP_ID, WidgetID.Emotes.EMOTE_WINDOW), EMOTE_CONTAINER(WidgetID.EMOTES_GROUP_ID, WidgetID.Emotes.EMOTE_CONTAINER), EMOTE_SCROLLBAR(WidgetID.EMOTES_GROUP_ID, WidgetID.Emotes.EMOTE_SCROLLBAR), @@ -859,4 +871,4 @@ public enum WidgetInfo return groupId << 16 | childId; } -} +} \ No newline at end of file From 7801d209f8d37e30765b8c6deb3f02c28457c321 Mon Sep 17 00:00:00 2001 From: Ganom Date: Tue, 14 Jan 2020 22:20:25 -0500 Subject: [PATCH 08/17] tmorph: add resources. --- .../net/runelite/client/plugins/tmorph/ammo.png | Bin 0 -> 2404 bytes .../runelite/client/plugins/tmorph/amulet.png | Bin 0 -> 2407 bytes .../net/runelite/client/plugins/tmorph/boots.png | Bin 0 -> 2347 bytes .../net/runelite/client/plugins/tmorph/cape.png | Bin 0 -> 2358 bytes .../net/runelite/client/plugins/tmorph/hands.png | Bin 0 -> 2353 bytes .../runelite/client/plugins/tmorph/helmet.png | Bin 0 -> 2324 bytes .../net/runelite/client/plugins/tmorph/legs.png | Bin 0 -> 2325 bytes .../net/runelite/client/plugins/tmorph/nav.png | Bin 0 -> 2632 bytes .../runelite/client/plugins/tmorph/shield.png | Bin 0 -> 2333 bytes .../net/runelite/client/plugins/tmorph/torso.png | Bin 0 -> 2379 bytes .../runelite/client/plugins/tmorph/weapon.png | Bin 0 -> 2386 bytes 11 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/ammo.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/amulet.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/boots.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/cape.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/hands.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/helmet.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/legs.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/nav.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/shield.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/torso.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/weapon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/ammo.png b/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/ammo.png new file mode 100644 index 0000000000000000000000000000000000000000..51c9374c01b12b22f3cba715ef5f89942f44e941 GIT binary patch literal 2404 zcmaJ@dpwi-A0I_XD5FO47)O%bUAD2@Z_|XK<+|A(47=FIMyVa0D7WrRokDV{lS?{D zx1P9tX*o#~>vfzKRWjxVTFA3}!MY0^+~~HkSndv#k>juvsMdW(NwI!uJFd z*?yS;NnpgGZt9C=3pPaU|NKiC8S~^?|FR30U#O z5HFvvu~a7#JW(X#6HzF!Sd0|okUT*G3PT_eP-rX)i$$mq2w?_S#E>AkLdyjOFHp!7 zu=yf3j|E9)A_}^r?!mn*oH4G(T@KG2fdcLFuAcgY(p&ZUPv``cR z{*&+j6c&bN@Ih1vDCDIHn5x0WTh52#6FmhWL&Ot=@^~o=T?|U(iFm?99v|@ZobMU| zu-VM!vUpt5lF|Hj9XN_i%J@#5v%c(0B~S+uZ}>mRP;ce(R+;P6$Ey+8pw9c1|kcpTtM*+lmDbHROA z?<<$}{aoz7%SEY@LCp{MzlObVrE<{x_M3H8hi~QwxhlsCRMwWSZoB}2Xbk&%xra*b z{w}+pZ0ZZ`xjJ+uCM?8?a5mb>VqLfW!|_3nikbEu=??-b1`ik?JVZA!{KJZCyS_O2 zPBC90uEMqALda!9KZ36DiZS89Uq|j7ZXXb5n>s!E3|rr7GhNE-yrV4l>rj3wdE7y} z(toa!fp>P+Z;x3U6;1eEH<}e>)Z@ojYnepm(`ffGD^+VI%D(<-zLGoku(Flg}{qs?;yv zcvs6%d?L{MbDv)H)xAnK@^l)bG-z7PC~Jb%Mik0LZHfZ5B0~F;NXX);Tel9A%zxH{ zQw!Qm#kyMMblDqzyWi-_KeuPiDTi}kw(Zw|PNz1k)YSqE@&X>i`}@@5(>REzk6DZ} zx&!^=E}DF~xP3Ne>hrC=4?0btnt@$O>Y;NR^j^x9b1T&G<>4t622$EGQ>lS0JXuF` zmzJ-E0{eV=CXJ;w$3iEJ{n4fkzwjBtICs>sRgQn;=(iKgF`{)uR6 zpn;OiZ93|$vs+^Ei`HWh_VnhFWc?>^ULB-O1tg_Wjg6bk#Ks(s-wO+-7=QXWp`ZFHzoDbqtw)~u^nrR5Mf^;i5(Z=FaLbwmyQJ{p ztGbGa^jf1y?y%4;sA64S#DSjzOR>MUwk8>#z?#zrgtshWU!U9v{@8MTf>Oomc>ZD) zemsn2C2cIyo;8Uj!CI^v`a-OKnLU;;JGRsJEXHtfbxT;Pr<;-+`);gCP^5v*nbbPr z$}W9ax11VhBgW97Yk%HD=(lakC<}m`D(O~74GAIRHzFULl7=vANyEs|b9T~e&3D1` zvNkhc%erOqF$F_yuyHJUvArVV7)W?(%ZvxzU!%V_f|%wcjDT!w%*?zprUS^@xX{~Sj4f6+`A`9o%(Z^`u)rX#Ld0C zVzKA%@b($GRv_wQ%h_es_iN^2N8i@FO`Vyn?|5@P^ma&h8eP|S|6e_=*FO7&_LsiY zivKJ)($q2Afjm^WM`_Ld^|alGy*mb{T_emhKU#J{N)oasFU~xY%>VcJdk1>ed(gB0 E1IfSO@&Et; literal 0 HcmV?d00001 diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/amulet.png b/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/amulet.png new file mode 100644 index 0000000000000000000000000000000000000000..6cf342730df436fab9df6c428e4b3936951d19ea GIT binary patch literal 2407 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 Kq+%z(`&Gwk3UD~F(p4?NNs8Bo6l3S>- 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 Ql7&ARI+a1Gb_-AaFWev9x&QzG literal 0 HcmV?d00001 diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/hands.png b/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/hands.png new file mode 100644 index 0000000000000000000000000000000000000000..adb70ef4c0f0af9b81f6501694beda4159236dbd GIT binary patch literal 2353 zcmaJ@dpuNmA3h2x(~?_==@`1EDw4>=GNm*q zP8g6XgThmTS-jME9*K|g_5wW>WVL_@g1MkVv{fu8D=4T>x@7fUbB#fPpCE8N1@(7Q zY-T7(lgJ>D=;Dgz;Z_krHSoI9Kv2EE$gnKR+mSG#Ot& z4x=+Z$5Njts5lswk};U%RC!W5J`)4xj)Nx#U7<)7Q6ZWu8O=j>Gv;eQ^vb!<|8A zP_ZN$3CEb@(j~k^5hRA^xcq;(eqZHk>>!e=Bhw+7FbU!_WD*hhscf?F>$&)TRqr#G z|MgsGU*%%d$zU|Y{jXuqU8x@5r?M0euM`c3 zEb}*MZBuMd6wNzgvd8#GmLAc_bgffF_0*;Gq|1?osJhj*2k2`LEUm+?xcd8n-J-6U z98yck`hvF(*220s#e|ooX=5Yz>i^XzJzml{Th#;SS0-=!kTSd<^
  • @-fv`OOM-0 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 literal 0 HcmV?d00001 diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/nav.png b/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/nav.png new file mode 100644 index 0000000000000000000000000000000000000000..1a23abe2dc6a131aac68bd9804148580f4e83c03 GIT binary patch literal 2632 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 pU~oPx4!7OGDGqx^Ci`+_O$&Dye z$W2AzX8TDAX;XA%Nz1J)sq0sycdSE&!lx z&huwNOkW=YN65Ej&&Sxx_#y=w09@9|L~KqJ2q8kjaGt;wIdQoOiQsWvk%9KUXkQT- zjNo}Ch(ShzpFbxdii77O*AWpeGJ=AD4?=8&j2|tK5M-{%&%6Z1e*PMTM0^f`qFj+* zL@|A72(nNNBJ6D)Y&aM@dxRt27UO`k!{edLX!q}qcOIir@_5JryKL1;^ z1fqj~>-|S!iGREZMA1QsFjmY_3@*%cK9z_-7K3a^DE1c$qZhhJix5IWNrX^@Ad~02 zhDWRoqOutD z)fAiGn}Uvy{xNDc!XVs@TsKjG3n#wn-_nOjhAQzbr1V;to^yaQkY%6w!gul7W{youz$dqq5y} z*l@)5JJpGE#^~oKC-0f=;#eFgUNLd1=8B$LT6ZZhs-9Lnka!Jfb52$d22@_$zn|^; zW8orG#`W2^iE1h|bY@brqg5ShaQ4$*w_0`=e8^JO$JX|0tEuSuWNdhfyjib&qhlnp zcKUe>)2N`}>J+@${z-x~k^OoKvHxf18#>2QY_w@7r@$A{(S4pi&9IB1+UY=R}Z{=h+4%LY{W$2mw$NPpy0~3c|7s(oD zp|+dcgF%H>AXbjGHPq0dB}_C-%b!{r&|g}^^K)Q(x5_Qt=-$W2UFLe+(A4l9Z>L{8 z>XAQw9nw^~E_h>TvE43KkdfXSQUK)6bGx@l!YY^s zM>O`x7H2Q1KoHl)wdyae?@Qc7&lx=3VtmfQWE-m<@KfWIFuUq3)$L=iUQSQVIg5vn z=qP*t+)kZ~F$1o(uOynlt|YDPWy1ZsiCY&Zm19oy(g`&rlA1-c=JkZ+PMy@aBQSV6 zvC4!v(k540nK?Nc%*xE|E_#PaM=I^F_B>x%8ngF5^7kc4XIQ7IslXH6XTkR!&9b&> zuHUfRv%Ig!UMpS8OEa3LWOp;tXV7XmOq1j92JWeJwpc8;{@|Z+IyD1)o8augOQAnZ zbxEiL}kdM$Z|lneXH$8d+7 ziVyxZh`Pbkxt7oq-I}AUc9h)7cozA?QsbiMR}Mc}T6JN)(NL*5tfvOebVkKZ`rQ4q zd8(U;x9l!-p!4b*&kL+A%w|{XuOB=d?~>c8LbQpqte*r!3%As~BQvGYR$N$K9%N1} zS|)GIXgnNkS*x?+BP(` zG8s#nbwZxPh7K&vm7RbeAL|UE2B3}XH9Iu~c^uzFsZ2l7JVjJ``pwJnDQ+#fQ~Qma zRq~9Q{6UHQ>%il8S7LFOjFn0sy?a@vTbN^vnkjR;eOH~gPq%w!Q}N2{uNfWy2jJpSWal`SR`S|c6CK!**5;AvSzU&$qaEG?FYT z=u;nWs_n%-3WksO+Fh%Zo|DrbH^cW^zuy;o_*2%onGok4e>5G-sSvJ-&mK4=WH_2% o;>8=zwyleJ`QvZ5Z05AkzzCr0CHC2PW&ZcZ+ry7?mK3t%f5&&@HUIzs literal 0 HcmV?d00001 diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/weapon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/tmorph/weapon.png new file mode 100644 index 0000000000000000000000000000000000000000..44f7534fa65f456f39960e99fbb1ff6dffcf8979 GIT binary patch literal 2386 zcmaJ@c|4T+9)7b`jFVdmEvLCN5;D7GW->GkrI3c0B+d4Y8O*$6W-wHeHihWal_g8+ zRO3X-Nw$!ED_P=Doa&wk#fd~z?o210`^W9RpU?aLme2D%-|hM1J>}uPRabkpHUI#+ zF575yYmuM-!&w-Q_r+3gU|{S-DqTV-WB!5Lplf@mEp| zHxIZYBmv=8XloP)XK4kuA)#^B1WOXh0*=Sxh!`vpgCn4D)?`a88IOm5eGtlM5-yKS zr#XL(r94p(e3?v4#$dw3!_nacG$aYY;7BAA28+kw@hBw%C5;ftSaOs|id;~jfl`h{ zAeIRr5nQFnVnd-a3PPFbUnK~|-(*G7uWeE`3?pZWF*r0$NX`n<926CMxkP!Z*Y_j0{xmbT!?<<%4 z{akFm%f%>@!KjA&U&CIwQaVVr{bpU|;hXtEk<#%JrM0iC!;k==S?xljddd50Q}*p# zvsM4Z;@_ebZdESZcKl?rTiu5#4TjF|8J-sqJ}a6t$19)AT-g>i^LD8FQ0R)yP|=Cu znHl4$xt8H~?<`R0u#Sw)yGzTF|q>w)59Q$r-Y+ zu;i@ylDk<$IU$wZ>+0?hb`+jVA8q{MTqs#*cw{6uHM*Xn(;2yA$M9Ice+zk*;RW}L z%R&v#&8)?4tU1?#G-_yNIQF!=tzYK38umk)WHiVoOM-_O*V)G>s)D7rg?yQ0Tph2e9KJjJP)TvgEA zeUXn|Dga(?A(QN;VXx&2aetR_(;%CEp@|!sz&`YLqaNl z?Rt>Sy`vd>{~uN(oZJU591P?S}BKGHnl`hsmaT?bopI1K={}c z0d*I1lDoDK+aXN%+WDVv(!cE4o{Dp`pygxxX>VD|adK;c=uXQZMY_ zV(e95P1`GfS02^I@Pn;6UWRN z)E_zoS(?dOwCX!;H2G0cb{Nxtf#+}7`Q;HNjcc2_{TNHtf1VTLbQZZH^`q{M`aL{k z=r<12-lFeJc4ZX2^wt2l3;`6_!`*bhwtVvShaOMYVUv2SfkCTcO?=6%KI9g(K{QSW z(O!4Fj%H}_qObii-+X&>Ot9o-59*|paUFskXy;JWSsL{(*d=4}NAUF*xn{BCO@z{> zWxN+rrDlESyl^Yu2P2zW%j0d>u}-bIS~=JQ7?h(k{O zzG+u!pSUFz{gr;fMQhc(p5kmN&-O^zlb6+|w7o5?XeOoAPQb}K2{*m_eg}z9E@ZI> z-hBKe9mc<{ZW&Ol{^teUA0}-dLq_)w8V$8PxzM)RGmFdHm__BWPo^u1shp6YeYS@~ zAfwoZAKQW|R@_w-faXh?_%pdPr$hHeoo)PZX|GiTBJ@s$&y|vq?&Mv@9e{^_Sz~ Date: Wed, 15 Jan 2020 16:25:42 -0500 Subject: [PATCH 09/17] tmorph: fix panel sizing. --- .../java/net/runelite/client/plugins/tmorph/TMorph.java | 7 +------ .../net/runelite/client/plugins/tmorph/ui/EquipSlot.java | 2 +- .../java/net/runelite/client/plugins/tmorph/ui/TPanel.java | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java index 4aa3755c33..165eb39f10 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java @@ -26,7 +26,6 @@ package net.runelite.client.plugins.tmorph; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; import com.google.inject.Provides; -import java.awt.Color; import java.awt.image.BufferedImage; import java.util.Arrays; import java.util.HashMap; @@ -73,7 +72,6 @@ public class TMorph extends Plugin { @Getter(AccessLevel.PACKAGE) private static final Map kit; - private static final Color COLOR = new Color(10, 134, 74, 255); static { @@ -157,10 +155,7 @@ public class TMorph extends Plugin { if (event.getGameState() == GameState.LOGIN_SCREEN) { - clientThread.invokeLater(() -> - { - panel.populateSlots(); - }); + clientThread.invokeLater(() -> panel.populateSlots()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java index fd66f287e0..3793a2270e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/EquipSlot.java @@ -55,7 +55,7 @@ public class EquipSlot extends JComboBox super(); this.kitType = kitType; this.boxMap = new LinkedHashMap<>(); - setPreferredSize(new Dimension(220, 42)); + setPreferredSize(new Dimension(200, 42)); setBackground(ColorScheme.DARK_GRAY_COLOR); setRenderer(new ComboBoxListRenderer()); original = new ComboBoxIconEntry( diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java index 654b665e1e..603d1d21a1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java @@ -168,7 +168,7 @@ public class TPanel extends PluginPanel captionPanel.add(caption); equipPanel = new JPanel(); - equipPanel.setLayout(new GridLayout(15, 1, 1, 1)); + equipPanel.setLayout(new GridLayout(11, 1, 1, 1)); addSlots(); containerPanel.setLayout(new BorderLayout()); From 3d66a7e102c9f587a2549e38097a21850bf29940 Mon Sep 17 00:00:00 2001 From: Ganom Date: Sat, 25 Jan 2020 15:23:48 -0500 Subject: [PATCH 10/17] tmorph: use best of both worlds. --- .../runelite/client/plugins/tmorph/Parse.java | 47 +++++++++ .../client/plugins/tmorph/TMorph.java | 95 +++++++++++++++++-- .../client/plugins/tmorph/TMorphConfig.java | 80 ++++++++++++++++ .../client/plugins/tmorph/ui/TPanel.java | 38 +++++--- 4 files changed, 242 insertions(+), 18 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java new file mode 100644 index 0000000000..fa4ba34ec8 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/Parse.java @@ -0,0 +1,47 @@ +package net.runelite.client.plugins.tmorph; + +import java.util.Arrays; +import java.util.Map; +import javax.inject.Singleton; + +@Singleton +public class Parse +{ + public static boolean parse(String value) + { + try + { + final StringBuilder sb = new StringBuilder(); + + for (String str : value.split("\n")) + { + if (!str.startsWith("//")) + { + sb.append(str).append("\n"); + } + } + final Map tmp = TMorph.getNEWLINE_SPLITTER().withKeyValueSeparator(':').split(sb); + + for (Map.Entry entry : tmp.entrySet()) + { + if (!TMorph.getKit().containsKey(entry.getValue())) + { + return false; + } + + final int[] ints = Arrays.stream(entry.getKey().split(",")).map(String::trim).mapToInt(Integer::parseInt).toArray(); + + if (ints.length <= 1) + { + return false; + } + } + + return true; + } + catch (Exception ex) + { + return false; + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java index 165eb39f10..eaeb8d7e00 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java @@ -26,6 +26,7 @@ package net.runelite.client.plugins.tmorph; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; import com.google.inject.Provides; +import java.awt.Color; import java.awt.image.BufferedImage; import java.util.Arrays; import java.util.HashMap; @@ -36,10 +37,12 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; import net.runelite.api.Actor; +import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.Player; import net.runelite.api.events.AnimationChanged; +import net.runelite.api.events.CommandExecuted; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.SpotAnimationChanged; @@ -50,13 +53,14 @@ import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.ConfigChanged; -import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginType; import net.runelite.client.plugins.tmorph.ui.TPanel; import net.runelite.client.ui.ClientToolbar; import net.runelite.client.ui.NavigationButton; +import net.runelite.client.util.Clipboard; +import net.runelite.client.util.ColorUtil; import net.runelite.client.util.ImageUtil; import org.apache.commons.lang3.ObjectUtils; @@ -76,10 +80,12 @@ public class TMorph extends Plugin static { final ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); + for (KitType kit : KitType.values()) { builder.put(kit.getName(), kit); } + kit = builder.build(); } @@ -104,10 +110,6 @@ public class TMorph extends Plugin @Inject private ClientThread clientThread; - @Inject - private ItemManager itemManager; - - private TPanel panel; private NavigationButton navButton; private int animation; @@ -118,6 +120,9 @@ public class TMorph extends Plugin private int targetGraphic; @Setter private Map panelMorph = new HashMap<>(); + private Map set1; + private Map set2; + private Map set3; @Provides TMorphConfig provideConfig(ConfigManager configManager) @@ -150,6 +155,78 @@ public class TMorph extends Plugin eventBus.unregister(this); } + @Subscribe + public void onCommandExecuted(CommandExecuted event) + { + final String[] args = event.getArguments(); + + if (event.getCommand().equals("tmorph")) + { + try + { + if (args[0].equals("copy")) + { + final StringBuilder sb = new StringBuilder(); + final Player player = client.getLocalPlayer(); + + if (player == null + || player.getPlayerAppearance() == null + || client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null + || client.getViewportWidget() == null) + { + return; + } + + for (KitType kitType : KitType.values()) + { + if (kitType.equals(KitType.RING) || kitType.equals(KitType.AMMUNITION)) + { + continue; + } + + final int id = player.getPlayerAppearance().getEquipmentId(kitType); + + if (id == -1) + { + continue; + } + + sb.append(id); + sb.append(",-1"); + sb.append(":"); + sb.append(kitType.getName()); + sb.append("\n"); + } + client.addChatMessage( + ChatMessageType.GAMEMESSAGE, + "TMorph", + ColorUtil.prependColorTag("Your current gear has been copied to your clipboard", Color.RED), + null + ); + Clipboard.store(sb.toString()); + } + else + { + client.addChatMessage( + ChatMessageType.GAMEMESSAGE, + "TMorph", + ColorUtil.prependColorTag("Invalid syntax, do ::tmorph copy", Color.RED), + null + ); + } + } + catch (Exception e) + { + client.addChatMessage( + ChatMessageType.GAMEMESSAGE, + "TMorph", + ColorUtil.prependColorTag("Invalid syntax, do ::tmorph copy", Color.RED), + null + ); + } + } + } + @Subscribe public void onGameStateChanged(GameStateChanged event) { @@ -233,11 +310,14 @@ public class TMorph extends Plugin } updateGear(panelMorph, player); + updateGear(set1, player); + updateGear(set2, player); + updateGear(set3, player); } public void updateGear(Map map, Player player) { - if (map == null || map.isEmpty()) + if (map == null || map.isEmpty() || player.getPlayerAppearance() == null) { return; } @@ -281,6 +361,9 @@ public class TMorph extends Plugin private void updateConfig() { + this.set1 = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config.set1()); + this.set2 = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config.set2()); + this.set3 = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config.set3()); this.animation = config.animationSwap(); this.globalAnimSwap = config.globalAnimSwap(); this.globalGraphicSwap = config.globalGraphicSwap(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java index c7b9c63e52..404fadf453 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java @@ -27,10 +27,76 @@ import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; import net.runelite.client.config.ConfigSection; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("TMorph") public interface TMorphConfig extends Config { + @ConfigTitleSection( + keyName = "swaps", + name = "Morphers", + description = "", + position = 1 + ) + default Title swaps() + { + return new Title(); + } + + @ConfigItem( + keyName = "mageSwap", + name = "Swap Set 1", + description = "
    Proper Format is id,id:Slot" + + "
    For example: 6570,21295:Cape" + + "
    Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
    ", + titleSection = "swaps", + position = 1, + parse = true, + clazz = Parse.class, + method = "parse" + ) + default String set1() + { + return ""; + } + + @ConfigItem( + keyName = "rangeSwap", + name = "Swap Set 2", + description = "
    Proper Format is id,id:Slot" + + "
    For example: 6570,21295:Cape" + + "
    Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
    ", + titleSection = "swaps", + position = 2, + parse = true, + clazz = Parse.class, + method = "parse" + ) + default String set2() + { + return ""; + } + + @ConfigItem( + keyName = "meleeSwap", + name = "Swap Set 3", + description = "
    Proper Format is id,id:Slot" + + "
    For example: 6570,21295:Cape" + + "
    Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
    ", + titleSection = "swaps", + position = 3, + parse = true, + clazz = Parse.class, + method = "parse" + ) + default String set3() + { + return ""; + } + + //////////////////Experimental Functions + @ConfigSection( position = 4, keyName = "experimentalSection", @@ -137,4 +203,18 @@ public interface TMorphConfig extends Config { return 0; } + + @ConfigTitleSection( + keyName = "copy", + name = "
    If you would like to copy your equipped" + + "
    gear, type \"::tmorph copy\" in chat." + + "
    This will copy your gear to your" + + "
    clipboard for easy copy paste.
    ", + description = "", + position = 50 + ) + default Title copy() + { + return new Title(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java index 603d1d21a1..6c22369940 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java @@ -63,6 +63,7 @@ import static net.runelite.api.kit.KitType.TORSO; import static net.runelite.api.kit.KitType.WEAPON; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; +import net.runelite.client.Notifier; import net.runelite.client.database.DatabaseManager; import static net.runelite.client.database.data.Tables.TMORPH_SETS; import net.runelite.client.database.data.tables.records.TmorphSetsRecord; @@ -86,6 +87,7 @@ public class TPanel extends PluginPanel private final DatabaseManager databaseManager; private final ItemManager itemManager; private final TMorph plugin; + private final Notifier notifier; private final JComboBox selector; private final Map equipSlots; @@ -99,7 +101,8 @@ public class TPanel extends PluginPanel final Client client, final DatabaseManager databaseManager, final ItemManager itemManager, - final TMorph plugin + final TMorph plugin, + final Notifier notifier ) { super(false); @@ -107,6 +110,7 @@ public class TPanel extends PluginPanel this.databaseManager = databaseManager; this.itemManager = itemManager; this.plugin = plugin; + this.notifier = notifier; this.equipSlots = new LinkedHashMap<>(); this.kitToId = new HashMap<>(); this.setMap = new HashMap<>(); @@ -117,7 +121,7 @@ public class TPanel extends PluginPanel private void init() { - selector.addItem(""); + selector.addItem("Populating fields..."); selector.setSelectedIndex(0); selector.addActionListener((e) -> { @@ -159,7 +163,7 @@ public class TPanel extends PluginPanel final JPanel containerPanel = new JPanel(); final JLabel caption = new JLabel(); - caption.setText("Current Morph"); + caption.setText("Morph Selector"); caption.setForeground(Color.WHITE); caption.setHorizontalAlignment(JLabel.CENTER); caption.setVerticalAlignment(JLabel.CENTER); @@ -290,7 +294,7 @@ public class TPanel extends PluginPanel if (client.getGameState() == GameState.LOGGED_IN) { - Map s = generate(); + Map s = generate(false); } } }); @@ -300,18 +304,23 @@ public class TPanel extends PluginPanel i++; } - final JButton setButton = new JButton("Set Active Morph"); - setButton.addActionListener((e) -> plugin.setPanelMorph(generate())); + final JButton setButton = new JButton("Set/Copy Active Morph"); + setButton.addActionListener((e) -> plugin.setPanelMorph(generate(true))); equipPanel.add(setButton); final JButton saveButton = new JButton("Save Active Morph"); saveButton.addActionListener((e) -> { - final String result = JOptionPane.showInputDialog(saveButton, "What would you like to name the set?"); + final String s = JOptionPane.showInputDialog(saveButton, "What would you like to name the set?"); + + if (s == null || s.isEmpty()) + { + return; + } Result records = databaseManager.getDsl() .selectFrom(TMORPH_SETS) - .where(TMORPH_SETS.SET_NAME.eq(result)) + .where(TMORPH_SETS.SET_NAME.eq(s)) .fetch(); boolean exists = records.isNotEmpty(); @@ -319,7 +328,7 @@ public class TPanel extends PluginPanel if (!exists) { databaseManager.getDsl().insertInto(TMORPH_SETS) - .set(TMORPH_SETS.SET_NAME, result) + .set(TMORPH_SETS.SET_NAME, s) .set(TMORPH_SETS.HELMET, kitToId.getOrDefault(HELMET, -1)) .set(TMORPH_SETS.CAPE, kitToId.getOrDefault(CAPE, -1)) .set(TMORPH_SETS.AMULET, kitToId.getOrDefault(AMULET, -1)) @@ -344,7 +353,7 @@ public class TPanel extends PluginPanel .set(TMORPH_SETS.LEGS, kitToId.getOrDefault(LEGS, -1)) .set(TMORPH_SETS.HANDS, kitToId.getOrDefault(HANDS, -1)) .set(TMORPH_SETS.BOOTS, kitToId.getOrDefault(BOOTS, -1)) - .where(TMORPH_SETS.SET_NAME.eq(result)) + .where(TMORPH_SETS.SET_NAME.eq(s)) .execute(); } }); @@ -359,7 +368,7 @@ public class TPanel extends PluginPanel } } - public Map generate() + public Map generate(boolean copy) { final StringBuilder sb = new StringBuilder(); final Player player = client.getLocalPlayer(); @@ -403,7 +412,12 @@ public class TPanel extends PluginPanel } final String s = sb.toString(); - Clipboard.store(s); + + if (copy) + { + Clipboard.store(s); + notifier.notify("Saved to clipboard."); + } return plugin.getNEWLINE_SPLITTER() .withKeyValueSeparator(":") From 804c4d306366dd8b3b904cb1994f77aa37553094 Mon Sep 17 00:00:00 2001 From: Ganom Date: Sat, 25 Jan 2020 16:42:04 -0500 Subject: [PATCH 11/17] tmorph: change name of panel. --- .../net/runelite/client/plugins/tmorph/ui/TPanel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java index 6c22369940..3331a9257d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/ui/TPanel.java @@ -159,7 +159,7 @@ public class TPanel extends PluginPanel northAnchoredPanel.add(Box.createRigidArea(new Dimension(0, 10))); northAnchoredPanel.add(selector); - final JPanel lol = new JPanel(); + final JPanel containerHolder = new JPanel(); final JPanel containerPanel = new JPanel(); final JLabel caption = new JLabel(); @@ -179,12 +179,12 @@ public class TPanel extends PluginPanel containerPanel.add(captionPanel, BorderLayout.NORTH); containerPanel.add(equipPanel, BorderLayout.CENTER); - lol.add(containerPanel); + containerHolder.add(containerPanel); final JPanel contentPanel = new JPanel(); final BoxLayout contentLayout = new BoxLayout(contentPanel, Y_AXIS); contentPanel.setLayout(contentLayout); - contentPanel.add(lol); + contentPanel.add(containerHolder); final JPanel contentWrapper = new JPanel(new BorderLayout()); contentWrapper.add(Box.createGlue(), BorderLayout.CENTER); @@ -294,7 +294,7 @@ public class TPanel extends PluginPanel if (client.getGameState() == GameState.LOGGED_IN) { - Map s = generate(false); + generate(false); } } }); From 25a2bf581a64fdc9fe655ff5ce1d6d061fa27aee Mon Sep 17 00:00:00 2001 From: xKylee <48519776+xKylee@users.noreply.github.com> Date: Sun, 26 Jan 2020 23:48:05 +0000 Subject: [PATCH 12/17] mes: merge shiftwalk mes: merge shiftwalk --- .../MenuEntrySwapperConfig.java | 31 +- .../MenuEntrySwapperPlugin.java | 83 +++++- .../shiftwalker/ShiftWalkerConfig.java | 87 ------ .../shiftwalker/ShiftWalkerPlugin.java | 281 ------------------ 4 files changed, 106 insertions(+), 376 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerConfig.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerPlugin.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java index 73030cbf92..eb69cd59c2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java @@ -1974,7 +1974,6 @@ public interface MenuEntrySwapperConfig extends Config position = 2, section = "hotkeySwapping" ) - default boolean swapNpcContact() { return false; @@ -1987,7 +1986,6 @@ public interface MenuEntrySwapperConfig extends Config position = 3, section = "hotkeySwapping" ) - default boolean bankWieldItem() { return false; @@ -2000,7 +1998,6 @@ public interface MenuEntrySwapperConfig extends Config position = 4, section = "hotkeySwapping" ) - default boolean bankWearItem() { return false; @@ -2013,7 +2010,6 @@ public interface MenuEntrySwapperConfig extends Config position = 5, section = "hotkeySwapping" ) - default boolean bankEatItem() { return false; @@ -2026,7 +2022,6 @@ public interface MenuEntrySwapperConfig extends Config position = 6, section = "hotkeySwapping" ) - default boolean bankDrinkItem() { return false; @@ -2039,7 +2034,6 @@ public interface MenuEntrySwapperConfig extends Config position = 7, section = "hotkeySwapping" ) - default boolean bankEquipItem() { return false; @@ -2052,9 +2046,32 @@ public interface MenuEntrySwapperConfig extends Config position = 8, section = "hotkeySwapping" ) - default boolean bankInvigorateItem() { return false; } + + @ConfigItem( + keyName = "hotKeyWalk", + name = "Hotkey to Walk", + description = "For when you want Walk here as a priority", + position = 9, + section = "hotkeySwapping" + ) + default boolean hotKeyWalk() + { + return false; + } + + @ConfigItem( + keyName = "hotKeyLoot", + name = "Hotkey to Loot", + description = "For when people stand on your loot", + position = 10, + section = "hotkeySwapping" + ) + default boolean hotKeyLoot() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 0c2cecb932..cdbf93e691 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -149,6 +149,74 @@ public class MenuEntrySwapperPlugin extends Plugin "mazchna", "vannaka", "chaeldar", "nieve", "steve", "duradel", "krystilia", "konar", "murphy", "cyrisus", "smoggy", "ginea", "watson", "barbarian guard", "random" ); + + private static final AbstractComparableEntry WALK = new AbstractComparableEntry() + { + private final int hash = "WALK".hashCode() * 79 + getPriority(); + + @Override + public int hashCode() + { + return hash; + } + + @Override + public boolean equals(Object entry) + { + return entry.getClass() == this.getClass() && entry.hashCode() == this.hashCode(); + } + + @Override + public int getPriority() + { + return 99; + } + + @Override + public boolean matches(MenuEntry entry) + { + return + entry.getOpcode() == MenuOpcode.WALK.getId() || + entry.getOpcode() == MenuOpcode.WALK.getId() + MenuOpcode.MENU_ACTION_DEPRIORITIZE_OFFSET; + } + }; + + private static final AbstractComparableEntry TAKE = new AbstractComparableEntry() + { + private final int hash = "TAKE".hashCode() * 79 + getPriority(); + + @Override + public int hashCode() + { + return hash; + } + + @Override + public boolean equals(Object entry) + { + return entry.getClass() == this.getClass() && entry.hashCode() == this.hashCode(); + } + + @Override + public int getPriority() + { + return 100; + } + + @Override + public boolean matches(MenuEntry entry) + { + int opcode = entry.getOpcode(); + if (opcode > MenuOpcode.MENU_ACTION_DEPRIORITIZE_OFFSET) + { + opcode -= MenuOpcode.MENU_ACTION_DEPRIORITIZE_OFFSET; + } + + return + opcode >= MenuOpcode.GROUND_ITEM_FIRST_OPTION.getId() && + opcode <= MenuOpcode.GROUND_ITEM_FIFTH_OPTION.getId(); + } + }; private static final Splitter NEWLINE_SPLITTER = Splitter .on("\n") @@ -300,6 +368,8 @@ public class MenuEntrySwapperPlugin extends Plugin private boolean swapWildernessLever; private boolean swapJewelleryBox; private boolean getSwapOffer; + private boolean hotKeyLoot; + private boolean hotKeyWalk; private final HotkeyListener hotkey = new HotkeyListener(() -> this.hotkeyMod) { @Override @@ -1525,7 +1595,14 @@ public class MenuEntrySwapperPlugin extends Plugin { menuManager.addPriorityEntry("climb-up").setPriority(100); } - + if (this.hotKeyLoot) + { + menuManager.addPriorityEntry(TAKE); + } + if (this.hotKeyWalk) + { + menuManager.addPriorityEntry(WALK); + } if (this.swapNpcContact) { for (String npccontact : npcContact) @@ -1551,6 +1628,8 @@ public class MenuEntrySwapperPlugin extends Plugin menuManager.removePriorityEntry(new BankComparableEntry("equip", "", false)); menuManager.removePriorityEntry(new BankComparableEntry("invigorate", "", false)); menuManager.removePriorityEntry("climb-up"); + menuManager.removePriorityEntry(TAKE); + menuManager.removePriorityEntry(WALK); for (String npccontact : npcContact) { @@ -1796,6 +1875,8 @@ public class MenuEntrySwapperPlugin extends Plugin this.bankInvigorateItem = config.bankInvigorateItem(); this.swapNpcContact = config.swapNpcContact(); this.getSwapOffer = config.getSwapOffer(); + this.hotKeyWalk = config.hotKeyWalk(); + this.hotKeyLoot = config.hotKeyLoot(); } private void addBuySellEntries() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerConfig.java deleted file mode 100644 index 7f5d9baca9..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerConfig.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2018, Plinko60 - * 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.shiftwalker; - -import net.runelite.client.config.Config; -import net.runelite.client.config.ConfigGroup; -import net.runelite.client.config.ConfigItem; - -@ConfigGroup("shiftwalkhere") -public interface ShiftWalkerConfig extends Config -{ - @ConfigItem( - keyName = "shiftWalk", - name = "Shift to Walk", - description = "For when you want Walk here as a priority" - ) - default boolean shiftWalk() - { - return false; - } - - @ConfigItem( - keyName = "shiftLoot", - name = "Shift to Loot", - description = "For when people stand on your loot" - ) - default boolean shiftLoot() - { - return false; - } -/* - - @ConfigItem( - keyName = "shiftWalkEverything", - name = "Walk Under Everything", - description = "Enable this option when you do not want to interact with anything while Shift is pressed. " + - "If Walk Here is an option it will be the action taken." - ) - default boolean shiftWalkEverything() - { - return true; - } - - @ConfigItem( - keyName = "shiftWalkBoxTraps", - name = "Walk Under Box Traps", - description = "Press \"Shift\" to be able to walk under instead of picking up a Box Trap." - ) - default boolean shiftWalkBoxTraps() - { - return true; - } - - @ConfigItem( - keyName = "shiftWalkAttackOption", - name = "Walk Under Attack Options", - description = "Press \"Shift\" to be able to walk instead of attacking. Make sure Left Click Attack is on." - ) - default boolean shiftWalkAttackOption() - { - return true; - } -*/ - -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerPlugin.java deleted file mode 100644 index 7e9858769c..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/shiftwalker/ShiftWalkerPlugin.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2018, Plinko60 - * 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.shiftwalker; - -import com.google.inject.Provides; -import javax.inject.Inject; -import javax.inject.Singleton; -import lombok.AccessLevel; -import lombok.Setter; -import net.runelite.api.Client; -import net.runelite.api.GameState; -import net.runelite.api.MenuEntry; -import net.runelite.api.MenuOpcode; -import net.runelite.api.events.ClientTick; -import net.runelite.api.events.FocusChanged; -import net.runelite.api.events.GameStateChanged; -import net.runelite.client.config.ConfigManager; -import net.runelite.client.config.Keybind; -import net.runelite.client.eventbus.EventBus; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.events.ConfigChanged; -import net.runelite.client.input.KeyManager; -import net.runelite.client.menus.AbstractComparableEntry; -import net.runelite.client.menus.MenuManager; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; -import net.runelite.client.util.HotkeyListener; - -/** - * Shift Walker Plugin. Credit to MenuEntrySwapperPlugin for code some code structure used here. - */ -@PluginDescriptor( - name = "Shift Walk Under", - description = "Use Shift to toggle the Walk Here menu option. While pressed you will Walk rather than interact with objects.", - tags = {"npcs", "items", "objects"}, - type = PluginType.UTILITY, - enabledByDefault = false -) -@Singleton -public class ShiftWalkerPlugin extends Plugin -{ - - private static final AbstractComparableEntry WALK = new AbstractComparableEntry() - { - private final int hash = "WALK".hashCode() * 79 + getPriority(); - - @Override - public int hashCode() - { - return hash; - } - - @Override - public boolean equals(Object entry) - { - return entry.getClass() == this.getClass() && entry.hashCode() == this.hashCode(); - } - - @Override - public int getPriority() - { - return 99; - } - - @Override - public boolean matches(MenuEntry entry) - { - return - entry.getOpcode() == MenuOpcode.WALK.getId() || - entry.getOpcode() == MenuOpcode.WALK.getId() + MenuOpcode.MENU_ACTION_DEPRIORITIZE_OFFSET; - } - }; - - private static final AbstractComparableEntry TAKE = new AbstractComparableEntry() - { - private final int hash = "TAKE".hashCode() * 79 + getPriority(); - - @Override - public int hashCode() - { - return hash; - } - - @Override - public boolean equals(Object entry) - { - return entry.getClass() == this.getClass() && entry.hashCode() == this.hashCode(); - } - - @Override - public int getPriority() - { - return 100; - } - - @Override - public boolean matches(MenuEntry entry) - { - int opcode = entry.getOpcode(); - if (opcode > MenuOpcode.MENU_ACTION_DEPRIORITIZE_OFFSET) - { - opcode -= MenuOpcode.MENU_ACTION_DEPRIORITIZE_OFFSET; - } - - return - opcode >= MenuOpcode.GROUND_ITEM_FIRST_OPTION.getId() && - opcode <= MenuOpcode.GROUND_ITEM_FIFTH_OPTION.getId(); - } - }; - - private static final String EVENTBUS_THING = "shiftwalker shift"; - private static final String SHIFT_CHECK = "shiftwalker hotkey check"; - @Inject - private Client client; - @Inject - private ShiftWalkerConfig config; - @Inject - private MenuManager menuManager; - @Inject - private KeyManager keyManager; - @Inject - private EventBus eventBus; - @Setter(AccessLevel.PRIVATE) - private boolean hotkeyActive; - private boolean shiftWalk; - private boolean shiftLoot; - - @Provides - ShiftWalkerConfig provideConfig(ConfigManager configManager) - { - return configManager.getConfig(ShiftWalkerConfig.class); - } - - private final HotkeyListener shift = new HotkeyListener(() -> Keybind.SHIFT) - { - @Override - public void hotkeyPressed() - { - startPrioritizing(); - setHotkeyActive(true); - } - - @Override - public void hotkeyReleased() - { - stopPrioritizing(); - setHotkeyActive(false); - } - }; - - @Override - public void startUp() - { - this.shiftWalk = config.shiftWalk(); - this.shiftLoot = config.shiftLoot(); - if (client.getGameState() == GameState.LOGGED_IN) - { - keyManager.registerKeyListener(shift); - } - } - - @Override - public void shutDown() - { - keyManager.unregisterKeyListener(shift); - } - - @Subscribe - private void onGameStateChanged(GameStateChanged event) - { - if (event.getGameState() != GameState.LOGGED_IN) - { - keyManager.unregisterKeyListener(shift); - return; - } - keyManager.registerKeyListener(shift); - } - - @Subscribe - private void onFocusChanged(FocusChanged event) - { - if (!event.isFocused()) - { - stopPrioritizing(); - } - } - - @Subscribe - private void onConfigChanged(ConfigChanged event) - { - if (!event.getGroup().equals("shiftwalkhere")) - { - return; - } - - if ("shiftWalk".equals(event.getKey())) - { - this.shiftWalk = "true".equals(event.getNewValue()); - } - else - { - this.shiftLoot = "true".equals(event.getNewValue()); - } - } - - private void hotkeyCheck(ClientTick event) - { - if (hotkeyActive) - { - int i = 0; - for (boolean bol : client.getPressedKeys()) - { - if (bol) - { - i++; - } - } - if (i == 0) - { - stopPrioritizing(); - setHotkeyActive(false); - eventBus.unregister(SHIFT_CHECK); - } - } - } - - private void startPrioritizing() - { - eventBus.subscribe(ClientTick.class, EVENTBUS_THING, this::addEntries); - eventBus.subscribe(ClientTick.class, SHIFT_CHECK, this::hotkeyCheck); - } - - private void addEntries(ClientTick event) - { - if (this.shiftLoot) - { - menuManager.addPriorityEntry(TAKE); - } - if (this.shiftWalk) - { - menuManager.addPriorityEntry(WALK); - } - - eventBus.unregister(EVENTBUS_THING); - } - - private void stopPrioritizing() - { - eventBus.subscribe(ClientTick.class, EVENTBUS_THING, this::removeEntries); - } - - private void removeEntries(ClientTick event) - { - menuManager.removePriorityEntry(TAKE); - menuManager.removePriorityEntry(WALK); - eventBus.unregister(EVENTBUS_THING); - } -} From 9fc3f9f60bd38055ef718edc8984f8bc168f2218 Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Mon, 27 Jan 2020 01:57:20 +0000 Subject: [PATCH 13/17] Update MenuEntrySwapperPlugin.java --- .../client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index cdbf93e691..5a15504b65 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -368,7 +368,7 @@ public class MenuEntrySwapperPlugin extends Plugin private boolean swapWildernessLever; private boolean swapJewelleryBox; private boolean getSwapOffer; - private boolean hotKeyLoot; + private boolean hotKeyLoot; private boolean hotKeyWalk; private final HotkeyListener hotkey = new HotkeyListener(() -> this.hotkeyMod) { From 17f997a141cea738f81dec91c4ed40460bf157f8 Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Wed, 29 Jan 2020 11:46:11 +0000 Subject: [PATCH 14/17] pvpupdate: attackable pvp world levels from 15 to 10 (#2293) * Update MiscUtils.java * Update PvPUtil.java --- .../src/main/java/net/runelite/client/util/MiscUtils.java | 2 +- .../src/main/java/net/runelite/client/util/PvPUtil.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/util/MiscUtils.java b/runelite-client/src/main/java/net/runelite/client/util/MiscUtils.java index 29e7d7b93f..e489bdc20d 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/MiscUtils.java +++ b/runelite-client/src/main/java/net/runelite/client/util/MiscUtils.java @@ -70,7 +70,7 @@ public class MiscUtils if (client.getWorldType().stream().anyMatch(worldType -> worldType == WorldType.PVP || worldType == WorldType.HIGH_RISK)) { - wildernessLevel += 15; + wildernessLevel += 10; } return Math.max(0, wildernessLevel); diff --git a/runelite-client/src/main/java/net/runelite/client/util/PvPUtil.java b/runelite-client/src/main/java/net/runelite/client/util/PvPUtil.java index 03c2a1a07c..22b277b0d0 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/PvPUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/PvPUtil.java @@ -72,9 +72,9 @@ public class PvPUtil { if (client.getVar(Varbits.IN_WILDERNESS) != 1) { - return Math.abs(client.getLocalPlayer().getCombatLevel() - player.getCombatLevel()) <= 15; + return Math.abs(client.getLocalPlayer().getCombatLevel() - player.getCombatLevel()) <= 10; } - wildernessLevel = 15; + wildernessLevel = 10; } return Math.abs(client.getLocalPlayer().getCombatLevel() - player.getCombatLevel()) < (getWildernessLevelFrom(client.getLocalPlayer().getWorldLocation()) + wildernessLevel); From 295573119d85e77b1400d95f07afdc8412d3849c Mon Sep 17 00:00:00 2001 From: Thomas Cylke Date: Wed, 29 Jan 2020 06:50:43 -0500 Subject: [PATCH 15/17] theatre: fix nylo mes (#2284) * theatre: fix nylo mes * theatre: fix nylo mes * Delete WeaponMap.java * Delete WeaponStyle.java --- .../theatre/rooms/nylocas/NyloHandler.java | 119 ++- .../theatre/rooms/nylocas/Weapons.java | 72 -- .../net/runelite/client/util/WeaponMap.java | 735 ++++++++++++++++++ .../net/runelite/client/util/WeaponStyle.java | 6 + 4 files changed, 825 insertions(+), 107 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/Weapons.java create mode 100644 runelite-client/src/main/java/net/runelite/client/util/WeaponMap.java create mode 100644 runelite-client/src/main/java/net/runelite/client/util/WeaponStyle.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/NyloHandler.java b/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/NyloHandler.java index e87e99e37a..1cdd6341c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/NyloHandler.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/NyloHandler.java @@ -20,26 +20,36 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; +import net.runelite.api.MenuOpcode; import net.runelite.api.NPC; import net.runelite.api.Perspective; +import net.runelite.api.Player; +import net.runelite.api.PlayerAppearance; import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.MenuEntryAdded; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcSpawned; +import net.runelite.api.kit.KitType; import net.runelite.client.eventbus.EventBus; -import net.runelite.client.menus.AbstractComparableEntry; import net.runelite.client.menus.MenuManager; import net.runelite.client.plugins.theatre.RoomHandler; import net.runelite.client.plugins.theatre.TheatreConstant; import net.runelite.client.plugins.theatre.TheatrePlugin; import net.runelite.client.plugins.theatre.TheatreRoom; +import net.runelite.client.util.WeaponMap; +import net.runelite.client.util.WeaponStyle; +import org.apache.commons.lang3.ObjectUtils; @Slf4j public class NyloHandler extends RoomHandler { private static final String MESNAME = "tobmes"; + private static final String MAGE_NYLO = "Nylocas Hagios"; + private static final String RANGE_NYLO = "Nylocas Toxobolos"; + private static final String MELEE_NYLO = "Nylocas Ischyros"; final List waveSpawns = new ArrayList<>(); final List waveAgros = new ArrayList<>(); private final MenuManager menuManager; @@ -55,6 +65,8 @@ public class NyloHandler extends RoomHandler private int wave = 0; private NyloOverlay overlay = null; private NyloPredictor predictor = null; + private WeaponStyle currentWeaponStyle; + private boolean skipTickCheck = false; public NyloHandler(final Client client, final TheatrePlugin plugin, final MenuManager menuManager, final EventBus eventBus) { @@ -85,6 +97,7 @@ public class NyloHandler extends RoomHandler if (plugin.isNylocasMenuSwap()) { eventBus.subscribe(MenuOptionClicked.class, MESNAME, this::onMenuOptionClicked); + eventBus.subscribe(MenuEntryAdded.class, MESNAME, this::onMenuEntryAdded); } } @@ -126,7 +139,6 @@ public class NyloHandler extends RoomHandler this.waveSpawns.clear(); this.waveAgros.clear(); this.predictor.reset(); - menuManager.removeSwaps("Nylocas Hagios", "Nylocas Toxobolos", "Nylocas Ischyros"); } public void onConfigChanged() @@ -134,6 +146,7 @@ public class NyloHandler extends RoomHandler if (plugin.isNylocasMenuSwap()) { eventBus.subscribe(MenuOptionClicked.class, MESNAME, this::onMenuOptionClicked); + eventBus.subscribe(MenuEntryAdded.class, MESNAME, this::onMenuEntryAdded); } else { @@ -337,7 +350,7 @@ public class NyloHandler extends RoomHandler if (polygon != null) { graphics.setColor(color); - graphics.setStroke(new BasicStroke(2)); + graphics.setStroke(new BasicStroke(1)); graphics.draw(polygon); graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20)); graphics.fill(polygon); @@ -350,25 +363,42 @@ public class NyloHandler extends RoomHandler { return; } + if (skipTickCheck) + { + skipTickCheck = false; + } else { - boolean findPillar = false; - - for (NPC npc : client.getNpcs()) + Player p = client.getLocalPlayer(); + if (p == null) { - if (npc.getId() == 8358) - { - findPillar = true; - break; - } - } - - if (!findPillar) - { - this.onStop(); return; } + PlayerAppearance pa = p.getPlayerAppearance(); + if (pa == null) + { + return; + } + int weaponID = ObjectUtils.defaultIfNull(pa.getEquipmentId(KitType.WEAPON), -1); + currentWeaponStyle = WeaponMap.StyleMap.get(weaponID); } + boolean findPillar = false; + + for (NPC npc : client.getNpcs()) + { + if (npc.getId() == 8358) + { + findPillar = true; + break; + } + } + + if (!findPillar) + { + this.onStop(); + return; + } + for (NPC spider : new ArrayList<>(spiders.keySet())) { @@ -396,23 +426,49 @@ public class NyloHandler extends RoomHandler private void onMenuOptionClicked(MenuOptionClicked event) { - final String option = event.getOption().toLowerCase(); - - if (!option.equals("equip") && !option.equals("wield") && !option.equals("hold")) + int opcode = event.getOpcode(); + if (opcode == MenuOpcode.ITEM_SECOND_OPTION.getId()) { - return; + WeaponStyle newStyle = WeaponMap.StyleMap.get(event.getIdentifier()); + if (newStyle != null) + { + skipTickCheck = true; + currentWeaponStyle = newStyle; + } } + } - final int id = event.getIdentifier(); - final Set entries = Weapons.getEntries(id); - menuManager.removeSwaps("Nylocas Hagios", "Nylocas Toxobolos", "Nylocas Ischyros"); - - if (entries.isEmpty()) + private void onMenuEntryAdded(MenuEntryAdded event) + { + if (plugin.isNylocasMenuSwap()) { - return; + if (event.getOpcode() == MenuOpcode.NPC_SECOND_OPTION.getId() && event.getOption().equals("Attack")) + { + String target = event.getTarget(); + switch (currentWeaponStyle) + { + case MAGIC: + if (target.equals(RANGE_NYLO) || target.equals(MELEE_NYLO)) + { + client.setMenuOptionCount(client.getMenuOptionCount() - 1); + } + break; + case RANGE: + if (target.contains(MAGE_NYLO) || target.contains(MELEE_NYLO)) + { + client.setMenuOptionCount(client.getMenuOptionCount() - 1); + } + break; + case MELEE: + if (target.contains(MAGE_NYLO) || target.contains(RANGE_NYLO)) + { + client.setMenuOptionCount(client.getMenuOptionCount() - 1); + } + break; + default: + } + } } - - entries.forEach(menuManager::addHiddenEntry); } private void recalculateLocal() @@ -447,11 +503,4 @@ public class NyloHandler extends RoomHandler } } - private enum AttackStyle - { - MELEE, - MAGE, - RANGE, - RANGE2H - } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/Weapons.java b/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/Weapons.java deleted file mode 100644 index 6883fe0840..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/theatre/rooms/nylocas/Weapons.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.runelite.client.plugins.theatre.rooms.nylocas; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import javax.annotation.Nullable; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Getter; -import net.runelite.api.ItemID; -import net.runelite.client.menus.AbstractComparableEntry; -import net.runelite.client.menus.ComparableEntries; - -@Getter(AccessLevel.PACKAGE) -@AllArgsConstructor -public enum Weapons -{ - MELEE(ImmutableSet.of(ItemID.ABYSSAL_WHIP, ItemID.ABYSSAL_TENTACLE, ItemID.SCYTHE_OF_VITUR, - ItemID.SCYTHE_OF_VITUR_22664, ItemID.SCYTHE_OF_VITUR_UNCHARGED, ItemID.HAM_JOINT, ItemID.SWIFT_BLADE, - ItemID.BANDOS_GODSWORD, ItemID.BANDOS_GODSWORD_20782, ItemID.BANDOS_GODSWORD_21060, ItemID.BANDOS_GODSWORD_OR, - ItemID.DRAGON_WARHAMMER, ItemID.DRAGON_CLAWS, ItemID.EVENT_RPG, ItemID.GHRAZI_RAPIER, ItemID.GHRAZI_RAPIER_23628, - ItemID.BLADE_OF_SAELDOR, ItemID.CRYSTAL_HALBERD, ItemID.DRAGON_SCIMITAR, ItemID.RUNE_SCIMITAR, ItemID.BLADE_OF_SAELDOR_23996, - ItemID.BLADE_OF_SAELDOR_INACTIVE, ItemID.BLADE_OF_SAELDOR_INACTIVE_23999), - ImmutableSet.of(ComparableEntries.newBaseComparableEntry("Attack", "Nylocas Hagios"), - ComparableEntries.newBaseComparableEntry("Attack", "Nylocas Toxobolos")) - ), - MAGE(ImmutableSet.of(ItemID.KODAI_WAND, ItemID.MASTER_WAND, ItemID.TRIDENT_OF_THE_SEAS, - ItemID.TRIDENT_OF_THE_SWAMP, ItemID.SANGUINESTI_STAFF, ItemID.IBANS_STAFF, ItemID.IBANS_STAFF_1410, - ItemID.IBANS_STAFF_U, ItemID.TRIDENT_OF_THE_SWAMP_E, ItemID.TRIDENT_OF_THE_SEAS_E), - ImmutableSet.of(ComparableEntries.newBaseComparableEntry("Attack", "Nylocas Ischyros"), - ComparableEntries.newBaseComparableEntry("Attack", "Nylocas Toxobolos")) - ), - RANGE(ImmutableSet.of(ItemID.TOXIC_BLOWPIPE, ItemID.TWISTED_BOW, ItemID.CRAWS_BOW, - ItemID.RED_CHINCHOMPA, ItemID.CHINCHOMPA, ItemID.BLACK_CHINCHOMPA, ItemID.ARMADYL_CROSSBOW, - ItemID.DRAGON_CROSSBOW, ItemID.RUNE_CROSSBOW, ItemID.DORGESHUUN_CROSSBOW), - ImmutableSet.of(ComparableEntries.newBaseComparableEntry("Attack", "Nylocas Hagios"), - ComparableEntries.newBaseComparableEntry("Attack", "Nylocas Ischyros")) - ); - - private final Set ids; - private final Set entries; - private static final Map, Set> map; - - static - { - final ImmutableMap.Builder, Set> builder = new ImmutableMap.Builder<>(); - for (Weapons weps : Weapons.values()) - { - builder.put(weps.getIds(), weps.getEntries()); - } - map = builder.build(); - } - - @Nullable - static Set getEntries(int id) - { - final Set entries = new HashSet<>(); - - for (Map.Entry, Set> entry : map.entrySet()) - { - if (entry.getKey().contains(id)) - { - entries.addAll(entry.getValue()); - break; - } - } - - return entries; - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/util/WeaponMap.java b/runelite-client/src/main/java/net/runelite/client/util/WeaponMap.java new file mode 100644 index 0000000000..300c4a6e43 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/util/WeaponMap.java @@ -0,0 +1,735 @@ +package net.runelite.client.util; + +import java.util.HashMap; +import net.runelite.api.ItemID; + +public class WeaponMap +{ + public static HashMap StyleMap = new HashMap<>(); + + static + { + //Melee + StyleMap.put(ItemID._3RD_AGE_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID._3RD_AGE_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID._3RD_AGE_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_BLUDGEON, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_DAGGER_P, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_DAGGER_P_13269, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_DAGGER_P_13271, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_TENTACLE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ABYSSAL_WHIP, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_CANE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_DAGGERP_5676, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_DAGGERP_5694, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_SPEARP_5712, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_SPEARP_5726, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ADAMANT_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.ALE_OF_THE_GODS, WeaponStyle.MELEE); + StyleMap.put(ItemID.ANCIENT_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ARMADYL_GODSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ARMADYL_GODSWORD_OR, WeaponStyle.MELEE); + StyleMap.put(ItemID.ARMADYL_GODSWORD_20593, WeaponStyle.MELEE); + StyleMap.put(ItemID.ARMADYL_GODSWORD_22665, WeaponStyle.MELEE); + StyleMap.put(ItemID.ARCLIGHT, WeaponStyle.MELEE); + StyleMap.put(ItemID.BANDOS_GODSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BANDOS_GODSWORD_OR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BANDOS_GODSWORD_20782, WeaponStyle.MELEE); + StyleMap.put(ItemID.BANDOS_GODSWORD_21060, WeaponStyle.MELEE); + StyleMap.put(ItemID.BARBTAIL_HARPOON, WeaponStyle.MELEE); + StyleMap.put(ItemID.BARRELCHEST_ANCHOR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_CANE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_DAGGERP_5682, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_DAGGERP_5700, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SALAMANDER, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SPEARP_5734, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SPEARP_5736, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLESSED_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLADE_OF_SAELDOR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLURITE_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BONE_CLUB, WeaponStyle.MELEE); + StyleMap.put(ItemID.BONE_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.BONE_DAGGER_P, WeaponStyle.MELEE); + StyleMap.put(ItemID.BONE_DAGGER_P_8876, WeaponStyle.MELEE); + StyleMap.put(ItemID.BONE_DAGGER_P_8878, WeaponStyle.MELEE); + StyleMap.put(ItemID.BONE_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BOXING_GLOVES, WeaponStyle.MELEE); + StyleMap.put(ItemID.BOXING_GLOVES_7673, WeaponStyle.MELEE); + StyleMap.put(ItemID.BEACH_BOXING_GLOVES, WeaponStyle.MELEE); + StyleMap.put(ItemID.BEACH_BOXING_GLOVES_11706, WeaponStyle.MELEE); + StyleMap.put(ItemID.PET_ROCK, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRINE_SABRE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_DAGGERP_5670, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_DAGGERP_5688, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_SPEARP_5704, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_SPEARP_5718, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRONZE_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.BRUMA_TORCH, WeaponStyle.MELEE); + StyleMap.put(ItemID.CATTLEPROD, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRIER_BELL, WeaponStyle.MELEE); + StyleMap.put(ItemID.NEW_CRYSTAL_HALBERD_FULL_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_FULL_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_910_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_810_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_710_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_610_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_510_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_410_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_310_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_210_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_110_I, WeaponStyle.MELEE); + StyleMap.put(ItemID.NEW_CRYSTAL_HALBERD_FULL, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_FULL, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_910, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_810, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_710, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_610, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_510, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_410, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_310, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_210, WeaponStyle.MELEE); + StyleMap.put(ItemID.CRYSTAL_HALBERD_110, WeaponStyle.MELEE); + StyleMap.put(ItemID.CURSED_GOBLIN_HAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.DARK_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.DARKLIGHT, WeaponStyle.MELEE); + StyleMap.put(ItemID.DECORATIVE_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.DECORATIVE_SWORD_4503, WeaponStyle.MELEE); + StyleMap.put(ItemID.DECORATIVE_SWORD_4508, WeaponStyle.MELEE); + StyleMap.put(ItemID.DHAROKS_GREATAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DHAROKS_GREATAXE_100, WeaponStyle.MELEE); + StyleMap.put(ItemID.DHAROKS_GREATAXE_75, WeaponStyle.MELEE); + StyleMap.put(ItemID.DHAROKS_GREATAXE_50, WeaponStyle.MELEE); + StyleMap.put(ItemID.DHAROKS_GREATAXE_25, WeaponStyle.MELEE); + StyleMap.put(ItemID.DHAROKS_GREATAXE_0, WeaponStyle.MELEE); + StyleMap.put(ItemID.DINHS_BULWARK, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_2H_SWORD_20559, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_CANE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_CLAWS_20784, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_DAGGERP_5680, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_DAGGERP_5698, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HARPOON, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HASTAP, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HASTAP_22737, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HASTAP_22740, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HASTAKP, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_HUNTER_LANCE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_PICKAXE_12797, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SCIMITAR_OR, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SCIMITAR_20406, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SPEARP_5716, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SPEARP_5730, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.DRAGON_WARHAMMER_20785, WeaponStyle.MELEE); + StyleMap.put(ItemID.EXCALIBUR, WeaponStyle.MELEE); + StyleMap.put(ItemID.EXCALIBUR_8280, WeaponStyle.MELEE); + StyleMap.put(ItemID.ELDER_MAUL, WeaponStyle.MELEE); + StyleMap.put(ItemID.ELDER_MAUL_21205, WeaponStyle.MELEE); + StyleMap.put(ItemID.EVENT_RPG, WeaponStyle.MELEE); + StyleMap.put(ItemID.FLAMTAER_HAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.FREMENNIK_BLADE, WeaponStyle.MELEE); + StyleMap.put(ItemID.FROZEN_ABYSSAL_WHIP, WeaponStyle.MELEE); + StyleMap.put(ItemID.GADDERHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.GHRAZI_RAPIER, WeaponStyle.MELEE); + StyleMap.put(ItemID.GOLDEN_TENCH, WeaponStyle.MELEE); + StyleMap.put(ItemID.GILDED_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.GILDED_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.GILDED_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.GILDED_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.GLOWING_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.GRANITE_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.GRANITE_HAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.GRANITE_MAUL, WeaponStyle.MELEE); + StyleMap.put(ItemID.GRANITE_MAUL_12848, WeaponStyle.MELEE); + StyleMap.put(ItemID.GRANITE_MAUL_20557, WeaponStyle.MELEE); + StyleMap.put(ItemID.GUTHANS_WARSPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.GUTHANS_WARSPEAR_100, WeaponStyle.MELEE); + StyleMap.put(ItemID.GUTHANS_WARSPEAR_75, WeaponStyle.MELEE); + StyleMap.put(ItemID.GUTHANS_WARSPEAR_50, WeaponStyle.MELEE); + StyleMap.put(ItemID.GUTHANS_WARSPEAR_25, WeaponStyle.MELEE); + StyleMap.put(ItemID.GUTHANS_WARSPEAR_0, WeaponStyle.MELEE); + StyleMap.put(ItemID.HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.HAND_FAN, WeaponStyle.MELEE); + StyleMap.put(ItemID.INFERNAL_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.INFERNAL_AXE_UNCHARGED, WeaponStyle.MELEE); + StyleMap.put(ItemID.INFERNAL_HARPOON, WeaponStyle.MELEE); + StyleMap.put(ItemID.INFERNAL_HARPOON_UNCHARGED, WeaponStyle.MELEE); + StyleMap.put(ItemID.INFERNAL_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.INFERNAL_PICKAXE_UNCHARGED, WeaponStyle.MELEE); + StyleMap.put(ItemID.BUTTERFLY_NET, WeaponStyle.MELEE); + StyleMap.put(ItemID.HILL_GIANT_CLUB, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUBBER_CHICKEN, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUBBER_CHICKEN_10732, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUBBER_CHICKEN_22666, WeaponStyle.MELEE); + StyleMap.put(ItemID.OILY_FISHING_ROD, WeaponStyle.MELEE); + StyleMap.put(ItemID.OILY_PEARL_FISHING_ROD, WeaponStyle.MELEE); + StyleMap.put(ItemID.SARAS_BLESSED_SWORD_FULL, WeaponStyle.MELEE); + StyleMap.put(ItemID.GREEN_BANNER, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_DAGGERP_5668, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_DAGGERP_5686, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_SPEARP_5706, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_SPEARP_5720, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.IRON_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.KATANA, WeaponStyle.MELEE); + StyleMap.put(ItemID.KERIS, WeaponStyle.MELEE); + StyleMap.put(ItemID.LEAFBLADED_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.LEAFBLADED_SPEAR_4159, WeaponStyle.MELEE); + StyleMap.put(ItemID.LEAFBLADED_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.LEAFBLADED_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.LYRE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ENCHANTED_LYRE, WeaponStyle.MELEE); + StyleMap.put(ItemID.ENCHANTED_LYRE5, WeaponStyle.MELEE); + StyleMap.put(ItemID.ENCHANTED_LYRE4, WeaponStyle.MELEE); + StyleMap.put(ItemID.ENCHANTED_LYRE3, WeaponStyle.MELEE); + StyleMap.put(ItemID.ENCHANTED_LYRE2, WeaponStyle.MELEE); + StyleMap.put(ItemID.ENCHANTED_LYRE1, WeaponStyle.MELEE); + StyleMap.put(ItemID.MAGIC_SECATEURS, WeaponStyle.MELEE); + StyleMap.put(ItemID.MAGIC_SECATEURS_NZ, WeaponStyle.MELEE); + StyleMap.put(ItemID.MAGIC_BUTTERFLY_NET, WeaponStyle.MELEE); + StyleMap.put(ItemID.MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.MERFOLK_TRIDENT, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_DAGGERP_5674, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_DAGGERP_5692, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_SPEARP_5710, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_SPEARP_5724, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.MITHRIL_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.MIXED_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.RED_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.ASSORTED_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLACK_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLUE_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.ORANGE_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.PURPLE_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.YELLOW_FLOWERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.BLUE_FLOWERS_8936, WeaponStyle.MELEE); + StyleMap.put(ItemID.RED_FLOWERS_8938, WeaponStyle.MELEE); + StyleMap.put(ItemID.MOUSE_TOY, WeaponStyle.MELEE); + StyleMap.put(ItemID.NUNCHAKU, WeaponStyle.MELEE); + StyleMap.put(ItemID.ORANGE_SALAMANDER, WeaponStyle.MELEE); + StyleMap.put(ItemID.CHAOTIC_HANDEGG, WeaponStyle.MELEE); + StyleMap.put(ItemID.PEACEFUL_HANDEGG, WeaponStyle.MELEE); + StyleMap.put(ItemID.HOLY_HANDEGG, WeaponStyle.MELEE); + StyleMap.put(ItemID.PROP_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.MEAT_TENDERISER, WeaponStyle.MELEE); + StyleMap.put(ItemID.STONE_BOWL, WeaponStyle.MELEE); + StyleMap.put(ItemID.MACHETE, WeaponStyle.MELEE); + StyleMap.put(ItemID.JADE_MACHETE, WeaponStyle.MELEE); + StyleMap.put(ItemID.OPAL_MACHETE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RED_TOPAZ_MACHETE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAPIER, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE_6774, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE_6775, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE_6776, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE_6777, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE_6778, WeaponStyle.MELEE); + StyleMap.put(ItemID.RAT_POLE_6779, WeaponStyle.MELEE); + StyleMap.put(ItemID.RED_SALAMANDER, WeaponStyle.MELEE); + StyleMap.put(ItemID.ROCK_HAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.ROYAL_SCEPTRE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_CANE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_DAGGERP_5678, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_DAGGERP_5696, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_SPEARP_5714, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_SPEARP_5728, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.SARADOMIN_GODSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.SARADOMIN_GODSWORD_OR, WeaponStyle.MELEE); + StyleMap.put(ItemID.SARADOMIN_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.SARADOMIN_MJOLNIR, WeaponStyle.MELEE); + StyleMap.put(ItemID.SARADOMINS_BLESSED_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.SHADOW_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.SCYTHE, WeaponStyle.MELEE); + StyleMap.put(ItemID.SCYTHE_10735, WeaponStyle.MELEE); + StyleMap.put(ItemID.SCYTHE_OF_VITUR, WeaponStyle.MELEE); + StyleMap.put(ItemID.SCYTHE_OF_VITUR_UNCHARGED, WeaponStyle.MELEE); + StyleMap.put(ItemID.SCYTHE_OF_VITUR_22664, WeaponStyle.MELEE); + StyleMap.put(ItemID.SILVER_SICKLE, WeaponStyle.MELEE); + StyleMap.put(ItemID.SILVER_SICKLE_B, WeaponStyle.MELEE); + StyleMap.put(ItemID.SILVERLIGHT, WeaponStyle.MELEE); + StyleMap.put(ItemID.SILVERLIGHT_6745, WeaponStyle.MELEE); + StyleMap.put(ItemID.SILVERLIGHT_8279, WeaponStyle.MELEE); + StyleMap.put(ItemID.SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_AXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_DAGGERP_5672, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_DAGGERP_5690, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_PICKAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_SPEARP, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_SPEARP_5708, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_SPEARP_5722, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.STEEL_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.SWAMP_LIZARD, WeaponStyle.MELEE); + StyleMap.put(ItemID.TOKTZXILAK, WeaponStyle.MELEE); + StyleMap.put(ItemID.TOKTZXILAK_20554, WeaponStyle.MELEE); + StyleMap.put(ItemID.TOKTZXILEK, WeaponStyle.MELEE); + StyleMap.put(ItemID.TORAGS_HAMMERS, WeaponStyle.MELEE); + StyleMap.put(ItemID.TORAGS_HAMMERS_100, WeaponStyle.MELEE); + StyleMap.put(ItemID.TORAGS_HAMMERS_75, WeaponStyle.MELEE); + StyleMap.put(ItemID.TORAGS_HAMMERS_50, WeaponStyle.MELEE); + StyleMap.put(ItemID.TORAGS_HAMMERS_25, WeaponStyle.MELEE); + StyleMap.put(ItemID.TORAGS_HAMMERS_0, WeaponStyle.MELEE); + StyleMap.put(ItemID.TRAINING_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.TZHAARKETEM, WeaponStyle.MELEE); + StyleMap.put(ItemID.TZHAARKETOM, WeaponStyle.MELEE); + StyleMap.put(ItemID.VERACS_FLAIL, WeaponStyle.MELEE); + StyleMap.put(ItemID.VERACS_FLAIL_100, WeaponStyle.MELEE); + StyleMap.put(ItemID.VERACS_FLAIL_75, WeaponStyle.MELEE); + StyleMap.put(ItemID.VERACS_FLAIL_50, WeaponStyle.MELEE); + StyleMap.put(ItemID.VERACS_FLAIL_25, WeaponStyle.MELEE); + StyleMap.put(ItemID.VERACS_FLAIL_0, WeaponStyle.MELEE); + StyleMap.put(ItemID.VIGGORAS_CHAINMACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.VIGGORAS_CHAINMACE_U, WeaponStyle.MELEE); + StyleMap.put(ItemID.VOLCANIC_ABYSSAL_WHIP, WeaponStyle.MELEE); + StyleMap.put(ItemID.WESTERN_BANNER_1, WeaponStyle.MELEE); + StyleMap.put(ItemID.WESTERN_BANNER_2, WeaponStyle.MELEE); + StyleMap.put(ItemID.WESTERN_BANNER_3, WeaponStyle.MELEE); + StyleMap.put(ItemID.WESTERN_BANNER_4, WeaponStyle.MELEE); + StyleMap.put(ItemID.ARCEUUS_BANNER, WeaponStyle.MELEE); + StyleMap.put(ItemID.HOSIDIUS_BANNER, WeaponStyle.MELEE); + StyleMap.put(ItemID.LOVAKENGJ_BANNER, WeaponStyle.MELEE); + StyleMap.put(ItemID.PISCARILIUS_BANNER, WeaponStyle.MELEE); + StyleMap.put(ItemID.SHAYZIEN_BANNER, WeaponStyle.MELEE); + StyleMap.put(ItemID.EASTER_BASKET, WeaponStyle.MELEE); + StyleMap.put(ItemID.TROLLWEISS, WeaponStyle.MELEE); + StyleMap.put(ItemID.SNOWBALL, WeaponStyle.MELEE); + StyleMap.put(ItemID.STALE_BAGUETTE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.RUNE_BATTLEAXE_20552, WeaponStyle.MELEE); + StyleMap.put(ItemID.LARGE_SPADE, WeaponStyle.MELEE); + StyleMap.put(ItemID.CANDY_CANE, WeaponStyle.MELEE); + StyleMap.put(ItemID.WOODEN_SPOON, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_2H_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_BATTLEAXE, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_CLAWS, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_DAGGER, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_DAGGERP, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_DAGGERP_6595, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_DAGGERP_6597, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_HALBERD, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_LONGSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_MACE, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_SCIMITAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.WHITE_WARHAMMER, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILDERNESS_SWORD_1, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILDERNESS_SWORD_2, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILDERNESS_SWORD_3, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILDERNESS_SWORD_4, WeaponStyle.MELEE); + StyleMap.put(ItemID.WOLFBANE, WeaponStyle.MELEE); + StyleMap.put(ItemID.WOODEN_SWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ZAMORAK_GODSWORD, WeaponStyle.MELEE); + StyleMap.put(ItemID.ZAMORAK_GODSWORD_OR, WeaponStyle.MELEE); + StyleMap.put(ItemID.ZAMORAKIAN_HASTA, WeaponStyle.MELEE); + StyleMap.put(ItemID.ZAMORAKIAN_SPEAR, WeaponStyle.MELEE); + StyleMap.put(ItemID.ZOMBIE_HEAD, WeaponStyle.MELEE); + StyleMap.put(ItemID.OAK_BLACKJACK, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILLOW_BLACKJACK, WeaponStyle.MELEE); + StyleMap.put(ItemID.MAPLE_BLACKJACK, WeaponStyle.MELEE); + StyleMap.put(ItemID.OAK_BLACKJACKD, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILLOW_BLACKJACKD, WeaponStyle.MELEE); + StyleMap.put(ItemID.MAPLE_BLACKJACKD, WeaponStyle.MELEE); + StyleMap.put(ItemID.OAK_BLACKJACKO, WeaponStyle.MELEE); + StyleMap.put(ItemID.WILLOW_BLACKJACKO, WeaponStyle.MELEE); + StyleMap.put(ItemID.MAPLE_BLACKJACKO, WeaponStyle.MELEE); + StyleMap.put(ItemID.BIRTHDAY_BALLOONS, WeaponStyle.MELEE); + StyleMap.put(ItemID.BIRTHDAY_CAKE, WeaponStyle.MELEE); + StyleMap.put(ItemID.NOOSE_WAND, WeaponStyle.MELEE); + + //Ranged + StyleMap.put(ItemID._3RD_AGE_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_DARTP_5633, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_DARTP_5640, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_KNIFEP_5659, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_KNIFEP_5666, WeaponStyle.RANGE); + StyleMap.put(ItemID.ADAMANT_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.ARMADYL_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_CHINCHOMPA, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_DARTP_5631, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_DARTP_5638, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_KNIFEP_5658, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLACK_KNIFEP_5665, WeaponStyle.RANGE); + StyleMap.put(ItemID.BLURITE_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_DARTP_5628, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_DARTP_5635, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_KNIFEP_5654, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_KNIFEP_5661, WeaponStyle.RANGE); + StyleMap.put(ItemID.BRONZE_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.CHINCHOMPA, WeaponStyle.RANGE); + StyleMap.put(ItemID.CHINCHOMPA_10033, WeaponStyle.RANGE); + StyleMap.put(ItemID.COMP_OGRE_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRAWS_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRAWS_BOW_U, WeaponStyle.RANGE); + StyleMap.put(ItemID.CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.NEW_CRYSTAL_BOW_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_FULL_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_910_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_810_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_710_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_610_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_510_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_410_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_310_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_210_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_110_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.NEW_CRYSTAL_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_FULL, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_910, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_810, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_710, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_610, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_510, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_410, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_310, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_210, WeaponStyle.RANGE); + StyleMap.put(ItemID.CRYSTAL_BOW_110, WeaponStyle.RANGE); + StyleMap.put(ItemID.CURSED_GOBLIN_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.DARK_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.DARK_BOW_12765, WeaponStyle.RANGE); + StyleMap.put(ItemID.DARK_BOW_12766, WeaponStyle.RANGE); + StyleMap.put(ItemID.DARK_BOW_12767, WeaponStyle.RANGE); + StyleMap.put(ItemID.DARK_BOW_12768, WeaponStyle.RANGE); + StyleMap.put(ItemID.DARK_BOW_20408, WeaponStyle.RANGE); + StyleMap.put(ItemID.DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.DORGESHUUN_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_DARTP_11233, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_DARTP_11234, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_HUNTER_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_KNIFEP_22808, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_KNIFEP_22810, WeaponStyle.RANGE); + StyleMap.put(ItemID.DRAGON_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.HEAVY_BALLISTA, WeaponStyle.RANGE); + StyleMap.put(ItemID.HOLY_WATER, WeaponStyle.RANGE); + StyleMap.put(ItemID.HUNTERS_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_DARTP_5629, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_DARTP_5636, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_KNIFEP_5655, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_KNIFEP_5662, WeaponStyle.RANGE); + StyleMap.put(ItemID.IRON_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.KARILS_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.KARILS_CROSSBOW_100, WeaponStyle.RANGE); + StyleMap.put(ItemID.KARILS_CROSSBOW_75, WeaponStyle.RANGE); + StyleMap.put(ItemID.KARILS_CROSSBOW_50, WeaponStyle.RANGE); + StyleMap.put(ItemID.KARILS_CROSSBOW_25, WeaponStyle.RANGE); + StyleMap.put(ItemID.KARILS_CROSSBOW_0, WeaponStyle.RANGE); + StyleMap.put(ItemID.LIGHT_BALLISTA, WeaponStyle.RANGE); + StyleMap.put(ItemID.LONGBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAGIC_COMP_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAGIC_LONGBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAGIC_SHORTBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAGIC_SHORTBOW_I, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAGIC_SHORTBOW_20558, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAPLE_LONGBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MAPLE_SHORTBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITH_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_DARTP_5632, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_DARTP_5639, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_KNIFEP_5657, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_KNIFEP_5664, WeaponStyle.RANGE); + StyleMap.put(ItemID.MITHRIL_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.MONKEY_TALISMAN, WeaponStyle.RANGE); + StyleMap.put(ItemID.MORRIGANS_THROWING_AXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.MORRIGANS_JAVELIN, WeaponStyle.RANGE); + StyleMap.put(ItemID.MUD_PIE, WeaponStyle.RANGE); + StyleMap.put(ItemID.OAK_LONGBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.OAK_SHORTBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.OGRE_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.PHOENIX_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.RED_CHINCHOMPA, WeaponStyle.RANGE); + StyleMap.put(ItemID.RED_CHINCHOMPA_10034, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_DARTP_5634, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_DARTP_5641, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_KNIFEP_5660, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_KNIFEP_5667, WeaponStyle.RANGE); + StyleMap.put(ItemID.RUNE_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.SEERCULL, WeaponStyle.RANGE); + StyleMap.put(ItemID.SHORTBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.SIGNED_OAK_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.STARTER_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_CROSSBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_DART, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_DARTP, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_DARTP_5630, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_DARTP_5637, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_KNIFE, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_KNIFEP, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_KNIFEP_5656, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_KNIFEP_5663, WeaponStyle.RANGE); + StyleMap.put(ItemID.STEEL_THROWNAXE, WeaponStyle.RANGE); + StyleMap.put(ItemID.TOKTZXILUL, WeaponStyle.RANGE); + StyleMap.put(ItemID.TOXIC_BLOWPIPE, WeaponStyle.RANGE); + StyleMap.put(ItemID.TOXIC_BLOWPIPE_EMPTY, WeaponStyle.RANGE); + StyleMap.put(ItemID.TRAINING_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.TWISTED_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.WILLOW_COMP_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.WILLOW_LONGBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.WILLOW_SHORTBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.YEW_COMP_BOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.YEW_LONGBOW, WeaponStyle.RANGE); + StyleMap.put(ItemID.YEW_SHORTBOW, WeaponStyle.RANGE); + + //Magic + StyleMap.put(ItemID._3RD_AGE_WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AHRIMS_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AHRIMS_STAFF_100, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AHRIMS_STAFF_75, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AHRIMS_STAFF_50, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AHRIMS_STAFF_25, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AHRIMS_STAFF_0, WeaponStyle.MAGIC); + StyleMap.put(ItemID.AIR_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ANCIENT_CROZIER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ANCIENT_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.APPRENTICE_WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ARMADYL_CROZIER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.BANDOS_CROZIER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.BEGINNER_WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.BROKEN_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.BRYOPHYTAS_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.BRYOPHYTAS_STAFF_UNCHARGED, WeaponStyle.MAGIC); + StyleMap.put(ItemID.CURSED_GOBLIN_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.DAWNBRINGER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.DRAMEN_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.DUST_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.EARTH_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.FIRE_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.GUTHIX_CROZIER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.GUTHIX_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.IBANS_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.IBANS_STAFF_U, WeaponStyle.MAGIC); + StyleMap.put(ItemID.IBANS_STAFF_1410, WeaponStyle.MAGIC); + StyleMap.put(ItemID.IVANDIS_FLAIL, WeaponStyle.MAGIC); + StyleMap.put(ItemID.KODAI_WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.LAVA_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.LAVA_BATTLESTAFF_21198, WeaponStyle.MAGIC); + StyleMap.put(ItemID.LUNAR_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MAGIC_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MASTER_WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MASTER_WAND_20560, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MIST_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MUD_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_AIR_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_DUST_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_EARTH_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_FIRE_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_LAVA_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_LAVA_STAFF_21200, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_MIST_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_MUD_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_SMOKE_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_STEAM_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_STEAM_STAFF_12796, WeaponStyle.MAGIC); + StyleMap.put(ItemID.MYSTIC_WATER_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_8, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_7, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_6, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_5, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_4, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_3, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_2, WeaponStyle.MAGIC); + StyleMap.put(ItemID.PHARAOHS_SCEPTRE_1, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_10, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_9, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_8, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_7, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_6, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_5, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_4, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_3, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_2, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ROD_OF_IVANDIS_1, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SANGUINESTI_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SANGUINESTI_STAFF_UNCHARGED, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SARADOMIN_CROZIER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SARADOMIN_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SKULL_SCEPTRE, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SKULL_SCEPTRE_I, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SLAYERS_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SLAYERS_STAFF_E, WeaponStyle.MAGIC); + StyleMap.put(ItemID.SMOKE_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF_OF_AIR, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF_OF_EARTH, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF_OF_FIRE, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF_OF_LIGHT, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF_OF_THE_DEAD, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STAFF_OF_WATER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STARTER_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STEAM_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.STEAM_BATTLESTAFF_12795, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TEACHER_WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.THAMMARONS_SCEPTRE, WeaponStyle.MAGIC); + StyleMap.put(ItemID.THAMMARONS_SCEPTRE_U, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TOKTZMEJTAL, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TOXIC_STAFF_OF_THE_DEAD, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TOXIC_STAFF_UNCHARGED, WeaponStyle.MAGIC); + StyleMap.put(ItemID.UNCHARGED_TRIDENT, WeaponStyle.MAGIC); + StyleMap.put(ItemID.UNCHARGED_TRIDENT_E, WeaponStyle.MAGIC); + StyleMap.put(ItemID.UNCHARGED_TOXIC_TRIDENT, WeaponStyle.MAGIC); + StyleMap.put(ItemID.UNCHARGED_TOXIC_TRIDENT_E, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TRIDENT_OF_THE_SEAS, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TRIDENT_OF_THE_SEAS_E, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TRIDENT_OF_THE_SEAS_FULL, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TRIDENT_OF_THE_SWAMP, WeaponStyle.MAGIC); + StyleMap.put(ItemID.TRIDENT_OF_THE_SWAMP_E, WeaponStyle.MAGIC); + StyleMap.put(ItemID.VOID_KNIGHT_MACE, WeaponStyle.MAGIC); + StyleMap.put(ItemID.VOID_KNIGHT_MACE_BROKEN, WeaponStyle.MAGIC); + StyleMap.put(ItemID.WAND, WeaponStyle.MAGIC); + StyleMap.put(ItemID.WATER_BATTLESTAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.WHITE_MAGIC_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ZAMORAK_CROZIER, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ZAMORAK_STAFF, WeaponStyle.MAGIC); + StyleMap.put(ItemID.ZURIELS_STAFF, WeaponStyle.MAGIC); + //what the fuck... + StyleMap.put(ItemID.GNOMEBALL, WeaponStyle.MAGIC); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/util/WeaponStyle.java b/runelite-client/src/main/java/net/runelite/client/util/WeaponStyle.java new file mode 100644 index 0000000000..f5e2a03cde --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/util/WeaponStyle.java @@ -0,0 +1,6 @@ +package net.runelite.client.util; + +public enum WeaponStyle +{ + MAGIC, RANGE, MELEE +} From 5f7480ff4b61b02bfa188c97129967b961c40239 Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Wed, 29 Jan 2020 12:27:57 +0000 Subject: [PATCH 16/17] Update NpcIndicatorsPluginTest.java --- .../client/plugins/npchighlight/NpcIndicatorsPluginTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java index 9fdaced8d3..ccb8fb0451 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPluginTest.java @@ -34,7 +34,6 @@ import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.client.config.OpenOSRSConfig; import static org.junit.Assert.assertEquals; - import net.runelite.client.Notifier; import org.junit.Before; import org.junit.Test; From 9d01f462b3fe4cf0facfe910f15e902f6cea6372 Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Wed, 29 Jan 2020 13:40:32 +0000 Subject: [PATCH 17/17] Update NpcIndicatorsPlugin.java --- .../client/plugins/npchighlight/NpcIndicatorsPlugin.java | 1 - 1 file changed, 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index db80818694..226997b2ff 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -29,7 +29,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableSet; import com.google.inject.Provides; import java.awt.Color; - import java.text.DecimalFormat; import java.text.NumberFormat; import java.time.Instant;