Add antipoison and superantipoison timers (#1159)

Add new timers for antipoison and superantipoison and respective resource images.
This commit is contained in:
jamesahhh
2018-03-28 05:36:59 -06:00
committed by Tomas Slusny
parent edcdc69b6a
commit c157514faa
5 changed files with 47 additions and 1 deletions

View File

@@ -66,7 +66,9 @@ public enum GameTimer
SANFEW("sanfew", "Sanfew serum", 6, ChronoUnit.MINUTES),
OVERLOAD_RAID("overloadraid", "Overload", 5, ChronoUnit.MINUTES),
PRAYER_ENHANCE("prayerenhance", "Prayer enhance", 290, 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),
SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS);
@Getter
private final String imageResource;

View File

@@ -224,4 +224,24 @@ public interface TimersConfig extends Config
{
return true;
}
@ConfigItem(
keyName = "showAntipoison",
name = "Antipoison timer",
description = "Configures whether Antipoison timer 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;
}
}

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.timers;
import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUS;
import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUSPLUS;
import static net.runelite.client.plugins.timers.GameTimer.ANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.ANTIPOISON;
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.CANNON;
@@ -53,6 +54,7 @@ import static net.runelite.client.plugins.timers.GameTimer.ICEBURST;
import static net.runelite.client.plugins.timers.GameTimer.ICERUSH;
import static net.runelite.client.plugins.timers.GameTimer.IMBUEDHEART;
import static net.runelite.client.plugins.timers.GameTimer.SNARE;
import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIPOISON;
import static net.runelite.client.plugins.timers.GameTimer.VENGEANCE;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Provides;
@@ -239,6 +241,28 @@ public class TimersPlugin extends Plugin
createGameTimer(ANTIDOTEPLUS);
return;
}
if (config.showAntiPoison()
&& event.getMenuOption().contains("Drink")
&& (event.getId() == ItemID.ANTIPOISON1
|| event.getId() == ItemID.ANTIPOISON2
|| event.getId() == ItemID.ANTIPOISON3
|| event.getId() == ItemID.ANTIPOISON4))
{
createGameTimer(ANTIPOISON);
return;
}
if (config.showSuperantipoison()
&& event.getMenuOption().contains("Drink")
&& (event.getId() == ItemID.SUPERANTIPOISON1
|| event.getId() == ItemID.SUPERANTIPOISON2
|| event.getId() == ItemID.SUPERANTIPOISON3
|| event.getId() == ItemID.SUPERANTIPOISON4))
{
createGameTimer(SUPERANTIPOISON);
return;
}
}
@Subscribe

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB