infernoplugin: add ticksOnNpcZukShield config option (#2089)
infernoplugin: add ticksOnNpcZukShield config option
This commit is contained in:
@@ -944,6 +944,18 @@ public interface InfernoConfig extends Config
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 4,
|
||||
keyName = "ticksOnNpcZukShield",
|
||||
name = "Ticks on Zuk Shield",
|
||||
description = "Draws the amount of ticks before Zuk attacks on the floating shield",
|
||||
section = "ZukSection"
|
||||
)
|
||||
default boolean ticksOnNpcZukShield()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
enum FontStyle
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
@@ -113,7 +114,12 @@ public class InfernoOverlay extends Overlay
|
||||
|
||||
if (plugin.isTicksOnNpc(infernoNPC) && infernoNPC.getTicksTillNextAttack() > 0)
|
||||
{
|
||||
renderTicksOnNpc(graphics, infernoNPC);
|
||||
renderTicksOnNpc(graphics, infernoNPC, infernoNPC.getNpc());
|
||||
}
|
||||
|
||||
if (plugin.isTicksOnNpcZukShield() && infernoNPC.getType() == InfernoNPC.Type.ZUK && plugin.getZukShield() != null && infernoNPC.getTicksTillNextAttack() > 0)
|
||||
{
|
||||
renderTicksOnNpc(graphics, infernoNPC, plugin.getZukShield());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,12 +351,12 @@ public class InfernoOverlay extends Overlay
|
||||
}
|
||||
}
|
||||
|
||||
private void renderTicksOnNpc(Graphics2D graphics, InfernoNPC infernoNPC)
|
||||
private void renderTicksOnNpc(Graphics2D graphics, InfernoNPC infernoNPC, NPC renderOnNPC)
|
||||
{
|
||||
final Color color = (infernoNPC.getTicksTillNextAttack() == 1
|
||||
|| (infernoNPC.getType() == InfernoNPC.Type.BLOB && infernoNPC.getTicksTillNextAttack() == 4))
|
||||
? infernoNPC.getNextAttack().getCriticalColor() : infernoNPC.getNextAttack().getNormalColor();
|
||||
final Point canvasPoint = infernoNPC.getNpc().getCanvasTextLocation(
|
||||
final Point canvasPoint = renderOnNPC.getCanvasTextLocation(
|
||||
graphics, String.valueOf(infernoNPC.getTicksTillNextAttack()), 0);
|
||||
OverlayUtil.renderTextLocation(graphics, String.valueOf(infernoNPC.getTicksTillNextAttack()),
|
||||
plugin.getTextSize(), plugin.getFontStyle().getFont(), color, canvasPoint, false, 0);
|
||||
|
||||
@@ -117,6 +117,7 @@ public class InfernoPlugin extends Plugin
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean finalPhase = false;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private NPC zukShield = null;
|
||||
private WorldPoint zukShieldLastPosition = null;
|
||||
private WorldPoint zukShieldBase = null;
|
||||
@@ -198,6 +199,9 @@ public class InfernoPlugin extends Plugin
|
||||
private boolean ticksOnNpcJad;
|
||||
private boolean ticksOnNpcZuk;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean ticksOnNpcZukShield;
|
||||
|
||||
private boolean safespotsBat;
|
||||
private boolean safespotsBlob;
|
||||
private boolean safespotsMeleer;
|
||||
@@ -1065,6 +1069,7 @@ public class InfernoPlugin extends Plugin
|
||||
this.ticksOnNpcHealerJad = config.ticksOnNpcHealerJad();
|
||||
this.ticksOnNpcJad = config.ticksOnNpcJad();
|
||||
this.ticksOnNpcZuk = config.ticksOnNpcZuk();
|
||||
this.ticksOnNpcZukShield = config.ticksOnNpcZukShield();
|
||||
|
||||
this.safespotsBat = config.safespotsBat();
|
||||
this.safespotsBlob = config.safespotsBlob();
|
||||
|
||||
Reference in New Issue
Block a user