Add Charge Timer

This commit is contained in:
Hydrox6
2018-05-31 17:04:02 +01:00
parent edb55fde3e
commit 1c76e38d4d
5 changed files with 30 additions and 6 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,6 +122,11 @@ public class TimersPlugin extends Plugin
@Subscribe @Subscribe
public void updateConfig(ConfigChanged event) public void updateConfig(ConfigChanged event)
{ {
if (!config.showCharge())
{
removeGameTimer(CHARGE);
}
if (!config.showStamina()) if (!config.showStamina())
{ {
removeGameTimer(STAMINA); removeGameTimer(STAMINA);
@@ -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