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 854bb51944..ad551e297b 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 @@ -38,29 +38,33 @@ import net.runelite.api.GraphicID; @Slf4j public enum GameTimer { - STAMINA("stamina", 2, ChronoUnit.MINUTES), - ANTIFIRE("antifire", 6, ChronoUnit.MINUTES), - EXANTIFIRE("exantifire", 12, ChronoUnit.MINUTES), - OVERLOAD("overload", 5, ChronoUnit.MINUTES), - CANNON("cannon", 25, ChronoUnit.MINUTES), - MAGICIMBUE("magicimbue", 15, ChronoUnit.SECONDS), - FULLTB("teleblock", 5, ChronoUnit.MINUTES), - HALFTB("teleblock", 150, ChronoUnit.SECONDS), - SUPERANTIVENOM("antivenom", 3, ChronoUnit.MINUTES), - SUPERANTIFIRE("superantifire", 2, ChronoUnit.MINUTES), - ANTIDOTEPLUSPLUS("antidoteplusplus", 12, ChronoUnit.MINUTES), - BIND("bind", GraphicID.BIND, 5, ChronoUnit.SECONDS), - HALFBIND("bind", GraphicID.BIND, 2500, ChronoUnit.MILLIS), - SNARE("snare", GraphicID.SNARE, 10, ChronoUnit.SECONDS), - HALFSNARE("snare", GraphicID.SNARE, 5, ChronoUnit.SECONDS), - ENTANGLE("entangle", GraphicID.ENTANGLE, 15, ChronoUnit.SECONDS), - HALFENTANGLE("entangle", GraphicID.ENTANGLE, 7500, ChronoUnit.MILLIS), - ICERUSH("icerush", GraphicID.ICE_RUSH, 5, ChronoUnit.SECONDS), - ICEBURST("iceburst", GraphicID.ICE_BURST, 10, ChronoUnit.SECONDS), - ICEBLITZ("iceblitz", GraphicID.ICE_BLITZ, 15, ChronoUnit.SECONDS), - ICEBARRAGE("icebarrage", GraphicID.ICE_BARRAGE, 20, ChronoUnit.SECONDS), - IMBUEDHEART("imbuedheart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS), - VENGEANCE("vengeance", GraphicID.VENGEANCE, 30, ChronoUnit.SECONDS); + STAMINA("stamina", "Stamina", 2, ChronoUnit.MINUTES), + ANTIFIRE("antifire", "Antifire", 6, ChronoUnit.MINUTES), + EXANTIFIRE("exantifire", "Extended antifire", 12, ChronoUnit.MINUTES), + OVERLOAD("overload", "Overload", 5, ChronoUnit.MINUTES), + CANNON("cannon", "Cannon", 25, ChronoUnit.MINUTES), + MAGICIMBUE("magicimbue", "Magic imbue", 15, ChronoUnit.SECONDS), + FULLTB("teleblock", "Full Teleblock", 5, ChronoUnit.MINUTES), + HALFTB("teleblock", "Half Teleblock", 150, ChronoUnit.SECONDS), + ANTIVENOMPLUS("antivenomplus", "Anti-venom+", 3, ChronoUnit.MINUTES), + SUPERANTIFIRE("superantifire", "Super antifire", 2, ChronoUnit.MINUTES), + ANTIDOTEPLUSPLUS("antidoteplusplus", "Antidote++", 12, ChronoUnit.MINUTES), + BIND("bind", "Bind", GraphicID.BIND, 5, ChronoUnit.SECONDS), + HALFBIND("bind", "Half Bind", GraphicID.BIND, 2500, ChronoUnit.MILLIS), + SNARE("snare", "Snare", GraphicID.SNARE, 10, ChronoUnit.SECONDS), + HALFSNARE("snare", "Half Snare", GraphicID.SNARE, 5, ChronoUnit.SECONDS), + ENTANGLE("entangle", "Engangle", GraphicID.ENTANGLE, 15, ChronoUnit.SECONDS), + HALFENTANGLE("entangle", "Half Entangle", GraphicID.ENTANGLE, 7500, ChronoUnit.MILLIS), + ICERUSH("icerush", "Ice rush", GraphicID.ICE_RUSH, 5, ChronoUnit.SECONDS), + ICEBURST("iceburst", "Ice burst", GraphicID.ICE_BURST, 10, ChronoUnit.SECONDS), + ICEBLITZ("iceblitz", "Ice blitz", GraphicID.ICE_BLITZ, 15, ChronoUnit.SECONDS), + ICEBARRAGE("icebarrage", "Ice barrage", GraphicID.ICE_BARRAGE, 20, ChronoUnit.SECONDS), + IMBUEDHEART("imbuedheart", "Imbued heart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS), + VENGEANCE("vengeance", "Vengeance", GraphicID.VENGEANCE, 30, ChronoUnit.SECONDS), + ANTIDOTEPLUS("antidoteplus", "Antidote+", 518, ChronoUnit.SECONDS), + ANTIVENOM("antivenom", "Anto-venom", 12, ChronoUnit.MINUTES), + EXSUPERANTIFIRE("exsuperantifire", "Extended Super AntiFire", 6, ChronoUnit.MINUTES), + SANFEW("sanfew", "Sanfew serum", 6, ChronoUnit.MINUTES); @Getter private final String imageResource; @@ -68,19 +72,22 @@ public enum GameTimer private final Duration duration; @Getter private final Integer graphicId; + @Getter + private final String description; private BufferedImage image; - GameTimer(String imageResource, Integer graphicId, long time, ChronoUnit unit) + GameTimer(String imageResource, String description, Integer graphicId, long time, ChronoUnit unit) { this.imageResource = imageResource; + this.description = description; this.graphicId = graphicId; this.duration = Duration.of(time, unit); } - GameTimer(String imageResource, long time, ChronoUnit unit) + GameTimer(String imageResource, String description, long time, ChronoUnit unit) { - this(imageResource, null, time, unit); + this(imageResource, description, null, time, unit); } public BufferedImage getImage() 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 3146d4803b..fd7314dd2f 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 @@ -67,7 +67,7 @@ public interface TimersConfig extends Config @ConfigItem( keyName = "showExAntiFire", - name = "Extended Antifire timer", + name = "Extended antifire timer", description = "Configures whether extended antifire timer is displayed" ) default boolean showExAntiFire() @@ -97,7 +97,7 @@ public interface TimersConfig extends Config @ConfigItem( keyName = "showMagicImbue", - name = "Magic Imbue timer", + name = "Magic imbue timer", description = "Configures whether magic imbue timer is displayed" ) default boolean showMagicImbue() @@ -116,18 +116,18 @@ public interface TimersConfig extends Config } @ConfigItem( - keyName = "showAntiVenom", - name = "Anti Venom+ timer", + keyName = "showAntiVenomPlus", + name = "Anti-venom+ timer", description = "Configures whether anti venom+ timer is displayed" ) - default boolean showAntiVenom() + default boolean showAntiVenomPlus() { return true; } @ConfigItem( keyName = "showSuperAntiFire", - name = "Super Antifire timer", + name = "Super antifire timer", description = "Configures whether super antifire timer is displayed" ) default boolean showSuperAntiFire() @@ -147,7 +147,7 @@ public interface TimersConfig extends Config @ConfigItem( keyName = "showImbuedHeart", - name = "Imbued Heart timer", + name = "Imbued heart timer", description = "Configures whether imbued heart timer is displayed" ) default boolean showImbuedHeart() @@ -174,4 +174,44 @@ public interface TimersConfig extends Config { return true; } + + @ConfigItem( + keyName = "showExSuperAntifire", + name = "Extended super antifire timer", + description = "Configures whether extended super antifire timer is displayed" + ) + default boolean showExSuperAntifire() + { + return true; + } + + @ConfigItem( + keyName = "showSanfew", + name = "Sanfew serum timer", + description = "Configures whether sanfew serum timer is displayed" + ) + default boolean showSanfew() + { + return true; + } + + @ConfigItem( + keyName = "showAntidotePlus", + name = "Antidote+ timer", + description = "Configures whether antidote+ timer is displayed" + ) + default boolean showAntidotePlus() + { + return true; + } + + @ConfigItem( + keyName = "showAntiVenom", + name = "Anti-venom timer", + description = "Configures whether antivenom timer is displayed" + ) + default boolean showAntiVenom() + { + 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 d417ddb4d1..7644e1bf12 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,17 +24,21 @@ */ package net.runelite.client.plugins.timers; +import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUS; 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.ANTIVENOM; +import static net.runelite.client.plugins.timers.GameTimer.ANTIVENOMPLUS; 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.EXSUPERANTIFIRE; 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.SANFEW; 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 static net.runelite.client.plugins.timers.GameTimer.BIND; import static net.runelite.client.plugins.timers.GameTimer.ENTANGLE; import static net.runelite.client.plugins.timers.GameTimer.HALFBIND; @@ -123,9 +127,9 @@ public class TimersPlugin extends Plugin removeGameTimer(MAGICIMBUE); } - if (!config.showAntiVenom()) + if (!config.showAntiVenomPlus()) { - removeGameTimer(SUPERANTIVENOM); + removeGameTimer(ANTIVENOMPLUS); } if (!config.showTeleblock()) @@ -143,6 +147,50 @@ public class TimersPlugin extends Plugin { removeGameTimer(ANTIDOTEPLUSPLUS); } + + if (!config.showAntidotePlus()) + { + removeGameTimer(ANTIDOTEPLUS); + } + + if (!config.showAntiVenom()) + { + removeGameTimer(ANTIVENOM); + } + + if (!config.showAntiVenomPlus()) + { + removeGameTimer(ANTIVENOMPLUS); + } + + if (!config.showSanfew()) + { + removeGameTimer(SANFEW); + } + + if (!config.showVengeance()) + { + removeGameTimer(VENGEANCE); + } + + if (!config.showImbuedHeart()) + { + removeGameTimer(IMBUEDHEART); + } + + if (!config.showFreezes()) + { + removeGameTimer(BIND); + removeGameTimer(HALFBIND); + removeGameTimer(SNARE); + removeGameTimer(HALFSNARE); + removeGameTimer(ENTANGLE); + removeGameTimer(HALFENTANGLE); + removeGameTimer(ICERUSH); + removeGameTimer(ICEBURST); + removeGameTimer(ICEBLITZ); + removeGameTimer(ICEBARRAGE); + } } @Subscribe @@ -157,6 +205,19 @@ public class TimersPlugin extends Plugin { // Needs menu option hook because drink message is intercepting with antipoison message createGameTimer(ANTIDOTEPLUSPLUS); + return; + } + + if (config.showAntidotePlus() + && event.getMenuOption().contains("Drink") + && (event.getId() == ItemID.ANTIDOTE1 + || event.getId() == ItemID.ANTIDOTE2 + || event.getId() == ItemID.ANTIDOTE3 + || event.getId() == ItemID.ANTIDOTE4)) + { + // Needs menu option hook because drink message is intercepting with antipoison message + createGameTimer(ANTIDOTEPLUS); + return; } } @@ -188,6 +249,11 @@ public class TimersPlugin extends Plugin createGameTimer(EXANTIFIRE); } + if (event.getMessage().equals("You drink some of your extended super antifire potion.") && config.showExSuperAntifire()) + { + createGameTimer(EXSUPERANTIFIRE); + } + if (event.getMessage().equals("