Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/main/java/com/attacktimer/AttackTimerMetronomeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import net.runelite.client.config.Range;
import net.runelite.client.config.ConfigSection;
import net.runelite.client.config.Keybind;
import java.awt.Color;

import java.awt.*;

@ConfigGroup("attacktimermetronome")
public interface AttackTimerMetronomeConfig extends Config
Expand Down Expand Up @@ -92,6 +93,26 @@ default Color NumberColor()
)
default FontTypes fontType() { return FontTypes.REGULAR; }

@ConfigItem(
position = 7,
keyName = "xOffset",
name = "Horizontal Offset",
description = "Change the horizontal offset of the Tick Number",
section = TickNumberSettings
)
@Range(min = -4096, max = 4096)
default int xOffset() { return 0;};

@ConfigItem(
position = 8,
keyName = "yOffset",
name = "Vertical Offset",
description = "Change the vertical offset of the Tick Number",
section = TickNumberSettings
)
@Range(min = -4096, max = 4096)
default int yOffset() { return 0;};

@ConfigSection(
name = "Attack Bar",
description = "Change the colors and number of colors to cycle through",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ public Dimension render(Graphics2D graphics)
final int height = client.getLocalPlayer().getLogicalHeight()+20;
final LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
final Point playerPoint = Perspective.localToCanvas(client, localLocation, client.getPlane(), height);
assert playerPoint != null;
final Point finalPoint = new Point(playerPoint.getX() + config.xOffset(), playerPoint.getY() - config.yOffset());

// Countdown ticks instead of up.
// plugin.tickCounter => ticksRemaining
int ticksRemaining = plugin.getTicksUntilNextAttack();
OverlayUtil.renderTextLocation(graphics, playerPoint, String.valueOf(ticksRemaining), config.NumberColor());
OverlayUtil.renderTextLocation(graphics, finalPoint, String.valueOf(ticksRemaining), config.NumberColor());
}

return null;
Expand Down