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 static final int CHARGE = 111;
public static final int ENTANGLE = 179;
public static final int SNARE = 180;
public static final int BIND = 181;

View File

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

View File

@@ -213,6 +213,17 @@ public interface TimersConfig extends Config
@ConfigItem(
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",
name = "Imbued heart timer",
description = "Configures whether imbued heart timer is displayed"
@@ -223,7 +234,7 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 17,
position = 18,
keyName = "showVengeance",
name = "Vengeance timer",
description = "Configures whether vengeance timer is displayed"
@@ -234,7 +245,7 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 18,
position = 19,
keyName = "showVengeanceOther",
name = "Vengeance Other timer",
description = "Configures whether vengeance other timer is displayed"
@@ -245,7 +256,7 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 19,
position = 20,
keyName = "showTeleblock",
name = "Teleblock timer",
description = "Configures whether teleblock timer is displayed"
@@ -256,7 +267,7 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 20,
position = 21,
keyName = "showFreezes",
name = "Freeze timer",
description = "Configures whether freeze timer is displayed"
@@ -267,7 +278,7 @@ public interface TimersConfig extends Config
}
@ConfigItem(
position = 21,
position = 22,
keyName = "showGodWarsAltar",
name = "God wars altar timer",
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.BIND;
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.EXANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.EXSUPERANTIFIRE;
@@ -121,6 +122,11 @@ public class TimersPlugin extends Plugin
@Subscribe
public void updateConfig(ConfigChanged event)
{
if (!config.showCharge())
{
removeGameTimer(CHARGE);
}
if (!config.showStamina())
{
removeGameTimer(STAMINA);
@@ -425,6 +431,11 @@ public class TimersPlugin extends Plugin
return;
}
if (config.showCharge() && actor.getGraphic() == CHARGE.getGraphicId())
{
createGameTimer(CHARGE);
}
if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId())
{
createGameTimer(IMBUEDHEART);

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B