Add Antidote++ timer to TimerPlugin
Add missing Antidote++ timer to TimerPlugin Closes #334 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -45,7 +45,8 @@ public enum GameTimer
|
||||
FULLTB("teleblock", 5, ChronoUnit.MINUTES),
|
||||
HALFTB("teleblock", 150, ChronoUnit.SECONDS),
|
||||
SUPERANTIVENOM("antivenom", 3, ChronoUnit.MINUTES),
|
||||
SUPERANTIFIRE("superantifire", 2, ChronoUnit.MINUTES);
|
||||
SUPERANTIFIRE("superantifire", 2, ChronoUnit.MINUTES),
|
||||
ANTIDOTEPLUSPLUS("antidoteplusplus", 12, ChronoUnit.MINUTES);
|
||||
|
||||
private final String imageResource;
|
||||
private final Duration duration;
|
||||
|
||||
@@ -134,4 +134,14 @@ public interface TimersConfig extends Config
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "showAntidotePlusPlus",
|
||||
name = "Antidote++ timer",
|
||||
description = "Configures whether antidote++ timer is displayed"
|
||||
)
|
||||
default boolean showAntidotePlusPlus()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.timers;
|
||||
|
||||
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.CANNON;
|
||||
import static net.runelite.client.plugins.timers.GameTimer.EXANTIFIRE;
|
||||
@@ -38,9 +39,11 @@ import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.events.ChatMessage;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.events.MenuOptionClicked;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
@@ -110,6 +113,26 @@ public class TimersPlugin extends Plugin
|
||||
{
|
||||
removeGameTimer(SUPERANTIFIRE);
|
||||
}
|
||||
|
||||
if (!config.showAntidotePlusPlus())
|
||||
{
|
||||
removeGameTimer(ANTIDOTEPLUSPLUS);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (config.showAntidotePlusPlus()
|
||||
&& event.getMenuOption().contains("Drink")
|
||||
&& (event.getId() == ItemID.ANTIDOTE1_5958
|
||||
|| event.getId() == ItemID.ANTIDOTE2_5956
|
||||
|| event.getId() == ItemID.ANTIDOTE3_5954
|
||||
|| event.getId() == ItemID.ANTIDOTE4_5952))
|
||||
{
|
||||
// Needs menu option hook because drink message is intercepting with antipoison message
|
||||
createGameTimer(ANTIDOTEPLUSPLUS);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 751 B |
Reference in New Issue
Block a user