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