From 0553d8d91f317e5c07c752324762cf6948a1da74 Mon Sep 17 00:00:00 2001 From: Kyleeld <48519776+Kyleeld@users.noreply.github.com> Date: Tue, 3 Sep 2019 14:48:46 +0100 Subject: [PATCH 01/14] . --- .../groundmarkers/GroundMarkerConfig.java | 86 ++++++++++++++++--- .../GroundMarkerMinimapOverlay.java | 14 ++- .../groundmarkers/GroundMarkerOverlay.java | 14 ++- .../groundmarkers/GroundMarkerPlugin.java | 26 +++++- 4 files changed, 126 insertions(+), 14 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerConfig.java index e44b35e94e..f3d1dcc3f6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerConfig.java @@ -47,7 +47,11 @@ public interface GroundMarkerConfig extends Config FIVE("5"), SIX("6"), SEVEN("7"), - EIGHT("8"); + EIGHT("8"), + NINE("9"), + TEN("10"), + ELEVEN("11"), + TWELVE("12"); private final String name; @@ -78,11 +82,11 @@ public interface GroundMarkerConfig extends Config @ConfigItem( position = 1, keyName = "markerColor", - name = "Default Marked tile Color", + name = "Default tile Color", description = "Configures the default color of marked tiles", hidden = true, unhide = "amount", - unhideValue = "1 || 2 || 3 || 4 || 5 || 6 || 7 || 8" + unhideValue = "1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor() { @@ -97,7 +101,7 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 2nd group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "2 || 3 || 4 || 5 || 6 || 7 || 8" + unhideValue = "2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor2() { @@ -112,7 +116,7 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 3rd group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "3 || 4 || 5 || 6 || 7 || 8" + unhideValue = "3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor3() { @@ -127,7 +131,7 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 4th group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "4 || 5 || 6 || 7 || 8" + unhideValue = "4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor4() { @@ -142,7 +146,7 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 5th group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "5 || 6 || 7 || 8" + unhideValue = "5 || 6 || 7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor5() { @@ -157,7 +161,7 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 6th group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "6 || 7 || 8" + unhideValue = "6 || 7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor6() { @@ -172,7 +176,7 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 7th group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "7 || 8" + unhideValue = "7 || 8 || 9 || 10 || 11 || 12" ) default Color markerColor7() { @@ -187,15 +191,75 @@ public interface GroundMarkerConfig extends Config description = "Configures the color of the 8th group of marked tiles", hidden = true, unhide = "amount", - unhideValue = "8" + unhideValue = "8 || 9 || 10 || 11 || 12" ) default Color markerColor8() { return Color.MAGENTA; } + @Alpha @ConfigItem( position = 10, + keyName = "markerColor9", + name = "Group 9 tile color", + description = "Configures the color of the 9th group of marked tiles", + hidden = true, + unhide = "amount", + unhideValue = "9 || 10 || 11 || 12" + ) + default Color markerColor9() + { + return Color.CYAN; + } + + @Alpha + @ConfigItem( + position = 11, + keyName = "markerColor10", + name = "Group 10 tile color", + description = "Configures the color of the 10th group of marked tiles", + hidden = true, + unhide = "amount", + unhideValue = "10 || 11 || 12" + ) + default Color markerColor10() + { + return Color.ORANGE; + } + + @Alpha + @ConfigItem( + position = 12, + keyName = "markerColor11", + name = "Group 11 tile color", + description = "Configures the color of the 11th group of marked tiles", + hidden = true, + unhide = "amount", + unhideValue = "11 || 12" + ) + default Color markerColor11() + { + return Color.PINK; + } + + @Alpha + @ConfigItem( + position = 13, + keyName = "markerColor12", + name = "Group 12 tile color", + description = "Configures the color of the 12th group of marked tiles", + hidden = true, + unhide = "amount", + unhideValue = "12" + ) + default Color markerColor12() + { + return Color.LIGHT_GRAY; + } + + @ConfigItem( + position = 14, keyName = "showMinimap", name = "Show on minimap", description = "Shows marked tiles on the minimap" @@ -210,7 +274,7 @@ public interface GroundMarkerConfig extends Config max = 100 ) @ConfigItem( - position = 11, + position = 15, keyName = "minimapOpacity", name = "Minimap opacity", description = "The opacity of the minimap markers" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerMinimapOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerMinimapOverlay.java index eda6be221d..794bed0859 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerMinimapOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerMinimapOverlay.java @@ -101,6 +101,18 @@ class GroundMarkerMinimapOverlay extends Overlay break; case 8: color = plugin.getMarkerColor8(); + break; + case 9: + color = plugin.getMarkerColor9(); + break; + case 10: + color = plugin.getMarkerColor10(); + break; + case 11: + color = plugin.getMarkerColor11(); + break; + case 12: + color = plugin.getMarkerColor12(); } int opacity = (int) floor(plugin.getMinimapOverlayOpacity() * 2.55); @@ -129,4 +141,4 @@ class GroundMarkerMinimapOverlay extends Overlay OverlayUtil.renderMinimapRect(client, graphics, posOnMinimap, TILE_WIDTH, TILE_HEIGHT, color); } -} +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerOverlay.java index 66972a157d..e17bd1c336 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerOverlay.java @@ -113,7 +113,19 @@ public class GroundMarkerOverlay extends Overlay break; case 8: color = plugin.getMarkerColor8(); + break; + case 9: + color = plugin.getMarkerColor9(); + break; + case 10: + color = plugin.getMarkerColor10(); + break; + case 11: + color = plugin.getMarkerColor11(); + break; + case 12: + color = plugin.getMarkerColor12(); } OverlayUtil.renderPolygon(graphics, poly, color); } -} +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java index 292e70d014..ab37bac5e8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java @@ -162,6 +162,14 @@ public class GroundMarkerPlugin extends Plugin @Getter(AccessLevel.PACKAGE) private Color markerColor8; @Getter(AccessLevel.PACKAGE) + private Color markerColor9; + @Getter(AccessLevel.PACKAGE) + private Color markerColor10; + @Getter(AccessLevel.PACKAGE) + private Color markerColor11; + @Getter(AccessLevel.PACKAGE) + private Color markerColor12; + @Getter(AccessLevel.PACKAGE) private boolean showMinimap; @Getter(AccessLevel.PACKAGE) private int minimapOverlayOpacity; @@ -459,6 +467,18 @@ public class GroundMarkerPlugin extends Plugin break; case 8: color = this.markerColor8; + break; + case 9: + color = this.markerColor9; + break; + case 10: + color = this.markerColor10; + break; + case 11: + color = this.markerColor11; + break; + case 12: + color = this.markerColor12; } return color; @@ -483,7 +503,11 @@ public class GroundMarkerPlugin extends Plugin this.markerColor6 = config.markerColor6(); this.markerColor7 = config.markerColor7(); this.markerColor8 = config.markerColor8(); + this.markerColor9 = config.markerColor9(); + this.markerColor10 = config.markerColor10(); + this.markerColor11 = config.markerColor11(); + this.markerColor12 = config.markerColor12(); this.showMinimap = config.showMinimap(); this.minimapOverlayOpacity = config.minimapOverlayOpacity(); } -} +} \ No newline at end of file From 90048fc6f0b3a843e13620288d2897187fa0e439 Mon Sep 17 00:00:00 2001 From: Damhan Richardson Date: Tue, 3 Sep 2019 18:26:47 +0100 Subject: [PATCH 02/14] playerindicators: fix agility icon when show cb level is turned on. --- .../playerindicators/PlayerIndicatorsOverlay.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java index 619bddfe9c..b7b4744084 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java @@ -160,7 +160,18 @@ public class PlayerIndicatorsOverlay extends Overlay if (plugin.getAgilityFormat() == PlayerIndicatorsPlugin.AgilityFormats.ICONS) { - final int width = graphics.getFontMetrics().stringWidth(name); + + + final int width; + if (plugin.isShowCombatLevel()) + { + width = graphics.getFontMetrics().stringWidth(name) + 10; + } + else + { + width = graphics.getFontMetrics().stringWidth(name); + + } final int height = graphics.getFontMetrics().getHeight(); if (level >= plugin.getAgilityFirstThreshold()) { From 0d036bb31fee0dae69b05474aa3e89788d16cab5 Mon Sep 17 00:00:00 2001 From: Damhan Richardson Date: Tue, 3 Sep 2019 18:29:08 +0100 Subject: [PATCH 03/14] playerindicators:fix agility icon --- .../client/plugins/playerindicators/PlayerIndicatorsOverlay.java | 1 - 1 file changed, 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java index b7b4744084..7fb7b0cb52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java @@ -161,7 +161,6 @@ public class PlayerIndicatorsOverlay extends Overlay if (plugin.getAgilityFormat() == PlayerIndicatorsPlugin.AgilityFormats.ICONS) { - final int width; if (plugin.isShowCombatLevel()) { From 9aeb02bd46a8c1d31f26e262f62ad2e6871bc880 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Wed, 4 Sep 2019 12:33:19 +0200 Subject: [PATCH 04/14] profiles: Make it possible to use the enter key on the passward field --- .../plugins/profiles/ProfilesPanel.java | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java index c4048d516c..160d2ec01d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java @@ -26,6 +26,8 @@ package net.runelite.client.plugins.profiles; import java.awt.BorderLayout; import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; @@ -120,6 +122,9 @@ class ProfilesPanel extends PluginPanel txtDecryptPassword.setEchoChar((char) 0); txtDecryptPassword.setForeground(ColorScheme.LIGHT_GRAY_COLOR); txtDecryptPassword.setToolTipText(UNLOCK_PASSWORD); + + txtDecryptPassword.addActionListener(e -> decryptAccounts()); + txtDecryptPassword.addFocusListener(new FocusListener() { @Override @@ -156,27 +161,7 @@ class ProfilesPanel extends PluginPanel @Override public void mousePressed(MouseEvent e) { - boolean error = false; - try - { - redrawProfiles(); - } - catch (InvalidKeySpecException | NoSuchAlgorithmException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchPaddingException ex) - { - error = true; - showErrorMessage("Unable to load data", "Incorrect password!"); - } - - if (error) - { - return; - } - - remove(loginPanel); - add(accountPanel, BorderLayout.CENTER); - - profilesPanel.setLayout(new DynamicGridLayout(0, 1, 0, 3)); - add(profilesPanel, BorderLayout.SOUTH); + decryptAccounts(); } @Override @@ -386,6 +371,31 @@ class ProfilesPanel extends PluginPanel // addAccounts(config.profilesData()); } + private void decryptAccounts() + { + boolean error = false; + try + { + redrawProfiles(); + } + catch (InvalidKeySpecException | NoSuchAlgorithmException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchPaddingException ex) + { + error = true; + showErrorMessage("Unable to load data", "Incorrect password!"); + } + + if (error) + { + return; + } + + remove(loginPanel); + add(accountPanel, BorderLayout.CENTER); + + profilesPanel.setLayout(new DynamicGridLayout(0, 1, 0, 3)); + add(profilesPanel, BorderLayout.SOUTH); + } + private void redrawProfiles() throws InvalidKeySpecException, NoSuchAlgorithmException, IllegalBlockSizeException, InvalidKeyException, BadPaddingException, NoSuchPaddingException { profilesPanel.removeAll(); From af8fc790677505d196a7f1f1f27fd15f51a1d86e Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Wed, 4 Sep 2019 12:36:48 +0200 Subject: [PATCH 05/14] profiles: Check for empty password before redrawing the UI --- .../client/plugins/profiles/ProfilesPanel.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java index 160d2ec01d..b1dc2ed5ea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java @@ -373,6 +373,12 @@ class ProfilesPanel extends PluginPanel private void decryptAccounts() { + if (txtDecryptPassword.getPassword().length == 0 || String.valueOf(txtDecryptPassword.getPassword()).equals(UNLOCK_PASSWORD)) + { + showErrorMessage("Unable to load data", "Please enter a password!"); + return; + } + boolean error = false; try { @@ -472,11 +478,6 @@ class ProfilesPanel extends PluginPanel String tmp = profilesConfig.profilesData(); if (tmp.startsWith("¬")) { - if (txtDecryptPassword.getPassword().length == 0 || String.valueOf(txtDecryptPassword.getPassword()).equals(UNLOCK_PASSWORD)) - { - showErrorMessage("Unable to load data", "Please enter a password!"); - return tmp; - } tmp = tmp.substring(1); return decryptText(base64Decode(tmp), getAesKey()); } From bb088aeb89eac0623ff3cdba282c5e3de02ae830 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Wed, 4 Sep 2019 12:39:53 +0200 Subject: [PATCH 06/14] profiles: Empty the text field when an incorrect password is entered --- .../java/net/runelite/client/plugins/profiles/ProfilesPanel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java index b1dc2ed5ea..b4bea3a546 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java @@ -388,6 +388,7 @@ class ProfilesPanel extends PluginPanel { error = true; showErrorMessage("Unable to load data", "Incorrect password!"); + txtDecryptPassword.setText(""); } if (error) From 8ce6bea4d215cf78454949bc1123222f463da4ba Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Wed, 4 Sep 2019 12:51:38 +0200 Subject: [PATCH 07/14] profiles: Remove unused imports --- .../net/runelite/client/plugins/profiles/ProfilesPanel.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java index b4bea3a546..1822a9044e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/profiles/ProfilesPanel.java @@ -26,8 +26,6 @@ package net.runelite.client.plugins.profiles; import java.awt.BorderLayout; import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; From be04b4e7f4de3c2c694ebcf9a374e7dd946a7d3a Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Wed, 4 Sep 2019 19:09:25 +0200 Subject: [PATCH 08/14] client: Fix @Generated not found on java 11 (#1541) --- build.gradle | 1 + runelite-client/build.gradle | 1 + 2 files changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 543cbe322b..37ae8a81dd 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,7 @@ ext { httpcore = '4.4.11' httpmime = '4.5.9' javassist = '3.25.0-GA' + javax = '1.3.2' javaxInject = '1' jbsdiff = '1.0' jclCore = '2.8' diff --git a/runelite-client/build.gradle b/runelite-client/build.gradle index 2a0f3402c0..af4c991767 100644 --- a/runelite-client/build.gradle +++ b/runelite-client/build.gradle @@ -11,6 +11,7 @@ description = 'RuneLite Client' dependencies { annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok + compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: javax compileOnly group: 'net.runelite', name: 'orange-extensions', version: orangeExtensions compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok From d4dbf9e856f924d4e10d5249279fb45a8c131c60 Mon Sep 17 00:00:00 2001 From: ST0NEWALL <46624825+pklite@users.noreply.github.com> Date: Wed, 4 Sep 2019 22:22:50 -0400 Subject: [PATCH 09/14] playerindicators: prioritize clan and friends over targets (#1524) * playerindicators: prioritize clan and friends over targets Signed-off-by: PKLite * correctly prioritizes, fixed targets and other not showing Signed-off-by: PKLite --- .../PlayerIndicatorsService.java | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java index 6e03514bec..e4f52fa121 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java @@ -60,25 +60,26 @@ public class PlayerIndicatorsService self = (player) -> Objects.equals(client.getLocalPlayer(), player); friend = (player) -> (!player.equals(client.getLocalPlayer()) && client.isFriended(player.getName(), false)); - clan = Player::isClanMember; + clan = (player) -> (player.isClanMember() && !client.isFriended(player.getName(), false)); team = (player) -> (Objects.requireNonNull(client.getLocalPlayer()).getTeam() != 0 && client.getLocalPlayer().getTeam() == player.getTeam()); - target = (player) -> PvPUtil.isAttackable(client, player); + target = (player -> + { + if (nonFriendly(player)) + { + return false; + } + return plugin.isHighlightTargets() && PvPUtil.isAttackable(client, player); + }); caller = plugin::isCaller; callerTarget = piles::contains; other = (player -> { - if (player == null - || (plugin.isHighlightClan() && player.isClanMember()) - || (plugin.isHighlightFriends() && client.isFriended(player.getName(), false)) - || (plugin.isHighlightCallers() && plugin.isCaller(player)) - || (plugin.isHighlightCallerTargets() && piles.contains(player)) - || (plugin.isHighlightTeam() && Objects.requireNonNull(client.getLocalPlayer()).getTeam() != 0 - && client.getLocalPlayer().getTeam() == player.getTeam())) + if (nonFriendly(player)) { return false; } - return !plugin.isHighlightTargets() || PvPUtil.isAttackable(client, player); + return true; }); } @@ -141,4 +142,15 @@ public class PlayerIndicatorsService || plugin.isHighlightFriends() || plugin.isHighlightOther() || plugin.isHighlightTargets() || plugin.isHighlightCallers() || plugin.isHighlightTeam() || plugin.isHighlightCallerTargets(); } + + private boolean nonFriendly(Player player) + { + return player == null + || (plugin.isHighlightClan() && player.isClanMember()) + || (plugin.isHighlightFriends() && client.isFriended(player.getName(), false)) + || (plugin.isHighlightCallers() && plugin.isCaller(player)) + || (plugin.isHighlightCallerTargets() && piles.contains(player)) + || (plugin.isHighlightTeam() && Objects.requireNonNull(client.getLocalPlayer()).getTeam() != 0 + && client.getLocalPlayer().getTeam() == player.getTeam()); + } } \ No newline at end of file From 1466ba9b5cba48ddd2dd4d8995690483ef6a1f62 Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Thu, 5 Sep 2019 03:26:51 +0100 Subject: [PATCH 10/14] fix standard spellbook (#1544) fix standard spellbook timers --- .../client/plugins/freezetimers/PlayerSpellEffect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/PlayerSpellEffect.java b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/PlayerSpellEffect.java index dcebed7ba0..7c7123fc1f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/PlayerSpellEffect.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/PlayerSpellEffect.java @@ -31,9 +31,9 @@ import lombok.Getter; @AllArgsConstructor public enum PlayerSpellEffect { - BIND("Bind", 181, 4800, true, 0, TimerType.FREEZE), - SNARE("Snare", 180, 9600, true, 1, TimerType.FREEZE), - ENTANGLE("Entangle", 179, 14400, true, 2, TimerType.FREEZE), + BIND("Bind", 181, 4800, false, 0, TimerType.FREEZE), + SNARE("Snare", 180, 9600, false, 1, TimerType.FREEZE), + ENTANGLE("Entangle", 179, 14400, false, 2, TimerType.FREEZE), RUSH("Ice Rush", 361, 4800, false, 3, TimerType.FREEZE), BURST("Ice Burst", 363, 9600, false, 4, TimerType.FREEZE), BLITZ("Ice Blitz", 367, 14400, false, 5, TimerType.FREEZE), From 89af7a7dadb722114ff29d5714540527abd07c7a Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Thu, 5 Sep 2019 03:27:12 +0100 Subject: [PATCH 11/14] remove pvp safespots (#1543) blame jamflex --- .../client/plugins/safespot/SafeSpotConfig.java | 13 +------------ .../client/plugins/safespot/SafeSpotPlugin.java | 16 ++++------------ 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotConfig.java index d9a42c2207..71a5ecd54a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotConfig.java @@ -19,17 +19,6 @@ public interface SafeSpotConfig extends Config { @ConfigItem( position = 1, - keyName = "playerSafeSpots", - name = "Render for Players", - description = "Renders 1 way safe spots vs other players" - ) - default boolean playerSafeSpots() - { - return true; - } - - @ConfigItem( - position = 2, keyName = "npcSafeSpots", name = "Render for NPCs", description = "Renders 1 way safe spots vs NPCs" @@ -40,7 +29,7 @@ public interface SafeSpotConfig extends Config } @ConfigItem( - position = 3, + position = 2, keyName = "tileColor", name = "Tile Color", description = "Color of safe spot tile" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotPlugin.java index 72066225dd..237414a0ac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/safespot/SafeSpotPlugin.java @@ -21,7 +21,6 @@ import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.CollisionDataFlag; import net.runelite.api.NPC; -import net.runelite.api.Player; import net.runelite.api.Tile; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldArea; @@ -38,10 +37,10 @@ import net.runelite.client.plugins.PluginType; import net.runelite.client.ui.overlay.OverlayManager; @PluginDescriptor( - name = "1 Way Safe Spots", + name = "NPC Safe Spots", description = "Renders tile overlays for one way safe spots", - tags = {"safe spot", "pvp", "safespots", "pklite"}, - type = PluginType.UTILITY, + tags = {"safe spot", "safespots", "pvm"}, + type = PluginType.PVM, enabledByDefault = false ) @Singleton @@ -71,7 +70,6 @@ public class SafeSpotPlugin extends Plugin private SafeSpotOverlay safeSpotOverlay; private int tickCount = 0; - private boolean playerSafeSpots; private boolean npcSafeSpots; @Getter(AccessLevel.PACKAGE) private Color tileColor; @@ -113,7 +111,7 @@ public class SafeSpotPlugin extends Plugin { return; } - if (event.getTarget() == null && (this.npcSafeSpots || this.playerSafeSpots)) + if (event.getTarget() == null && this.npcSafeSpots) { tickCount = 10; } @@ -123,11 +121,6 @@ public class SafeSpotPlugin extends Plugin { if (client.getLocalPlayer().getInteracting() != null) { - if (client.getLocalPlayer().getInteracting() instanceof Player && this.playerSafeSpots) - { - safeSpotsRenderable = true; - updateSafeSpots(); - } if (client.getLocalPlayer().getInteracting() instanceof NPC && this.npcSafeSpots) { if (npcManager.getStats(((NPC) client.getLocalPlayer().getInteracting()).getId()) != null) @@ -215,7 +208,6 @@ public class SafeSpotPlugin extends Plugin private void updateConfig() { - this.playerSafeSpots = config.playerSafeSpots(); this.npcSafeSpots = config.npcSafeSpots(); this.tileColor = config.tileColor(); } From 942983bb2d7938c780fafcfb1286a14277724784 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Thu, 5 Sep 2019 04:27:43 +0200 Subject: [PATCH 12/14] Revert "Wintertodt selective eventbus listening" (#1539) This reverts commit 297cf7614a8e7277744bdb565ec3a1c4da65be6e. --- .../plugins/wintertodt/WintertodtPlugin.java | 79 ++++++------------- 1 file changed, 23 insertions(+), 56 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java index 6e0a086f05..9212ff3e94 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java @@ -37,7 +37,6 @@ import lombok.extern.slf4j.Slf4j; import static net.runelite.api.AnimationID.*; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; -import static net.runelite.api.GameState.LOADING; import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; @@ -50,7 +49,6 @@ import net.runelite.api.events.AnimationChanged; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameTick; -import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.ItemContainerChanged; import net.runelite.api.events.VarbitChanged; import net.runelite.client.Notifier; @@ -116,8 +114,6 @@ public class WintertodtPlugin extends Plugin private WintertodtNotifyMode notifyCondition; private Color damageNotificationColor; - private boolean subscribed; - @Provides WintertodtConfig getConfig(ConfigManager configManager) { @@ -134,15 +130,12 @@ public class WintertodtPlugin extends Plugin reset(); overlayManager.add(overlay); - - handleWintertodtRegion(); } @Override protected void shutDown() throws Exception { - eventBus.unregister(this); - eventBus.unregister("inside-wintertodt"); + super.shutDown(); overlayManager.remove(overlay); reset(); @@ -151,23 +144,11 @@ public class WintertodtPlugin extends Plugin private void addSubscriptions() { eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); - eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); + eventBus.subscribe(GameTick.class, this, this::onGameTick); eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged); - } - - private void wintertodtSubscriptions(boolean subscribe) - { - if (subscribe) - { - eventBus.subscribe(GameTick.class, "inside-wintertodt", this::onGameTick); - eventBus.subscribe(ChatMessage.class, "inside-wintertodt", this::onChatMessage); - eventBus.subscribe(AnimationChanged.class, "inside-wintertodt", this::onAnimationChanged); - eventBus.subscribe(ItemContainerChanged.class, "inside-wintertodt", this::onItemContainerChanged); - } - else - { - eventBus.unregister("inside-wintertodt"); - } + eventBus.subscribe(ChatMessage.class, this, this::onChatMessage); + eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged); + eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged); } private void onConfigChanged(ConfigChanged event) @@ -199,24 +180,9 @@ public class WintertodtPlugin extends Plugin return false; } - private void handleWintertodtRegion() + private void onGameTick(GameTick gameTick) { - if (isInWintertodtRegion()) - { - if (!isInWintertodt) - { - reset(); - log.debug("Entered Wintertodt!"); - } - isInWintertodt = true; - - if (!subscribed) - { - wintertodtSubscriptions(true); - subscribed = true; - } - } - else + if (!isInWintertodtRegion()) { if (isInWintertodt) { @@ -225,25 +191,16 @@ public class WintertodtPlugin extends Plugin } isInWintertodt = false; - - if (subscribed) - { - wintertodtSubscriptions(false); - subscribed = false; - } + return; } - } - private void onGameStateChanged(GameStateChanged event) - { - if (event.getGameState() == LOADING) + if (!isInWintertodt) { - handleWintertodtRegion(); + reset(); + log.debug("Entered Wintertodt!"); } - } + isInWintertodt = true; - private void onGameTick(GameTick gameTick) - { checkActionTimeout(); } @@ -295,6 +252,11 @@ public class WintertodtPlugin extends Plugin private void onChatMessage(ChatMessage chatMessage) { + if (!isInWintertodt) + { + return; + } + ChatMessageType chatMessageType = chatMessage.getType(); if (chatMessageType != ChatMessageType.GAMEMESSAGE && chatMessageType != ChatMessageType.SPAM) @@ -433,6 +395,11 @@ public class WintertodtPlugin extends Plugin private void onAnimationChanged(final AnimationChanged event) { + if (!isInWintertodt) + { + return; + } + final Player local = client.getLocalPlayer(); if (event.getActor() != local) @@ -479,7 +446,7 @@ public class WintertodtPlugin extends Plugin { final ItemContainer container = event.getItemContainer(); - if (container != client.getItemContainer(InventoryID.INVENTORY)) + if (!isInWintertodt || container != client.getItemContainer(InventoryID.INVENTORY)) { return; } From 451b5826c70438f5a541e9254d4f67720334169a Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Thu, 5 Sep 2019 03:27:52 +0100 Subject: [PATCH 13/14] fix chatmessagetypes (#1546) fix chatmessagetypes --- .../equipmentinspector/EquipmentInspectorPlugin.java | 2 +- .../net/runelite/client/plugins/gauntlet/GauntletTimer.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/equipmentinspector/EquipmentInspectorPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/equipmentinspector/EquipmentInspectorPlugin.java index a003e9fc07..9ae984da09 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/equipmentinspector/EquipmentInspectorPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/equipmentinspector/EquipmentInspectorPlugin.java @@ -290,7 +290,7 @@ public class EquipmentInspectorPlugin extends Plugin StringPrice = NumberFormat.getIntegerInstance().format(TotalPrice); } chatMessageManager.queue(QueuedMessage.builder() - .type(ChatMessageType.FRIENDSCHATNOTIFICATION) + .type(ChatMessageType.CONSOLE) .runeLiteFormattedMessage(new ChatMessageBuilder() .append(ChatColorType.HIGHLIGHT) .append("Risked Value: ") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletTimer.java index 5bfe9acc35..815c131db3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletTimer.java @@ -223,7 +223,7 @@ class GauntletTimer extends Overlay .append(elapsedTime); chatMessageManager.queue(QueuedMessage.builder() - .type(ChatMessageType.FRIENDSCHATNOTIFICATION) + .type(ChatMessageType.CONSOLE) .runeLiteFormattedMessage(prepmessage.build()) .build()); } @@ -246,7 +246,7 @@ class GauntletTimer extends Overlay .append(elapsedTotalTime); chatMessageManager.queue(QueuedMessage.builder() - .type(ChatMessageType.FRIENDSCHATNOTIFICATION) + .type(ChatMessageType.CONSOLE) .runeLiteFormattedMessage(challengedurationmessage.build()) .build()); @@ -261,7 +261,7 @@ class GauntletTimer extends Overlay .append(elapsedBossTime); chatMessageManager.queue(QueuedMessage.builder() - .type(ChatMessageType.FRIENDSCHATNOTIFICATION) + .type(ChatMessageType.CONSOLE) .runeLiteFormattedMessage(prepdeathmessage.build()) .build()); } From 6034f6a12d6cffe50fed53c2ba420a7467ee0445 Mon Sep 17 00:00:00 2001 From: ST0NEWALL <46624825+pklite@users.noreply.github.com> Date: Wed, 4 Sep 2019 22:39:24 -0400 Subject: [PATCH 14/14] Update PlayerIndicatorsOverlay.java --- .../playerindicators/PlayerIndicatorsOverlay.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java index 7fb7b0cb52..96899bbb76 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java @@ -161,16 +161,9 @@ public class PlayerIndicatorsOverlay extends Overlay if (plugin.getAgilityFormat() == PlayerIndicatorsPlugin.AgilityFormats.ICONS) { - final int width; - if (plugin.isShowCombatLevel()) - { - width = graphics.getFontMetrics().stringWidth(name) + 10; - } - else - { - width = graphics.getFontMetrics().stringWidth(name); + final int width = plugin.isShowCombatLevel() ? graphics.getFontMetrics().stringWidth(name) + + ACTOR_HORIZONTAL_TEXT_MARGIN : graphics.getFontMetrics().stringWidth(name); - } final int height = graphics.getFontMetrics().getHeight(); if (level >= plugin.getAgilityFirstThreshold()) {