From 3897c7e744f06e959a0326881d70c8c7eee4dc43 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Fri, 12 Jul 2019 02:06:54 +0200 Subject: [PATCH] idlenotifier: allow animations fallback for interacting checks --- .../idlenotifier/IdleNotifierPlugin.java | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) 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 5055d1e89b..e2091dd882 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 @@ -127,6 +127,7 @@ public class IdleNotifierPlugin extends Plugin private List itemQuantitiesPrevious = new ArrayList<>(); private final List itemQuantitiesChange = new ArrayList<>(); private boolean lastInteractWasCombat; + private boolean interactingNotified; private SkullIcon lastTickSkull = null; private boolean isFirstTick = true; @@ -232,6 +233,17 @@ public class IdleNotifierPlugin extends Plugin /* Fishing */ case FISHING_CRUSHING_INFERNAL_EELS: case FISHING_CUTTING_SACRED_EELS: + case FISHING_BIG_NET: + case FISHING_NET: + case FISHING_POLE_CAST: + case FISHING_CAGE: + case FISHING_HARPOON: + case FISHING_BARBTAIL_HARPOON: + case FISHING_DRAGON_HARPOON: + case FISHING_INFERNAL_HARPOON: + case FISHING_OILY_ROD: + case FISHING_KARAMBWAN: + case FISHING_BAREHAND: /* Mining(Normal) */ case MINING_BRONZE_PICKAXE: case MINING_IRON_PICKAXE: @@ -275,6 +287,7 @@ public class IdleNotifierPlugin extends Plugin resetTimers(); lastAnimation = animation; lastAnimating = Instant.now(); + interactingNotified = false; break; case MAGIC_LUNAR_SHARED: if (graphic == GraphicID.BAKE_PIE) @@ -282,10 +295,12 @@ public class IdleNotifierPlugin extends Plugin resetTimers(); lastAnimation = animation; lastAnimating = Instant.now(); + interactingNotified = false; break; } case IDLE: lastAnimating = Instant.now(); + interactingNotified = false; break; default: // On unknown animation simply assume the animation is invalid and dont throw notification @@ -541,14 +556,6 @@ public class IdleNotifierPlugin extends Plugin lastAnimation = IDLE; } - if (this.animationIdle && checkAnimationIdle(waitDuration, local)) - { - notifier.notify("[" + local.getName() + "] is now idle!"); - if (this.animationIdleSound) - { - soundManager.playSound(Sound.IDLE); - } - } if (this.interactionIdle && checkInteractionIdle(waitDuration, local)) { if (lastInteractWasCombat) @@ -567,6 +574,16 @@ public class IdleNotifierPlugin extends Plugin soundManager.playSound(Sound.IDLE); } } + interactingNotified = true; + } + + if (this.animationIdle && checkAnimationIdle(waitDuration, local)) + { + notifier.notify("[" + local.getName() + "] is now idle!"); + if (this.animationIdleSound) + { + soundManager.playSound(Sound.IDLE); + } } if (checkLowHitpoints()) @@ -785,7 +802,7 @@ public class IdleNotifierPlugin extends Plugin private boolean checkAnimationIdle(Duration waitDuration, Player local) { - if (lastAnimation == IDLE) + if (lastAnimation == IDLE || interactingNotified) { return false; }