diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java index 397ca1cee9..c961e68e24 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java @@ -44,7 +44,9 @@ public enum GameTimer MAGICIMBUE("magicimbue", 15, ChronoUnit.SECONDS), FULLTB("teleblock", 5, ChronoUnit.MINUTES), HALFTB("teleblock", 150, ChronoUnit.SECONDS), - SUPERANTIVENOM("antivenom", 3, ChronoUnit.MINUTES); + SUPERANTIVENOM("antivenom", 3, ChronoUnit.MINUTES), + SUPERANTIFIRE("superantifire", 2, ChronoUnit.MINUTES), + ANTIDOTEPLUSPLUS("antidoteplusplus", 12, ChronoUnit.MINUTES); private final String imageResource; private final Duration duration; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java index 44e8cc4003..12f77b56df 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java @@ -124,4 +124,24 @@ public interface TimersConfig extends Config { return true; } + + @ConfigItem( + keyName = "showSuperAntiFire", + name = "Super Antifire timer", + description = "Configures whether super antifire timer is displayed" + ) + default boolean showSuperAntiFire() + { + return true; + } + + @ConfigItem( + keyName = "showAntidotePlusPlus", + name = "Antidote++ timer", + description = "Configures whether antidote++ timer is displayed" + ) + default boolean showAntidotePlusPlus() + { + return true; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 75b659a6cd..12098e141c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -24,16 +24,28 @@ */ package net.runelite.client.plugins.timers; +import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUSPLUS; +import static net.runelite.client.plugins.timers.GameTimer.ANTIFIRE; +import static net.runelite.client.plugins.timers.GameTimer.CANNON; +import static net.runelite.client.plugins.timers.GameTimer.EXANTIFIRE; +import static net.runelite.client.plugins.timers.GameTimer.FULLTB; +import static net.runelite.client.plugins.timers.GameTimer.HALFTB; +import static net.runelite.client.plugins.timers.GameTimer.MAGICIMBUE; +import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD; +import static net.runelite.client.plugins.timers.GameTimer.STAMINA; +import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIFIRE; +import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIVENOM; import com.google.common.eventbus.Subscribe; import com.google.inject.Provides; import javax.inject.Inject; import net.runelite.api.ChatMessageType; +import net.runelite.api.ItemID; import net.runelite.client.config.ConfigManager; import net.runelite.client.events.ChatMessage; import net.runelite.client.events.ConfigChanged; +import net.runelite.client.events.MenuOptionClicked; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; -import static net.runelite.client.plugins.timers.GameTimer.*; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; @PluginDescriptor( @@ -90,11 +102,37 @@ public class TimersPlugin extends Plugin { removeGameTimer(SUPERANTIVENOM); } + if (!config.showTeleblock()) { removeGameTimer(FULLTB); removeGameTimer(HALFTB); } + + if (!config.showSuperAntiFire()) + { + removeGameTimer(SUPERANTIFIRE); + } + + if (!config.showAntidotePlusPlus()) + { + removeGameTimer(ANTIDOTEPLUSPLUS); + } + } + + @Subscribe + public void onMenuOptionClicked(MenuOptionClicked event) + { + if (config.showAntidotePlusPlus() + && event.getMenuOption().contains("Drink") + && (event.getId() == ItemID.ANTIDOTE1_5958 + || event.getId() == ItemID.ANTIDOTE2_5956 + || event.getId() == ItemID.ANTIDOTE3_5954 + || event.getId() == ItemID.ANTIDOTE4_5952)) + { + // Needs menu option hook because drink message is intercepting with antipoison message + createGameTimer(ANTIDOTEPLUSPLUS); + } } @Subscribe @@ -171,6 +209,16 @@ public class TimersPlugin extends Plugin { createGameTimer(HALFTB); } + + if (event.getMessage().contains("You drink some of your super antifire potion") && config.showSuperAntiFire()) + { + createGameTimer(SUPERANTIFIRE); + } + + if (event.getMessage().equals("Your super antifire potion has expired.") && config.showSuperAntiFire()) + { + removeGameTimer(SUPERANTIFIRE); + } } public void createGameTimer(GameTimer timer) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timers/antidoteplusplus.png b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/antidoteplusplus.png new file mode 100644 index 0000000000..e269b23c73 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/antidoteplusplus.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timers/superantifire.png b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/superantifire.png new file mode 100644 index 0000000000..6bd815a555 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/superantifire.png differ