diff --git a/runelite-client/src/main/java/net/runelite/client/Notifier.java b/runelite-client/src/main/java/net/runelite/client/Notifier.java index ce5db852c1..fc3083c997 100644 --- a/runelite-client/src/main/java/net/runelite/client/Notifier.java +++ b/runelite-client/src/main/java/net/runelite/client/Notifier.java @@ -217,6 +217,28 @@ public class Notifier FlashNotification flashNotification = runeLiteConfig.flashNotification(); + if (Instant.now().minusMillis(MINIMUM_FLASH_DURATION_MILLIS).isAfter(flashStart)) + { + switch (flashNotification) + { + case FLASH_TWO_SECONDS: + case SOLID_TWO_SECONDS: + flashStart = null; + return; + case SOLID_UNTIL_CANCELLED: + case FLASH_UNTIL_CANCELLED: + // Any interaction with the client since the notification started will cancel it after the minimum duration + if ((client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS + || client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS + || client.getMouseLastPressedMillis() > mouseLastPressedMillis) && clientUI.isFocused()) + { + flashStart = null; + return; + } + break; + } + } + if (client.getGameCycle() % 40 >= 20 // For solid colour, fall through every time. && (flashNotification == FlashNotification.FLASH_TWO_SECONDS @@ -229,29 +251,6 @@ public class Notifier graphics.setColor(FLASH_COLOR); graphics.fill(new Rectangle(client.getCanvas().getSize())); graphics.setColor(color); - - if (!Instant.now().minusMillis(MINIMUM_FLASH_DURATION_MILLIS).isAfter(flashStart)) - { - return; - } - - switch (flashNotification) - { - case FLASH_TWO_SECONDS: - case SOLID_TWO_SECONDS: - flashStart = null; - break; - case SOLID_UNTIL_CANCELLED: - case FLASH_UNTIL_CANCELLED: - // Any interaction with the client since the notification started will cancel it after the minimum duration - if ((client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS - || client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS - || client.getMouseLastPressedMillis() > mouseLastPressedMillis) && clientUI.isFocused()) - { - flashStart = null; - } - break; - } } private void sendNotification(