diff --git a/runelite-api/src/main/java/net/runelite/api/GraphicID.java b/runelite-api/src/main/java/net/runelite/api/GraphicID.java index 7ef582f2d6..d13f5b9396 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicID.java +++ b/runelite-api/src/main/java/net/runelite/api/GraphicID.java @@ -26,6 +26,7 @@ package net.runelite.api; public class GraphicID { + public static final int CHARGE = 111; public static final int ENTANGLE = 179; public static final int SNARE = 180; public static final int BIND = 181; 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 150ccb16ce..988fc90706 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 @@ -69,7 +69,8 @@ public enum GameTimer PRAYER_ENHANCE("prayerenhance", "Prayer enhance", 275, ChronoUnit.SECONDS), GOD_WARS_ALTAR("altar", "God wars altar", 10, ChronoUnit.MINUTES), ANTIPOISON("antipoison", "Antipoison", 90, ChronoUnit.SECONDS), - SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS); + SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS), + CHARGE("charge", "Charge", GraphicID.CHARGE, 6, ChronoUnit.MINUTES); @Getter private final String imageResource; 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 df6ac55643..310f7a9b42 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 @@ -213,6 +213,17 @@ public interface TimersConfig extends Config @ConfigItem( position = 16, + keyName = "showCharge", + name = "Charge timer", + description = "Configures whether to show a timer for the Charge spell" + ) + default boolean showCharge() + { + return true; + } + + @ConfigItem( + position = 17, keyName = "showImbuedHeart", name = "Imbued heart timer", description = "Configures whether imbued heart timer is displayed" @@ -223,7 +234,7 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 17, + position = 18, keyName = "showVengeance", name = "Vengeance timer", description = "Configures whether vengeance timer is displayed" @@ -234,7 +245,7 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 18, + position = 19, keyName = "showVengeanceOther", name = "Vengeance Other timer", description = "Configures whether vengeance other timer is displayed" @@ -245,7 +256,7 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 19, + position = 20, keyName = "showTeleblock", name = "Teleblock timer", description = "Configures whether teleblock timer is displayed" @@ -256,7 +267,7 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 20, + position = 21, keyName = "showFreezes", name = "Freeze timer", description = "Configures whether freeze timer is displayed" @@ -267,7 +278,7 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 21, + position = 22, keyName = "showGodWarsAltar", name = "God wars altar timer", description = "Configures whether god wars altar timer is displayed" 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 e9d264d8de..31f9603fb1 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 @@ -51,6 +51,7 @@ 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.BIND; import static net.runelite.client.plugins.timers.GameTimer.CANNON; +import static net.runelite.client.plugins.timers.GameTimer.CHARGE; import static net.runelite.client.plugins.timers.GameTimer.ENTANGLE; import static net.runelite.client.plugins.timers.GameTimer.EXANTIFIRE; import static net.runelite.client.plugins.timers.GameTimer.EXSUPERANTIFIRE; @@ -121,46 +122,9 @@ public class TimersPlugin extends Plugin @Subscribe public void updateConfig(ConfigChanged event) { - if (!config.showStamina()) + if (!config.showAntidotePlus()) { - removeGameTimer(STAMINA); - } - - if (!config.showAntiFire()) - { - removeGameTimer(ANTIFIRE); - } - - if (!config.showExAntiFire()) - { - removeGameTimer(EXANTIFIRE); - } - - if (!config.showOverload()) - { - removeGameTimer(OVERLOAD); - removeGameTimer(OVERLOAD_RAID); - } - - if (!config.showCannon()) - { - removeGameTimer(CANNON); - } - - if (!config.showMagicImbue()) - { - removeGameTimer(MAGICIMBUE); - } - - if (!config.showTeleblock()) - { - removeGameTimer(FULLTB); - removeGameTimer(HALFTB); - } - - if (!config.showSuperAntiFire()) - { - removeGameTimer(SUPERANTIFIRE); + removeGameTimer(ANTIDOTEPLUS); } if (!config.showAntidotePlusPlus()) @@ -168,9 +132,9 @@ public class TimersPlugin extends Plugin removeGameTimer(ANTIDOTEPLUSPLUS); } - if (!config.showAntidotePlus()) + if (!config.showSanfew()) { - removeGameTimer(ANTIDOTEPLUS); + removeGameTimer(SANFEW); } if (!config.showAntiVenom()) @@ -183,9 +147,55 @@ public class TimersPlugin extends Plugin removeGameTimer(ANTIVENOMPLUS); } - if (!config.showSanfew()) + if (!config.showAntiFire()) { - removeGameTimer(SANFEW); + removeGameTimer(ANTIFIRE); + } + + if (!config.showExAntiFire()) + { + removeGameTimer(EXANTIFIRE); + } + + if (!config.showSuperAntiFire()) + { + removeGameTimer(SUPERANTIFIRE); + } + + if (!config.showStamina()) + { + removeGameTimer(STAMINA); + } + + if (!config.showOverload()) + { + removeGameTimer(OVERLOAD); + removeGameTimer(OVERLOAD_RAID); + } + + if (!config.showPrayerEnhance()) + { + removeGameTimer(PRAYER_ENHANCE); + } + + if (!config.showCannon()) + { + removeGameTimer(CANNON); + } + + if (!config.showMagicImbue()) + { + removeGameTimer(MAGICIMBUE); + } + + if (!config.showCharge()) + { + removeGameTimer(CHARGE); + } + + if (!config.showImbuedHeart()) + { + removeGameTimer(IMBUEDHEART); } if (!config.showVengeance()) @@ -198,9 +208,10 @@ public class TimersPlugin extends Plugin removeGameTimer(VENGEANCEOTHER); } - if (!config.showImbuedHeart()) + if (!config.showTeleblock()) { - removeGameTimer(IMBUEDHEART); + removeGameTimer(FULLTB); + removeGameTimer(HALFTB); } if (!config.showFreezes()) @@ -216,11 +227,6 @@ public class TimersPlugin extends Plugin removeGameTimer(ICEBLITZ); removeGameTimer(ICEBARRAGE); } - - if (!config.showPrayerEnhance()) - { - removeGameTimer(PRAYER_ENHANCE); - } } @Subscribe @@ -425,6 +431,11 @@ public class TimersPlugin extends Plugin return; } + if (config.showCharge() && actor.getGraphic() == CHARGE.getGraphicId()) + { + createGameTimer(CHARGE); + } + if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId()) { createGameTimer(IMBUEDHEART); diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timers/charge.png b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/charge.png new file mode 100644 index 0000000000..ac40b6bb16 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/charge.png differ