From de21ff40c93d93c072254b6f0ca3817c8d93d917 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Thu, 18 Oct 2018 23:29:14 +0200 Subject: [PATCH 1/2] Remove positions from Timers plugin config Just let it be sorted alphabetically, easier to navigate in. Signed-off-by: Tomas Slusny --- .../client/plugins/timers/TimersConfig.java | 26 ------------------- 1 file changed, 26 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 344967542e..ae060b7507 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 @@ -32,7 +32,6 @@ import net.runelite.client.config.ConfigItem; public interface TimersConfig extends Config { @ConfigItem( - position = 0, keyName = "showHomeMinigameTeleports", name = "Teleport cooldown timers", description = "Configures whether timers for home and minigame teleport cooldowns are displayed" @@ -43,7 +42,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 1, keyName = "showAntipoison", name = "Antipoison timer", description = "Configures whether Antipoison timer is displayed" @@ -54,7 +52,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 2, keyName = "showSuperantipoison", name = "Superantipoison timer", description = "Configures whether Superantipoison timer is displayed" @@ -65,7 +62,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 3, keyName = "showAntidotePlus", name = "Antidote+ timer", description = "Configures whether antidote+ timer is displayed" @@ -76,7 +72,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 4, keyName = "showAntidotePlusPlus", name = "Antidote++ timer", description = "Configures whether antidote++ timer is displayed" @@ -87,7 +82,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 5, keyName = "showSanfew", name = "Sanfew serum timer", description = "Configures whether sanfew serum timer is displayed" @@ -98,7 +92,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 6, keyName = "showAntiVenom", name = "Anti-venom timer", description = "Configures whether antivenom timer is displayed" @@ -109,7 +102,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 7, keyName = "showAntiVenomPlus", name = "Anti-venom+ timer", description = "Configures whether anti venom+ timer is displayed" @@ -120,7 +112,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 8, keyName = "showAntiFire", name = "Antifire timer", description = "Configures whether antifire timer is displayed" @@ -131,7 +122,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 9, keyName = "showExAntiFire", name = "Extended antifire timer", description = "Configures whether extended antifire timer is displayed" @@ -142,7 +132,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 10, keyName = "showSuperAntiFire", name = "Super antifire timer", description = "Configures whether super antifire timer is displayed" @@ -153,7 +142,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 11, keyName = "showExSuperAntifire", name = "Extended super antifire timer", description = "Configures whether extended super antifire timer is displayed" @@ -164,7 +152,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 12, keyName = "showStamina", name = "Stamina timer", description = "Configures whether stamina timer is displayed" @@ -175,7 +162,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 13, keyName = "showOverload", name = "Overload timer", description = "Configures whether overload timer is displayed" @@ -186,7 +172,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 14, keyName = "showPrayerEnhance", name = "Prayer enhance timer", description = "Configures whether prayer enhance timer is displayed" @@ -197,7 +182,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 15, keyName = "showCannon", name = "Cannon timer", description = "Configures whether cannon timer is displayed" @@ -208,7 +192,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 16, keyName = "showMagicImbue", name = "Magic imbue timer", description = "Configures whether magic imbue timer is displayed" @@ -219,7 +202,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 17, keyName = "showCharge", name = "Charge timer", description = "Configures whether to show a timer for the Charge spell" @@ -230,7 +212,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 18, keyName = "showImbuedHeart", name = "Imbued heart timer", description = "Configures whether imbued heart timer is displayed" @@ -241,7 +222,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 19, keyName = "showVengeance", name = "Vengeance timer", description = "Configures whether vengeance timer is displayed" @@ -252,7 +232,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 20, keyName = "showVengeanceOther", name = "Vengeance Other timer", description = "Configures whether vengeance other timer is displayed" @@ -263,7 +242,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 21, keyName = "showTeleblock", name = "Teleblock timer", description = "Configures whether teleblock timer is displayed" @@ -274,7 +252,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 22, keyName = "showFreezes", name = "Freeze timer", description = "Configures whether freeze timer is displayed" @@ -285,7 +262,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 23, keyName = "showGodWarsAltar", name = "God wars altar timer", description = "Configures whether god wars altar timer is displayed" @@ -296,7 +272,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 24, keyName = "showStaffOfTheDead", name = "Staff of the Dead timer", description = "Configures whether staff of the dead timer is displayed" @@ -307,7 +282,6 @@ public interface TimersConfig extends Config } @ConfigItem( - position = 25, keyName = "showAbyssalSireStun", name = "Abyssal Sire Stun Timer", description = "Configures whether Abyssal Sire stun timer is displayed" From 4b1c7fbc886e85a3e5d7a2dd7ac8ea1ca7c82ef0 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Thu, 18 Oct 2018 23:35:47 +0200 Subject: [PATCH 2/2] Merge common configs in Timers plugin Merge all similar config options in Timers plugin to common groups. Signed-off-by: Tomas Slusny --- .../client/plugins/timers/TimersConfig.java | 108 +----------------- .../client/plugins/timers/TimersPlugin.java | 60 +++------- 2 files changed, 20 insertions(+), 148 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 ae060b7507..f008a1c3fd 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 @@ -43,74 +43,14 @@ public interface TimersConfig extends Config @ConfigItem( keyName = "showAntipoison", - name = "Antipoison timer", - description = "Configures whether Antipoison timer is displayed" + name = "Antipoison/Venom timers", + description = "Configures whether timers for Antipoision, Antidoe, Antivenom are is displayed" ) default boolean showAntiPoison() { return true; } - @ConfigItem( - keyName = "showSuperantipoison", - name = "Superantipoison timer", - description = "Configures whether Superantipoison timer is displayed" - ) - default boolean showSuperantipoison() - { - return true; - } - - @ConfigItem( - keyName = "showAntidotePlus", - name = "Antidote+ timer", - description = "Configures whether antidote+ timer is displayed" - ) - default boolean showAntidotePlus() - { - return true; - } - - @ConfigItem( - keyName = "showAntidotePlusPlus", - name = "Antidote++ timer", - description = "Configures whether antidote++ timer is displayed" - ) - default boolean showAntidotePlusPlus() - { - return true; - } - - @ConfigItem( - keyName = "showSanfew", - name = "Sanfew serum timer", - description = "Configures whether sanfew serum timer is displayed" - ) - default boolean showSanfew() - { - return true; - } - - @ConfigItem( - keyName = "showAntiVenom", - name = "Anti-venom timer", - description = "Configures whether antivenom timer is displayed" - ) - default boolean showAntiVenom() - { - return true; - } - - @ConfigItem( - keyName = "showAntiVenomPlus", - name = "Anti-venom+ timer", - description = "Configures whether anti venom+ timer is displayed" - ) - default boolean showAntiVenomPlus() - { - return true; - } - @ConfigItem( keyName = "showAntiFire", name = "Antifire timer", @@ -121,36 +61,6 @@ public interface TimersConfig extends Config return true; } - @ConfigItem( - keyName = "showExAntiFire", - name = "Extended antifire timer", - description = "Configures whether extended antifire timer is displayed" - ) - default boolean showExAntiFire() - { - return true; - } - - @ConfigItem( - keyName = "showSuperAntiFire", - name = "Super antifire timer", - description = "Configures whether super antifire timer is displayed" - ) - default boolean showSuperAntiFire() - { - 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 = "showStamina", name = "Stamina timer", @@ -224,23 +134,13 @@ public interface TimersConfig extends Config @ConfigItem( keyName = "showVengeance", name = "Vengeance timer", - description = "Configures whether vengeance timer is displayed" + description = "Configures whether vengeance and vengeance other 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 = "showTeleblock", name = "Teleblock timer", @@ -283,7 +183,7 @@ public interface TimersConfig extends Config @ConfigItem( keyName = "showAbyssalSireStun", - name = "Abyssal Sire Stun Timer", + name = "Abyssal Sire stun Timer", description = "Configures whether Abyssal Sire stun timer is displayed" ) default boolean showAbyssalSireStun() 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 083013fe90..7bd608400e 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 @@ -198,43 +198,19 @@ public class TimersPlugin extends Plugin removeGameTimer(MINIGAME_TELEPORT); } - if (!config.showAntidotePlus()) + if (!config.showAntiPoison()) { removeGameTimer(ANTIDOTEPLUS); - } - - if (!config.showAntidotePlusPlus()) - { removeGameTimer(ANTIDOTEPLUSPLUS); - } - - if (!config.showSanfew()) - { removeGameTimer(SANFEW); - } - - if (!config.showAntiVenom()) - { removeGameTimer(ANTIVENOM); - } - - if (!config.showAntiVenomPlus()) - { removeGameTimer(ANTIVENOMPLUS); } if (!config.showAntiFire()) { removeGameTimer(ANTIFIRE); - } - - if (!config.showExAntiFire()) - { removeGameTimer(EXANTIFIRE); - } - - if (!config.showSuperAntiFire()) - { removeGameTimer(SUPERANTIFIRE); } @@ -282,10 +258,6 @@ public class TimersPlugin extends Plugin if (!config.showVengeance()) { removeGameTimer(VENGEANCE); - } - - if (!config.showVengeanceOther()) - { removeGameTimer(VENGEANCEOTHER); } @@ -312,7 +284,7 @@ public class TimersPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (config.showAntidotePlusPlus() + if (config.showAntiPoison() && event.getMenuOption().contains("Drink") && (event.getId() == ItemID.ANTIDOTE1_5958 || event.getId() == ItemID.ANTIDOTE2_5956 @@ -324,7 +296,7 @@ public class TimersPlugin extends Plugin return; } - if (config.showAntidotePlus() + if (config.showAntiPoison() && event.getMenuOption().contains("Drink") && (event.getId() == ItemID.ANTIDOTE1 || event.getId() == ItemID.ANTIDOTE2 @@ -347,7 +319,7 @@ public class TimersPlugin extends Plugin return; } - if (config.showSuperantipoison() + if (config.showAntiPoison() && event.getMenuOption().contains("Drink") && (event.getId() == ItemID.SUPERANTIPOISON1 || event.getId() == ItemID.SUPERANTIPOISON2 @@ -389,7 +361,7 @@ public class TimersPlugin extends Plugin createGameTimer(STAMINA); } - if (event.getMessage().equals(STAMINA_EXPIRED_MESSAGE)) + if (config.showStamina() && event.getMessage().equals(STAMINA_EXPIRED_MESSAGE)) { removeGameTimer(STAMINA); } @@ -399,7 +371,7 @@ public class TimersPlugin extends Plugin createGameTimer(ANTIFIRE); } - if (config.showExAntiFire() && event.getMessage().equals(EXTENDED_ANTIFIRE_DRINK_MESSAGE)) + if (config.showAntiFire() && event.getMessage().equals(EXTENDED_ANTIFIRE_DRINK_MESSAGE)) { createGameTimer(EXANTIFIRE); } @@ -409,12 +381,12 @@ public class TimersPlugin extends Plugin createGameTimer(GOD_WARS_ALTAR); } - if (config.showExSuperAntifire() && event.getMessage().equals(EXTENDED_SUPER_ANTIFIRE_DRINK_MESSAGE)) + if (config.showAntiFire() && event.getMessage().equals(EXTENDED_SUPER_ANTIFIRE_DRINK_MESSAGE)) { createGameTimer(EXSUPERANTIFIRE); } - if (event.getMessage().equals(ANTIFIRE_EXPIRED_MESSAGE)) + if (config.showAntiFire() && event.getMessage().equals(ANTIFIRE_EXPIRED_MESSAGE)) { //they have the same expired message removeGameTimer(ANTIFIRE); @@ -439,12 +411,12 @@ public class TimersPlugin extends Plugin createGameTimer(CANNON); } - if (event.getMessage().equals(CANNON_PICKUP_MESSAGE)) + if (config.showCannon() && event.getMessage().equals(CANNON_PICKUP_MESSAGE)) { removeGameTimer(CANNON); } - if (config.showAntiVenomPlus() && event.getMessage().contains(SUPER_ANTIVENOM_DRINK_MESSAGE)) + if (config.showAntiPoison() && event.getMessage().contains(SUPER_ANTIVENOM_DRINK_MESSAGE)) { createGameTimer(ANTIVENOMPLUS); } @@ -481,27 +453,27 @@ public class TimersPlugin extends Plugin createGameTimer(DMM_HALFTB); } - if (config.showSuperAntiFire() && event.getMessage().contains(SUPER_ANTIFIRE_DRINK_MESSAGE)) + if (config.showAntiFire() && event.getMessage().contains(SUPER_ANTIFIRE_DRINK_MESSAGE)) { createGameTimer(SUPERANTIFIRE); } - if (event.getMessage().equals(SUPER_ANTIFIRE_EXPIRED_MESSAGE)) + if (config.showAntiFire() && event.getMessage().equals(SUPER_ANTIFIRE_EXPIRED_MESSAGE)) { removeGameTimer(SUPERANTIFIRE); } - if (event.getMessage().equals(IMBUED_HEART_READY_MESSAGE)) + if (config.showImbuedHeart() && event.getMessage().equals(IMBUED_HEART_READY_MESSAGE)) { removeGameTimer(IMBUEDHEART); } - if (config.showAntiVenom() && event.getMessage().contains(ANTIVENOM_DRINK_MESSAGE)) + if (config.showAntiPoison() && event.getMessage().contains(ANTIVENOM_DRINK_MESSAGE)) { createGameTimer(ANTIVENOM); } - if (config.showSanfew() && event.getMessage().contains(SANFEW_SERUM_DRINK_MESSAGE)) + if (config.showAntiPoison() && event.getMessage().contains(SANFEW_SERUM_DRINK_MESSAGE)) { createGameTimer(SANFEW); } @@ -625,7 +597,7 @@ public class TimersPlugin extends Plugin return; } - if (config.showVengeanceOther() + if (config.showVengeance() && actor.getAnimation() == AnimationID.ENERGY_TRANSFER_VENGEANCE_OTHER && actor.getInteracting().getGraphic() == VENGEANCEOTHER.getGraphicId()) {