From 8b76726114d0e978490862b19dc582157663e954 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Fri, 27 Apr 2018 02:08:14 +0100 Subject: [PATCH 1/2] Add Vengeance Other indicator --- .../java/net/runelite/api/AnimationID.java | 1 + .../client/plugins/timers/GameTimer.java | 1 + .../client/plugins/timers/TimersConfig.java | 10 +++ .../client/plugins/timers/TimersPlugin.java | 79 ++++++++++++------ .../client/plugins/timers/vengeanceother.png | Bin 0 -> 800 bytes 5 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/timers/vengeanceother.png diff --git a/runelite-api/src/main/java/net/runelite/api/AnimationID.java b/runelite-api/src/main/java/net/runelite/api/AnimationID.java index bc2e375660..d387270973 100644 --- a/runelite-api/src/main/java/net/runelite/api/AnimationID.java +++ b/runelite-api/src/main/java/net/runelite/api/AnimationID.java @@ -112,6 +112,7 @@ public final class AnimationID public static final int BURYING_BONES = 827; public static final int LOOKING_INTO = 832; public static final int DIG = 830; + public static final int VENGEANCE_OTHER = 4411; // NPC animations public static final int TZTOK_JAD_MAGIC_ATTACK = 2656; 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 f80784e1c1..150ccb16ce 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 @@ -60,6 +60,7 @@ public enum GameTimer 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), + VENGEANCEOTHER("vengeanceother", "Vengeance Other", -1, 30, ChronoUnit.SECONDS), ANTIDOTEPLUS("antidoteplus", "Antidote+", 518, ChronoUnit.SECONDS), ANTIVENOM("antivenom", "Anti-venom", 12, ChronoUnit.MINUTES), EXSUPERANTIFIRE("exsuperantifire", "Extended Super AntiFire", 6, ChronoUnit.MINUTES), 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 b16c1a1a5e..7b8dab391e 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 @@ -155,6 +155,16 @@ public interface TimersConfig extends Config return true; } + @ConfigItem( + keyName = "showVengeanceOther", + name = "Vengeance Other timer", + description = "Configures whether vengeance other timer is displayed" + ) + default boolean showVengeanceOther() + { + return true; + } + @ConfigItem( keyName = "showFreezes", name = "Freeze timer", 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 b0882c1427..4e1f5e344e 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,55 +24,58 @@ */ package net.runelite.client.plugins.timers; +import com.google.common.eventbus.Subscribe; +import com.google.inject.Provides; +import javax.inject.Inject; +import net.runelite.api.Actor; +import net.runelite.api.AnimationID; +import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; +import net.runelite.api.ItemID; +import net.runelite.api.Prayer; +import net.runelite.api.Varbits; +import net.runelite.api.events.AnimationChanged; +import net.runelite.api.events.ChatMessage; +import net.runelite.api.events.ConfigChanged; +import net.runelite.api.events.GraphicChanged; +import net.runelite.api.events.MenuOptionClicked; +import net.runelite.api.events.VarbitChanged; +import net.runelite.client.config.ConfigManager; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; 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.ANTIPOISON; 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.ENTANGLE; 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.GOD_WARS_ALTAR; -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.OVERLOAD_RAID; -import static net.runelite.client.plugins.timers.GameTimer.PRAYER_ENHANCE; -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.BIND; -import static net.runelite.client.plugins.timers.GameTimer.ENTANGLE; import static net.runelite.client.plugins.timers.GameTimer.HALFBIND; import static net.runelite.client.plugins.timers.GameTimer.HALFENTANGLE; import static net.runelite.client.plugins.timers.GameTimer.HALFSNARE; +import static net.runelite.client.plugins.timers.GameTimer.HALFTB; import static net.runelite.client.plugins.timers.GameTimer.ICEBARRAGE; import static net.runelite.client.plugins.timers.GameTimer.ICEBLITZ; import static net.runelite.client.plugins.timers.GameTimer.ICEBURST; import static net.runelite.client.plugins.timers.GameTimer.ICERUSH; import static net.runelite.client.plugins.timers.GameTimer.IMBUEDHEART; +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.OVERLOAD_RAID; +import static net.runelite.client.plugins.timers.GameTimer.PRAYER_ENHANCE; +import static net.runelite.client.plugins.timers.GameTimer.SANFEW; import static net.runelite.client.plugins.timers.GameTimer.SNARE; +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.SUPERANTIPOISON; import static net.runelite.client.plugins.timers.GameTimer.VENGEANCE; -import com.google.common.eventbus.Subscribe; -import com.google.inject.Provides; -import javax.inject.Inject; -import net.runelite.api.Actor; -import net.runelite.api.ChatMessageType; -import net.runelite.api.Client; -import net.runelite.api.ItemID; -import net.runelite.api.Prayer; -import net.runelite.api.Varbits; -import net.runelite.api.events.GraphicChanged; -import net.runelite.api.events.VarbitChanged; -import net.runelite.client.config.ConfigManager; -import net.runelite.api.events.ChatMessage; -import net.runelite.api.events.ConfigChanged; -import net.runelite.api.events.MenuOptionClicked; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; +import static net.runelite.client.plugins.timers.GameTimer.VENGEANCEOTHER; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; @PluginDescriptor( @@ -190,6 +193,11 @@ public class TimersPlugin extends Plugin removeGameTimer(VENGEANCE); } + if (!config.showVengeanceOther()) + { + removeGameTimer(VENGEANCEOTHER); + } + if (!config.showImbuedHeart()) { removeGameTimer(IMBUEDHEART); @@ -390,6 +398,23 @@ public class TimersPlugin extends Plugin } } + @Subscribe + public void onAnimationChanged(AnimationChanged event) + { + Actor actor = event.getActor(); + + if (actor != client.getLocalPlayer()) + { + return; + } + + if (config.showVengeanceOther() && actor.getAnimation() == AnimationID.VENGEANCE_OTHER) + { + createGameTimer(VENGEANCEOTHER); + } + } + + @Subscribe public void onGraphicChanged(GraphicChanged event) { diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timers/vengeanceother.png b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/vengeanceother.png new file mode 100644 index 0000000000000000000000000000000000000000..3d5f4a0da4d532c01a6580d344de3a7a039c009e GIT binary patch literal 800 zcmV+*1K<3KP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;2FkAZe8V00NLnL_t(IPmNPePg6k@eXp zyjO?_F?zf+tpb4nC%I|g%-nO&oO?&w2#O>_krcQk2|Ehmq9|-{4t~(obP-I~kRBOC zTx~`A{UCO_wjko0%rs%!HY`JfrGLlRa6gi7HA^xwvt=PekBtTK_C zckb*Nl4!v&4A?A3cb!9L^DSgXBlz^J5g(%s7>)%nL~ZPDu0`re(+Yu`rYk=*lx&&# zwi#3SIvT_4@ExQ=*F<#Qt-_;w)##4||KD9emKC^MZfapvjA Date: Fri, 27 Apr 2018 02:08:52 +0100 Subject: [PATCH 2/2] Reorder Timer configuration options --- .../client/plugins/timers/TimersConfig.java | 422 +++++++++--------- 1 file changed, 222 insertions(+), 200 deletions(-) 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 7b8dab391e..9d4132b41c 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 @@ -36,206 +36,7 @@ import net.runelite.client.config.ConfigItem; public interface TimersConfig extends Config { @ConfigItem( - keyName = "showStamina", - name = "Stamina timer", - description = "Configures whether stamina timer is displayed" - ) - default boolean showStamina() - { - return true; - } - - @ConfigItem( - keyName = "showAntiFire", - name = "AntiFire timer", - description = "Configures whether antifire timer is displayed" - ) - default boolean showAntiFire() - { - return true; - } - - @ConfigItem( - keyName = "showExAntiFire", - name = "Extended antifire timer", - description = "Configures whether extended antifire timer is displayed" - ) - default boolean showExAntiFire() - { - return true; - } - - @ConfigItem( - keyName = "showOverload", - name = "Overload timer", - description = "Configures whether overload timer is displayed" - ) - default boolean showOverload() - { - return true; - } - - @ConfigItem( - keyName = "showCannon", - name = "Cannon timer", - description = "Configures whether cannon timer is displayed" - ) - default boolean showCannon() - { - return true; - } - - @ConfigItem( - keyName = "showMagicImbue", - name = "Magic imbue timer", - description = "Configures whether magic imbue timer is displayed" - ) - default boolean showMagicImbue() - { - return true; - } - - @ConfigItem( - keyName = "showTeleblock", - name = "Teleblock timer", - description = "Configures whether teleblock timer is displayed" - ) - default boolean showTeleblock() - { - return true; - } - - @ConfigItem( - keyName = "showAntiVenomPlus", - name = "Anti-venom+ timer", - description = "Configures whether anti venom+ timer is displayed" - ) - default boolean showAntiVenomPlus() - { - 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; - } - - @ConfigItem( - keyName = "showImbuedHeart", - name = "Imbued heart timer", - description = "Configures whether imbued heart timer is displayed" - ) - default boolean showImbuedHeart() - { - return true; - } - - @ConfigItem( - keyName = "showVengeance", - name = "Vengeance timer", - description = "Configures whether vengeance timer is displayed" - ) - default boolean showVengeance() - { - return true; - } - - @ConfigItem( - keyName = "showVengeanceOther", - name = "Vengeance Other timer", - description = "Configures whether vengeance other timer is displayed" - ) - default boolean showVengeanceOther() - { - return true; - } - - @ConfigItem( - keyName = "showFreezes", - name = "Freeze timer", - description = "Configures whether freeze timer is displayed" - ) - default boolean showFreezes() - { - 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; - } - - @ConfigItem( - keyName = "showPrayerEnhance", - name = "Prayer enhance timer", - description = "Configures whether prayer enhance timer is displayed" - ) - default boolean showPrayerEnhance() - { - return true; - } - - @ConfigItem( - keyName = "showGodWarsAltar", - name = "God wars altar timer", - description = "Configures whether god wars altar timer is displayed" - ) - default boolean showGodWarsAltar() - { - return true; - } - - @ConfigItem( + position = 0, keyName = "showAntipoison", name = "Antipoison timer", description = "Configures whether Antipoison timer is displayed" @@ -246,6 +47,7 @@ public interface TimersConfig extends Config } @ConfigItem( + position = 1, keyName = "showSuperantipoison", name = "Superantipoison timer", description = "Configures whether Superantipoison timer is displayed" @@ -254,4 +56,224 @@ public interface TimersConfig extends Config { return true; } + + @ConfigItem( + position = 2, + keyName = "showAntidotePlus", + name = "Antidote+ timer", + description = "Configures whether antidote+ timer is displayed" + ) + default boolean showAntidotePlus() + { + return true; + } + + @ConfigItem( + position = 3, + keyName = "showAntidotePlusPlus", + name = "Antidote++ timer", + description = "Configures whether antidote++ timer is displayed" + ) + default boolean showAntidotePlusPlus() + { + return true; + } + + @ConfigItem( + position = 4, + keyName = "showSanfew", + name = "Sanfew serum timer", + description = "Configures whether sanfew serum timer is displayed" + ) + default boolean showSanfew() + { + return true; + } + + @ConfigItem( + position = 5, + keyName = "showAntiVenom", + name = "Anti-venom timer", + description = "Configures whether antivenom timer is displayed" + ) + default boolean showAntiVenom() + { + return true; + } + + @ConfigItem( + position = 6, + keyName = "showAntiVenomPlus", + name = "Anti-venom+ timer", + description = "Configures whether anti venom+ timer is displayed" + ) + default boolean showAntiVenomPlus() + { + return true; + } + + @ConfigItem( + position = 7, + keyName = "showAntiFire", + name = "AntiFire timer", + description = "Configures whether antifire timer is displayed" + ) + default boolean showAntiFire() + { + return true; + } + + @ConfigItem( + position = 8, + keyName = "showExAntiFire", + name = "Extended antifire timer", + description = "Configures whether extended antifire timer is displayed" + ) + default boolean showExAntiFire() + { + return true; + } + + @ConfigItem( + position = 9, + keyName = "showSuperAntiFire", + name = "Super antifire timer", + description = "Configures whether super antifire timer is displayed" + ) + default boolean showSuperAntiFire() + { + return true; + } + + @ConfigItem( + position = 10, + keyName = "showExSuperAntifire", + name = "Extended super antifire timer", + description = "Configures whether extended super antifire timer is displayed" + ) + default boolean showExSuperAntifire() + { + return true; + } + + @ConfigItem( + position = 11, + keyName = "showStamina", + name = "Stamina timer", + description = "Configures whether stamina timer is displayed" + ) + default boolean showStamina() + { + return true; + } + + @ConfigItem( + position = 12, + keyName = "showOverload", + name = "Overload timer", + description = "Configures whether overload timer is displayed" + ) + default boolean showOverload() + { + return true; + } + + @ConfigItem( + position = 13, + keyName = "showPrayerEnhance", + name = "Prayer enhance timer", + description = "Configures whether prayer enhance timer is displayed" + ) + default boolean showPrayerEnhance() + { + return true; + } + + @ConfigItem( + position = 14, + keyName = "showCannon", + name = "Cannon timer", + description = "Configures whether cannon timer is displayed" + ) + default boolean showCannon() + { + return true; + } + + @ConfigItem( + position = 15, + keyName = "showMagicImbue", + name = "Magic imbue timer", + description = "Configures whether magic imbue timer is displayed" + ) + default boolean showMagicImbue() + { + return true; + } + + @ConfigItem( + position = 16, + keyName = "showImbuedHeart", + name = "Imbued heart timer", + description = "Configures whether imbued heart timer is displayed" + ) + default boolean showImbuedHeart() + { + return true; + } + + @ConfigItem( + position = 17, + keyName = "showVengeance", + name = "Vengeance timer", + description = "Configures whether vengeance timer is displayed" + ) + default boolean showVengeance() + { + return true; + } + + @ConfigItem( + position = 18, + keyName = "showVengeanceOther", + name = "Vengeance Other timer", + description = "Configures whether vengeance other timer is displayed" + ) + default boolean showVengeanceOther() + { + return true; + } + + @ConfigItem( + position = 19, + keyName = "showTeleblock", + name = "Teleblock timer", + description = "Configures whether teleblock timer is displayed" + ) + default boolean showTeleblock() + { + return true; + } + + @ConfigItem( + position = 20, + keyName = "showFreezes", + name = "Freeze timer", + description = "Configures whether freeze timer is displayed" + ) + default boolean showFreezes() + { + return true; + } + + @ConfigItem( + position = 21, + keyName = "showGodWarsAltar", + name = "God wars altar timer", + description = "Configures whether god wars altar timer is displayed" + ) + default boolean showGodWarsAltar() + { + return true; + } }