Merge pull request #6070 from deathbeam/cleanup-timers-config

Merge common config options in Timers config together + sort by name
This commit is contained in:
Tomas Slusny
2018-10-19 08:53:29 +02:00
committed by GitHub
2 changed files with 20 additions and 174 deletions

View File

@@ -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,10 +42,9 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 1,
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()
{
@@ -54,73 +52,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 2,
keyName = "showSuperantipoison",
name = "Superantipoison timer",
description = "Configures whether Superantipoison timer is displayed"
)
default boolean showSuperantipoison()
{
return true;
}
@ConfigItem(
position = 3,
keyName = "showAntidotePlus",
name = "Antidote+ timer",
description = "Configures whether antidote+ timer is displayed"
)
default boolean showAntidotePlus()
{
return true;
}
@ConfigItem(
position = 4,
keyName = "showAntidotePlusPlus",
name = "Antidote++ timer",
description = "Configures whether antidote++ timer is displayed"
)
default boolean showAntidotePlusPlus()
{
return true;
}
@ConfigItem(
position = 5,
keyName = "showSanfew",
name = "Sanfew serum timer",
description = "Configures whether sanfew serum timer is displayed"
)
default boolean showSanfew()
{
return true;
}
@ConfigItem(
position = 6,
keyName = "showAntiVenom",
name = "Anti-venom timer",
description = "Configures whether antivenom timer is displayed"
)
default boolean showAntiVenom()
{
return true;
}
@ConfigItem(
position = 7,
keyName = "showAntiVenomPlus",
name = "Anti-venom+ timer",
description = "Configures whether anti venom+ timer is displayed"
)
default boolean showAntiVenomPlus()
{
return true;
}
@ConfigItem(
position = 8,
keyName = "showAntiFire",
name = "Antifire timer",
description = "Configures whether antifire timer is displayed"
@@ -131,40 +62,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 9,
keyName = "showExAntiFire",
name = "Extended antifire timer",
description = "Configures whether extended antifire timer is displayed"
)
default boolean showExAntiFire()
{
return true;
}
@ConfigItem(
position = 10,
keyName = "showSuperAntiFire",
name = "Super antifire timer",
description = "Configures whether super antifire timer is displayed"
)
default boolean showSuperAntiFire()
{
return true;
}
@ConfigItem(
position = 11,
keyName = "showExSuperAntifire",
name = "Extended super antifire timer",
description = "Configures whether extended super antifire timer is displayed"
)
default boolean showExSuperAntifire()
{
return true;
}
@ConfigItem(
position = 12,
keyName = "showStamina",
name = "Stamina timer",
description = "Configures whether stamina timer is displayed"
@@ -175,7 +72,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 13,
keyName = "showOverload",
name = "Overload timer",
description = "Configures whether overload timer is displayed"
@@ -186,7 +82,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 +92,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 15,
keyName = "showCannon",
name = "Cannon timer",
description = "Configures whether cannon timer is displayed"
@@ -208,7 +102,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 +112,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 +122,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 18,
keyName = "showImbuedHeart",
name = "Imbued heart timer",
description = "Configures whether imbued heart timer is displayed"
@@ -241,10 +132,9 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 19,
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()
{
@@ -252,18 +142,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 20,
keyName = "showVengeanceOther",
name = "Vengeance Other timer",
description = "Configures whether vengeance other timer is displayed"
)
default boolean showVengeanceOther()
{
return true;
}
@ConfigItem(
position = 21,
keyName = "showTeleblock",
name = "Teleblock timer",
description = "Configures whether teleblock timer is displayed"
@@ -274,7 +152,6 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 22,
keyName = "showFreezes",
name = "Freeze timer",
description = "Configures whether freeze timer is displayed"
@@ -285,7 +162,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 +172,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,9 +182,8 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 25,
keyName = "showAbyssalSireStun",
name = "Abyssal Sire Stun Timer",
name = "Abyssal Sire stun Timer",
description = "Configures whether Abyssal Sire stun timer is displayed"
)
default boolean showAbyssalSireStun()

View File

@@ -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())
{