Add raid varbit check to remove timers
This commit is contained in:
@@ -62,7 +62,7 @@ public enum GameTimer
|
|||||||
IMBUEDHEART("imbuedheart", "Imbued heart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS),
|
IMBUEDHEART("imbuedheart", "Imbued heart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS),
|
||||||
VENGEANCE("vengeance", "Vengeance", GraphicID.VENGEANCE, 30, ChronoUnit.SECONDS),
|
VENGEANCE("vengeance", "Vengeance", GraphicID.VENGEANCE, 30, ChronoUnit.SECONDS),
|
||||||
ANTIDOTEPLUS("antidoteplus", "Antidote+", 518, ChronoUnit.SECONDS),
|
ANTIDOTEPLUS("antidoteplus", "Antidote+", 518, ChronoUnit.SECONDS),
|
||||||
ANTIVENOM("antivenom", "Anto-venom", 12, ChronoUnit.MINUTES),
|
ANTIVENOM("antivenom", "Anti-venom", 12, ChronoUnit.MINUTES),
|
||||||
EXSUPERANTIFIRE("exsuperantifire", "Extended Super AntiFire", 6, ChronoUnit.MINUTES),
|
EXSUPERANTIFIRE("exsuperantifire", "Extended Super AntiFire", 6, ChronoUnit.MINUTES),
|
||||||
SANFEW("sanfew", "Sanfew serum", 6, ChronoUnit.MINUTES),
|
SANFEW("sanfew", "Sanfew serum", 6, ChronoUnit.MINUTES),
|
||||||
OVERLOAD_RAID("overloadraid", "Overload", 5, ChronoUnit.MINUTES),
|
OVERLOAD_RAID("overloadraid", "Overload", 5, ChronoUnit.MINUTES),
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ import net.runelite.api.ItemID;
|
|||||||
import net.runelite.api.Prayer;
|
import net.runelite.api.Prayer;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.GraphicChanged;
|
import net.runelite.api.events.GraphicChanged;
|
||||||
|
import net.runelite.api.events.VarbitChanged;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
@@ -76,6 +77,8 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
|||||||
)
|
)
|
||||||
public class TimersPlugin extends Plugin
|
public class TimersPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
private int lastRaidVarb;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Client client;
|
Client client;
|
||||||
|
|
||||||
@@ -97,6 +100,18 @@ public class TimersPlugin extends Plugin
|
|||||||
infoBoxManager.removeIf(t -> t instanceof TimerTimer);
|
infoBoxManager.removeIf(t -> t instanceof TimerTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onVarbitChange(VarbitChanged event)
|
||||||
|
{
|
||||||
|
int raidVarb = client.getSetting(Varbits.IN_RAID);
|
||||||
|
if (lastRaidVarb != raidVarb)
|
||||||
|
{
|
||||||
|
removeGameTimer(OVERLOAD_RAID);
|
||||||
|
removeGameTimer(PRAYER_ENHANCE);
|
||||||
|
lastRaidVarb = raidVarb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void updateConfig(ConfigChanged event)
|
public void updateConfig(ConfigChanged event)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user