Add support for kills left in xp orbs
This commit is contained in:
@@ -42,6 +42,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.client.game.SkillIconManager;
|
||||
import net.runelite.client.plugins.xptracker.XpActionType;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerService;
|
||||
import net.runelite.client.ui.SkillColor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
@@ -250,12 +251,14 @@ public class XpGlobesOverlay extends Overlay
|
||||
|
||||
if (goalXp != -1)
|
||||
{
|
||||
XpActionType xpActionType = xpTrackerService.getActionType(mouseOverSkill.getSkill());
|
||||
|
||||
int actionsLeft = xpTrackerService.getActionsLeft(mouseOverSkill.getSkill());
|
||||
if (actionsLeft != Integer.MAX_VALUE)
|
||||
{
|
||||
String actionsLeftString = decimalFormat.format(actionsLeft);
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left("Actions left:")
|
||||
.left(xpActionType.getLabel() + " left:")
|
||||
.leftColor(Color.ORANGE)
|
||||
.right(actionsLeftString)
|
||||
.build());
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
enum XpActionType
|
||||
public enum XpActionType
|
||||
{
|
||||
EXPERIENCE("Actions"),
|
||||
ACTOR_HEALTH("Kills");
|
||||
|
||||
@@ -43,6 +43,11 @@ public interface XpTrackerService
|
||||
*/
|
||||
int getActionsLeft(Skill skill);
|
||||
|
||||
/**
|
||||
* Get the action type
|
||||
*/
|
||||
XpActionType getActionType(Skill skill);
|
||||
|
||||
/**
|
||||
* Get the amount of xp per hour
|
||||
*/
|
||||
|
||||
@@ -57,6 +57,12 @@ class XpTrackerServiceImpl implements XpTrackerService
|
||||
return plugin.getSkillSnapshot(skill).getActionsRemainingToGoal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public XpActionType getActionType(Skill skill)
|
||||
{
|
||||
return plugin.getSkillSnapshot(skill).getActionType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXpHr(Skill skill)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user