Merge pull request #3529 from Hydrox6/charge-timer

Add a Charge timer
This commit is contained in:
Adam
2018-06-02 21:20:07 -04:00
committed by GitHub
5 changed files with 80 additions and 56 deletions

View File

@@ -26,6 +26,7 @@ package net.runelite.api;
public class GraphicID public class GraphicID
{ {
public static final int CHARGE = 111;
public static final int ENTANGLE = 179; public static final int ENTANGLE = 179;
public static final int SNARE = 180; public static final int SNARE = 180;
public static final int BIND = 181; public static final int BIND = 181;

View File

@@ -69,7 +69,8 @@ public enum GameTimer
PRAYER_ENHANCE("prayerenhance", "Prayer enhance", 275, ChronoUnit.SECONDS), PRAYER_ENHANCE("prayerenhance", "Prayer enhance", 275, ChronoUnit.SECONDS),
GOD_WARS_ALTAR("altar", "God wars altar", 10, ChronoUnit.MINUTES), GOD_WARS_ALTAR("altar", "God wars altar", 10, ChronoUnit.MINUTES),
ANTIPOISON("antipoison", "Antipoison", 90, ChronoUnit.SECONDS), 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 @Getter
private final String imageResource; private final String imageResource;

View File

@@ -213,6 +213,17 @@ public interface TimersConfig extends Config
@ConfigItem( @ConfigItem(
position = 16, 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", keyName = "showImbuedHeart",
name = "Imbued heart timer", name = "Imbued heart timer",
description = "Configures whether imbued heart timer is displayed" description = "Configures whether imbued heart timer is displayed"
@@ -223,7 +234,7 @@ public interface TimersConfig extends Config
} }
@ConfigItem( @ConfigItem(
position = 17, position = 18,
keyName = "showVengeance", keyName = "showVengeance",
name = "Vengeance timer", name = "Vengeance timer",
description = "Configures whether vengeance timer is displayed" description = "Configures whether vengeance timer is displayed"
@@ -234,7 +245,7 @@ public interface TimersConfig extends Config
} }
@ConfigItem( @ConfigItem(
position = 18, position = 19,
keyName = "showVengeanceOther", keyName = "showVengeanceOther",
name = "Vengeance Other timer", name = "Vengeance Other timer",
description = "Configures whether vengeance other timer is displayed" description = "Configures whether vengeance other timer is displayed"
@@ -245,7 +256,7 @@ public interface TimersConfig extends Config
} }
@ConfigItem( @ConfigItem(
position = 19, position = 20,
keyName = "showTeleblock", keyName = "showTeleblock",
name = "Teleblock timer", name = "Teleblock timer",
description = "Configures whether teleblock timer is displayed" description = "Configures whether teleblock timer is displayed"
@@ -256,7 +267,7 @@ public interface TimersConfig extends Config
} }
@ConfigItem( @ConfigItem(
position = 20, position = 21,
keyName = "showFreezes", keyName = "showFreezes",
name = "Freeze timer", name = "Freeze timer",
description = "Configures whether freeze timer is displayed" description = "Configures whether freeze timer is displayed"
@@ -267,7 +278,7 @@ public interface TimersConfig extends Config
} }
@ConfigItem( @ConfigItem(
position = 21, position = 22,
keyName = "showGodWarsAltar", keyName = "showGodWarsAltar",
name = "God wars altar timer", name = "God wars altar timer",
description = "Configures whether god wars altar timer is displayed" description = "Configures whether god wars altar timer is displayed"

View File

@@ -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.ANTIVENOMPLUS;
import static net.runelite.client.plugins.timers.GameTimer.BIND; 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.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.ENTANGLE;
import static net.runelite.client.plugins.timers.GameTimer.EXANTIFIRE; 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.EXSUPERANTIFIRE;
@@ -121,46 +122,9 @@ public class TimersPlugin extends Plugin
@Subscribe @Subscribe
public void updateConfig(ConfigChanged event) public void updateConfig(ConfigChanged event)
{ {
if (!config.showStamina()) if (!config.showAntidotePlus())
{ {
removeGameTimer(STAMINA); removeGameTimer(ANTIDOTEPLUS);
}
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);
} }
if (!config.showAntidotePlusPlus()) if (!config.showAntidotePlusPlus())
@@ -168,9 +132,9 @@ public class TimersPlugin extends Plugin
removeGameTimer(ANTIDOTEPLUSPLUS); removeGameTimer(ANTIDOTEPLUSPLUS);
} }
if (!config.showAntidotePlus()) if (!config.showSanfew())
{ {
removeGameTimer(ANTIDOTEPLUS); removeGameTimer(SANFEW);
} }
if (!config.showAntiVenom()) if (!config.showAntiVenom())
@@ -183,9 +147,55 @@ public class TimersPlugin extends Plugin
removeGameTimer(ANTIVENOMPLUS); 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()) if (!config.showVengeance())
@@ -198,9 +208,10 @@ public class TimersPlugin extends Plugin
removeGameTimer(VENGEANCEOTHER); removeGameTimer(VENGEANCEOTHER);
} }
if (!config.showImbuedHeart()) if (!config.showTeleblock())
{ {
removeGameTimer(IMBUEDHEART); removeGameTimer(FULLTB);
removeGameTimer(HALFTB);
} }
if (!config.showFreezes()) if (!config.showFreezes())
@@ -216,11 +227,6 @@ public class TimersPlugin extends Plugin
removeGameTimer(ICEBLITZ); removeGameTimer(ICEBLITZ);
removeGameTimer(ICEBARRAGE); removeGameTimer(ICEBARRAGE);
} }
if (!config.showPrayerEnhance())
{
removeGameTimer(PRAYER_ENHANCE);
}
} }
@Subscribe @Subscribe
@@ -425,6 +431,11 @@ public class TimersPlugin extends Plugin
return; return;
} }
if (config.showCharge() && actor.getGraphic() == CHARGE.getGraphicId())
{
createGameTimer(CHARGE);
}
if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId()) if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId())
{ {
createGameTimer(IMBUEDHEART); createGameTimer(IMBUEDHEART);

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B