From 68ada84b613b41614f842b8f74b8e88ee58377bf Mon Sep 17 00:00:00 2001 From: Thomas Cylke Date: Sat, 21 Sep 2019 16:17:53 -0400 Subject: [PATCH] Less obnoxious whaleWaters overlay, adds a config option to display only a thin red border instead of the thick red border with large text. --- .../whalewatchers/WhaleWatchersConfig.java | 15 +++++++++++++-- .../whalewatchers/WhaleWatchersPlugin.java | 3 +++ .../WhaleWatchersProtOverlay.java | 18 ++++++++++++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersConfig.java index 4645107069..c7be17f57f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersConfig.java @@ -21,6 +21,17 @@ public interface WhaleWatchersConfig extends Config @ConfigItem( position = 2, + keyName = "lessObnoxiousProtWarning", + name = "Less Obnoxious Protect Item Warning", + description = "Replaces the overlay with thick border and text with a less obtrusive overlay with a thin border and no text" + ) + default boolean lessObnoxiousProtWarning() + { + return false; + } + + @ConfigItem( + position = 3, keyName = "showDamageCounter", name = "Damage Counter", description = "Shows damage you've done and damage your opponent has done to you while in a fight" @@ -31,7 +42,7 @@ public interface WhaleWatchersConfig extends Config } @ConfigItem( - position = 3, + position = 4, keyName = "smiteableWarning", name = "Smite Warning", description = "Displays a warning overlay when your prayer is at a smiteable level" @@ -42,7 +53,7 @@ public interface WhaleWatchersConfig extends Config } @ConfigItem( - position = 4, + position = 5, keyName = "gloryWarning", name = "Glory Warning", description = "Displays a warning box while you are wearing an uncharged glory" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersPlugin.java index e892cd6799..2f2276f956 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersPlugin.java @@ -87,6 +87,8 @@ public class WhaleWatchersPlugin extends Plugin @Getter(AccessLevel.PACKAGE) private boolean protectItemWarning; @Getter(AccessLevel.PACKAGE) + private boolean lessObnoxiousProtWarning; + @Getter(AccessLevel.PACKAGE) private boolean showDamageCounter; private boolean smiteableWarning; private boolean gloryWarning; @@ -303,6 +305,7 @@ public class WhaleWatchersPlugin extends Plugin private void updateConfig() { this.protectItemWarning = config.protectItemWarning(); + this.lessObnoxiousProtWarning = config.lessObnoxiousProtWarning(); this.showDamageCounter = config.showDamageCounter(); this.smiteableWarning = config.smiteableWarning(); this.gloryWarning = config.gloryWarning(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersProtOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersProtOverlay.java index f93a397d2e..1822b94e94 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersProtOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/whalewatchers/WhaleWatchersProtOverlay.java @@ -56,12 +56,22 @@ public class WhaleWatchersProtOverlay extends Overlay rectangle.setBounds(client.getCanvas().getBounds()); rectangle.setLocation(client.getCanvas().getLocation()); Stroke oldStroke = graphics.getStroke(); - graphics.setStroke(new BasicStroke(10)); + if (plugin.isLessObnoxiousProtWarning()) + { + graphics.setStroke(new BasicStroke(3)); + } + else + { + graphics.setStroke(new BasicStroke(10)); + } graphics.setColor(Color.RED); graphics.draw(rectangle); - Font font = FontManager.getRunescapeBoldFont().deriveFont(Font.BOLD, 72); - graphics.setFont(font); - OverlayUtil.renderTextLocation(graphics, new Point((int) rectangle.getCenterX() - 50, font.getSize()), "Protect item prayer disabled!!!", Color.red); + if (!plugin.isLessObnoxiousProtWarning()) + { + Font font = FontManager.getRunescapeBoldFont().deriveFont(Font.BOLD, 72); + graphics.setFont(font); + OverlayUtil.renderTextLocation(graphics, new Point((int) rectangle.getCenterX() - 50, font.getSize()), "Protect item prayer disabled!!!", Color.red); + } graphics.setStroke(oldStroke); } return null;