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 e623442da3..cc5344771a 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 @@ -103,4 +103,15 @@ public interface BoostsConfig extends Config { return 0; } + + @ConfigItem( + keyName = "groupNotifications", + name = "Group Notifications", + description = "Configures whether or not to group notifications for multiple skills into a single notification", + position = 7 + ) + default boolean groupNotifications() + { + return false; + } } 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 4f09b12a8b..086e2535f3 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 @@ -26,8 +26,10 @@ package net.runelite.client.plugins.boosts; import com.google.common.collect.ImmutableSet; import com.google.inject.Provides; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; @@ -100,6 +102,7 @@ public class BoostsPlugin extends Plugin private int lastChangeUp = -1; private boolean preserveBeenActive = false; private long lastTickMillis; + private List boostedSkillsChanged = new ArrayList<>(); @Provides BoostsConfig provideConfig(ConfigManager configManager) @@ -213,7 +216,14 @@ public class BoostsPlugin extends Plugin int boost = cur - real; if (boost <= boostThreshold && boostThreshold < lastBoost) { - notifier.notify(skill.getName() + " level is getting low!"); + if (config.groupNotifications()) + { + boostedSkillsChanged.add(skill.getName()); + } + else + { + notifier.notify(skill.getName() + " level is getting low!"); + } } } } @@ -223,6 +233,35 @@ public class BoostsPlugin extends Plugin { lastTickMillis = System.currentTimeMillis(); + if (config.groupNotifications() && !boostedSkillsChanged.isEmpty()) + { + if (boostedSkillsChanged.size() == 1) + { + notifier.notify(boostedSkillsChanged.get(0) + " level is getting low!"); + } + else + { + String notification = ""; + for (int i = 0; i < boostedSkillsChanged.size(); i++) + { + if (i == 0) + { + notification = boostedSkillsChanged.get(i); + } + else if (i < boostedSkillsChanged.size() - 1) + { + notification = notification + ", " + boostedSkillsChanged.get(i); + } + else + { + notification = notification + " and " + boostedSkillsChanged.get(i) + " levels are getting low!"; + notifier.notify(notification); + } + } + } + boostedSkillsChanged.clear(); + } + if (getChangeUpTicks() <= 0) { switch (config.displayNextDebuffChange()) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java index 5e0c7a7824..cb97861189 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java @@ -129,9 +129,9 @@ public class FreezeTimersPlugin extends Plugin final Pattern ppattern = Pattern.compile("> (.+?) npcNamePatterns; + private boolean notWorkingOverlayShown = false; @Provides NpcAggroAreaConfig provideConfig(ConfigManager configManager) @@ -139,7 +140,12 @@ public class NpcAggroAreaPlugin extends Plugin protected void startUp() throws Exception { overlayManager.add(overlay); - overlayManager.add(notWorkingOverlay); + if (config.showNotWorkingOverlay()) + { + overlayManager.add(notWorkingOverlay); + notWorkingOverlayShown = true; + } + npcNamePatterns = NAME_SPLITTER.splitToList(config.npcNamePatterns()); recheckActive(); } @@ -149,7 +155,11 @@ public class NpcAggroAreaPlugin extends Plugin { removeTimer(); overlayManager.remove(overlay); - overlayManager.remove(notWorkingOverlay); + if (notWorkingOverlayShown) + { + overlayManager.remove(notWorkingOverlay); + } + Arrays.fill(safeCenters, null); lastPlayerLocation = null; currentTimer = null; @@ -406,6 +416,7 @@ public class NpcAggroAreaPlugin extends Plugin configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_CENTER2); configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_LOCATION); configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_DURATION); + configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_NOT_WORKING_OVERLAY); } private void saveConfig()