diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java index e5bdadd82a..05b0889572 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java @@ -78,4 +78,15 @@ public interface BoostsConfig extends Config { return true; } + + @ConfigItem( + keyName = "boostThreshold", + name = "Boost Amount Threshold", + description = "The amount of levels boosted to send a notification at. A value of 0 will disable notification.", + position = 5 + ) + default int boostThreshold() + { + return 0; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsPlugin.java index 44e104078b..b60c1a01d5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsPlugin.java @@ -39,6 +39,7 @@ import net.runelite.api.Client; import net.runelite.api.Skill; import net.runelite.api.events.BoostedLevelChanged; import net.runelite.api.events.ConfigChanged; +import net.runelite.client.Notifier; import net.runelite.client.config.ConfigManager; import net.runelite.client.game.SkillIconManager; import net.runelite.client.plugins.Plugin; @@ -68,6 +69,9 @@ public class BoostsPlugin extends Plugin @Getter private Instant lastChange; + @Inject + private Notifier notifier; + @Inject private Client client; @@ -155,7 +159,7 @@ public class BoostsPlugin extends Plugin int last = lastSkillLevels[skillIdx]; int cur = client.getBoostedSkillLevel(skill); - // Check if stat goes +1 or -2 + // Check if stat goes +1 or -1 if (cur == last + 1 || cur == last - 1) { log.debug("Skill {} healed", skill); @@ -163,6 +167,18 @@ public class BoostsPlugin extends Plugin addStatChangeIndicator(); } lastSkillLevels[skillIdx] = cur; + + int boostThreshold = config.boostThreshold(); + if (boostThreshold != 0) + { + int real = client.getRealSkillLevel(skill); + int lastBoost = last - real; + int boost = cur - real; + if (boost <= boostThreshold && boostThreshold < lastBoost) + { + notifier.notify(skill.getName() + " level is getting low!"); + } + } } private void updateShownSkills(boolean showSkillingSkills)