Fixed when Toggle Option is off on Login
- This caused an issue where the delay would be ignored after setting it on after login
This commit is contained in:
@@ -81,32 +81,34 @@ public class StatusBarsPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameTick(GameTick gameTick)
|
public void onGameTick(GameTick gameTick)
|
||||||
{
|
{
|
||||||
final Actor interacting = client.getLocalPlayer().getInteracting();
|
|
||||||
final boolean isNpc = interacting instanceof NPC;
|
|
||||||
final int COMBAT_TIMEOUT = config.hideStatusBarDelay();
|
|
||||||
|
|
||||||
if (!config.toggleRestorationBars())
|
if (!config.toggleRestorationBars())
|
||||||
{
|
{
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (isNpc)
|
|
||||||
{
|
{
|
||||||
final NPC npc = (NPC) interacting;
|
final Actor interacting = client.getLocalPlayer().getInteracting();
|
||||||
final NPCComposition npcComposition = npc.getComposition();
|
final boolean isNpc = interacting instanceof NPC;
|
||||||
final List<String> npcMenuActions = Arrays.asList(npcComposition.getActions());
|
final int COMBAT_TIMEOUT = config.hideStatusBarDelay();
|
||||||
if (npcMenuActions.contains("Attack"))
|
|
||||||
|
if (isNpc)
|
||||||
|
{
|
||||||
|
final NPC npc = (NPC) interacting;
|
||||||
|
final NPCComposition npcComposition = npc.getComposition();
|
||||||
|
final List<String> npcMenuActions = Arrays.asList(npcComposition.getActions());
|
||||||
|
if (npcMenuActions.contains("Attack") && config.toggleRestorationBars())
|
||||||
{
|
{
|
||||||
updateLastCombatAction();
|
updateLastCombatAction();
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (lastCombatAction != null)
|
else if (lastCombatAction != null)
|
||||||
{
|
|
||||||
if (Duration.between(getLastCombatAction(), Instant.now()).getSeconds() > COMBAT_TIMEOUT)
|
|
||||||
{
|
{
|
||||||
overlayManager.remove(overlay);
|
if (Duration.between(getLastCombatAction(), Instant.now()).getSeconds() > COMBAT_TIMEOUT)
|
||||||
|
{
|
||||||
|
overlayManager.remove(overlay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user