From 2ad56f8dff78140b650fb796e49c32cfa2f3fd9d Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Mon, 5 Mar 2018 15:41:10 +0100 Subject: [PATCH] Add idle anim and combat idle toggles to notifier Add toggles for idle animation notifications and combat idle notifications to idle notifier plugin. Signed-off-by: Tomas Slusny --- .../idlenotifier/IdleNotifierConfig.java | 40 ++++++++++++++----- .../idlenotifier/IdleNotifierPlugin.java | 6 +-- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java index 8b0c47c655..429a64862c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java @@ -36,21 +36,43 @@ import net.runelite.client.config.ConfigItem; public interface IdleNotifierConfig extends Config { @ConfigItem( - keyName = "timeout", - name = "Idle Timeout (ms)", - description = "The notification delay after the player is idle", - position = 5 + keyName = "animationidle", + name = "Idle Animation Notifications", + description = "Configures if idle animation notifications are enabled", + position = 1 ) - default int getTimeout() + default boolean animationIdle() + { + return true; + } + + @ConfigItem( + keyName = "combatidle", + name = "Combat Idle Notifications", + description = "Configures if out of combat notifications are enabled", + position = 2 + ) + default boolean combatIdle() + { + return true; + } + + @ConfigItem( + keyName = "timeout", + name = "Idle Notification Delay (ms)", + description = "The notification delay after the player is idle", + position = 3 + ) + default int getIdleNotificationDelay() { return 5000; } @ConfigItem( keyName = "hitpoints", - name = "Hitpoints Threshold", + name = "Hitpoints Notification Threshold", description = "The amount of hitpoints to send a notification at", - position = 6 + position = 4 ) default int getHitpointsThreshold() { @@ -59,9 +81,9 @@ public interface IdleNotifierConfig extends Config @ConfigItem( keyName = "prayer", - name = "Prayer Threshold", + name = "Prayer Notification Threshold", description = "The amount of prayer points to send a notification at", - position = 7 + position = 5 ) default int getPrayerThreshold() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java index 4a88d1cbe3..fdf70e00f6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java @@ -274,7 +274,7 @@ public class IdleNotifierPlugin extends Plugin public void onGameTick(GameTick event) { final Player local = client.getLocalPlayer(); - final Duration waitDuration = Duration.ofMillis(config.getTimeout()); + final Duration waitDuration = Duration.ofMillis(config.getIdleNotificationDelay()); if (client.getGameState() != GameState.LOGGED_IN || local == null) { @@ -291,12 +291,12 @@ public class IdleNotifierPlugin extends Plugin notifier.notify("[" + local.getName() + "] is about to log out from being online for 6 hours!"); } - if (checkAnimationIdle(waitDuration, local)) + if (config.animationIdle() && checkAnimationIdle(waitDuration, local)) { notifier.notify("[" + local.getName() + "] is now idle!"); } - if (checkOutOfCombat(waitDuration, local)) + if (config.combatIdle() && checkOutOfCombat(waitDuration, local)) { notifier.notify("[" + local.getName() + "] is now out of combat!"); }