timers plugin: respect enabled configuration
This commit is contained in:
@@ -115,6 +115,12 @@ public class TimersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void updateConfig(ConfigChanged event)
|
public void updateConfig(ConfigChanged event)
|
||||||
{
|
{
|
||||||
|
if (!config.enabled())
|
||||||
|
{
|
||||||
|
infoBoxManager.removeIf(t -> t instanceof TimerTimer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.showStamina())
|
if (!config.showStamina())
|
||||||
{
|
{
|
||||||
removeGameTimer(STAMINA);
|
removeGameTimer(STAMINA);
|
||||||
@@ -220,6 +226,11 @@ public class TimersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||||
{
|
{
|
||||||
|
if (!config.enabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (config.showAntidotePlusPlus()
|
if (config.showAntidotePlusPlus()
|
||||||
&& event.getMenuOption().contains("Drink")
|
&& event.getMenuOption().contains("Drink")
|
||||||
&& (event.getId() == ItemID.ANTIDOTE1_5958
|
&& (event.getId() == ItemID.ANTIDOTE1_5958
|
||||||
@@ -248,6 +259,11 @@ public class TimersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onChatMessage(ChatMessage event)
|
public void onChatMessage(ChatMessage event)
|
||||||
{
|
{
|
||||||
|
if (!config.enabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getType() != ChatMessageType.FILTERED && event.getType() != ChatMessageType.SERVER)
|
if (event.getType() != ChatMessageType.FILTERED && event.getType() != ChatMessageType.SERVER)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -367,6 +383,11 @@ public class TimersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGraphicChanged(GraphicChanged event)
|
public void onGraphicChanged(GraphicChanged event)
|
||||||
{
|
{
|
||||||
|
if (!config.enabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Actor actor = event.getActor();
|
Actor actor = event.getActor();
|
||||||
|
|
||||||
if (actor != client.getLocalPlayer())
|
if (actor != client.getLocalPlayer())
|
||||||
|
|||||||
Reference in New Issue
Block a user