From c431a18a37fd86234add5daa8ee1881732d2ab0a Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Mon, 8 Jan 2018 22:50:00 +0100 Subject: [PATCH] Add support for super antifire potion Add support for newly introduced super antifire potion to TimersPlugin. Signed-off-by: Tomas Slusny --- .../client/plugins/timers/GameTimer.java | 3 +- .../client/plugins/timers/TimersConfig.java | 10 +++++++ .../client/plugins/timers/TimersPlugin.java | 27 +++++++++++++++++- .../client/plugins/timers/superantifire.png | Bin 0 -> 818 bytes 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/timers/superantifire.png 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..29b28a214c 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,8 @@ 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); 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..f7e1ad04e3 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,14 @@ 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; + } } 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..124cdbb123 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,6 +24,16 @@ */ package net.runelite.client.plugins.timers; +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; @@ -33,7 +43,6 @@ import net.runelite.client.events.ChatMessage; import net.runelite.client.events.ConfigChanged; 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 +99,17 @@ public class TimersPlugin extends Plugin { removeGameTimer(SUPERANTIVENOM); } + if (!config.showTeleblock()) { removeGameTimer(FULLTB); removeGameTimer(HALFTB); } + + if (!config.showSuperAntiFire()) + { + removeGameTimer(SUPERANTIFIRE); + } } @Subscribe @@ -171,6 +186,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/superantifire.png b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/superantifire.png new file mode 100644 index 0000000000000000000000000000000000000000..6bd815a555c32bd2ce06bb62455842c287fa4e3a GIT binary patch literal 818 zcmV-21I_%2P)Px%>`6pHR7l6Amc5HqR~W{B?|aU z2$o_NLq>zOWLD=t)JF`18=e!no_Rh@C$JNaY2WIYYpZj~C z=RNNkq4Fg*{N1GTjw-=#zMf-ir_I*ZK5Lsz9{sUWDeSABI``>WVk%(&{%4g>KK_uq z_g~mFVXYE96zp~*F&Z(ZO2hPBy^N_4jL{}|U0J@^)oTlQr$Cc#H`47yQcrk({u15? z9zT9G)`p3mo;c9};NhRO^4i|s2XxvU>Wwx#JKOIcRHIQJX^-9AoMeesvq>}0k0DyG zm!DHg618D zG)c0As#fl-siKWW4G|$FLwXV_`hWTq&gJu%8AegQilVAqyf}BfKD~2&kz|RF*5*pW z&8DY*uz|MUyf3NPjVt$|9nO2a4^wGJNM{=-5fP#dPa_q@sl#i)iB6@}LCV`- zeoq$ql+jYTN@3@F-s(i!q4eun14S`2M234?R1t9nr3Qivq?E`~dlKm=rI}%71LaFU zEElHImgQ%mhU#eB9*V0dio>~3gw>-}btB&DVdCCp#r__6kKGm`D6XXSE+FFg{KDmu zRsn(!1V5VOpty(@w7sxI``!kZ4UIbm$b7w5YQijy6<5(Rte{2tDucv*Zxu{#E`D{y z$5HWuv=^2+ma z#>&wn`P+q`OM$}&h$x+Ihfa5&gU$i#yKmUt-)43DHNP+aIx@6n+IfHH`eJW}7K6Io w-RJfC3Y+;Vzx?&X#1o+MztrU4CLbqn0g!V+9a!q;tN;K207*qoM6N<$f}9VGzW@LL literal 0 HcmV?d00001