Less obnoxious whaleWaters overlay, adds a config option to display only a thin red border instead of the thick red border with large text.

This commit is contained in:
Thomas Cylke
2019-09-21 16:17:53 -04:00
parent 2d654f9839
commit 68ada84b61
3 changed files with 30 additions and 6 deletions

View File

@@ -21,6 +21,17 @@ public interface WhaleWatchersConfig extends Config
@ConfigItem( @ConfigItem(
position = 2, 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", keyName = "showDamageCounter",
name = "Damage Counter", name = "Damage Counter",
description = "Shows damage you've done and damage your opponent has done to you while in a fight" 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( @ConfigItem(
position = 3, position = 4,
keyName = "smiteableWarning", keyName = "smiteableWarning",
name = "Smite Warning", name = "Smite Warning",
description = "Displays a warning overlay when your prayer is at a smiteable level" description = "Displays a warning overlay when your prayer is at a smiteable level"
@@ -42,7 +53,7 @@ public interface WhaleWatchersConfig extends Config
} }
@ConfigItem( @ConfigItem(
position = 4, position = 5,
keyName = "gloryWarning", keyName = "gloryWarning",
name = "Glory Warning", name = "Glory Warning",
description = "Displays a warning box while you are wearing an uncharged glory" description = "Displays a warning box while you are wearing an uncharged glory"

View File

@@ -87,6 +87,8 @@ public class WhaleWatchersPlugin extends Plugin
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private boolean protectItemWarning; private boolean protectItemWarning;
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private boolean lessObnoxiousProtWarning;
@Getter(AccessLevel.PACKAGE)
private boolean showDamageCounter; private boolean showDamageCounter;
private boolean smiteableWarning; private boolean smiteableWarning;
private boolean gloryWarning; private boolean gloryWarning;
@@ -303,6 +305,7 @@ public class WhaleWatchersPlugin extends Plugin
private void updateConfig() private void updateConfig()
{ {
this.protectItemWarning = config.protectItemWarning(); this.protectItemWarning = config.protectItemWarning();
this.lessObnoxiousProtWarning = config.lessObnoxiousProtWarning();
this.showDamageCounter = config.showDamageCounter(); this.showDamageCounter = config.showDamageCounter();
this.smiteableWarning = config.smiteableWarning(); this.smiteableWarning = config.smiteableWarning();
this.gloryWarning = config.gloryWarning(); this.gloryWarning = config.gloryWarning();

View File

@@ -56,12 +56,22 @@ public class WhaleWatchersProtOverlay extends Overlay
rectangle.setBounds(client.getCanvas().getBounds()); rectangle.setBounds(client.getCanvas().getBounds());
rectangle.setLocation(client.getCanvas().getLocation()); rectangle.setLocation(client.getCanvas().getLocation());
Stroke oldStroke = graphics.getStroke(); 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.setColor(Color.RED);
graphics.draw(rectangle); graphics.draw(rectangle);
Font font = FontManager.getRunescapeBoldFont().deriveFont(Font.BOLD, 72); if (!plugin.isLessObnoxiousProtWarning())
graphics.setFont(font); {
OverlayUtil.renderTextLocation(graphics, new Point((int) rectangle.getCenterX() - 50, font.getSize()), "Protect item prayer disabled!!!", Color.red); 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); graphics.setStroke(oldStroke);
} }
return null; return null;