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 <slusnucky@gmail.com>
This commit is contained in:
@@ -36,21 +36,43 @@ import net.runelite.client.config.ConfigItem;
|
|||||||
public interface IdleNotifierConfig extends Config
|
public interface IdleNotifierConfig extends Config
|
||||||
{
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "timeout",
|
keyName = "animationidle",
|
||||||
name = "Idle Timeout (ms)",
|
name = "Idle Animation Notifications",
|
||||||
description = "The notification delay after the player is idle",
|
description = "Configures if idle animation notifications are enabled",
|
||||||
position = 5
|
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;
|
return 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "hitpoints",
|
keyName = "hitpoints",
|
||||||
name = "Hitpoints Threshold",
|
name = "Hitpoints Notification Threshold",
|
||||||
description = "The amount of hitpoints to send a notification at",
|
description = "The amount of hitpoints to send a notification at",
|
||||||
position = 6
|
position = 4
|
||||||
)
|
)
|
||||||
default int getHitpointsThreshold()
|
default int getHitpointsThreshold()
|
||||||
{
|
{
|
||||||
@@ -59,9 +81,9 @@ public interface IdleNotifierConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "prayer",
|
keyName = "prayer",
|
||||||
name = "Prayer Threshold",
|
name = "Prayer Notification Threshold",
|
||||||
description = "The amount of prayer points to send a notification at",
|
description = "The amount of prayer points to send a notification at",
|
||||||
position = 7
|
position = 5
|
||||||
)
|
)
|
||||||
default int getPrayerThreshold()
|
default int getPrayerThreshold()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
public void onGameTick(GameTick event)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
final Player local = client.getLocalPlayer();
|
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)
|
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!");
|
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!");
|
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!");
|
notifier.notify("[" + local.getName() + "] is now out of combat!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user