Add Time to level to XP Globes tooltip

This commit is contained in:
Shaun Dreclin
2019-01-21 17:17:05 -05:00
parent 90711882e0
commit 32c7b74b23
3 changed files with 18 additions and 0 deletions

View File

@@ -283,6 +283,13 @@ public class XpGlobesOverlay extends Overlay
.right(xpHrString)
.build());
}
String timeLeft = xpTrackerService.getTimeTillGoal(mouseOverSkill.getSkill());
xpTooltip.getChildren().add(LineComponent.builder()
.left("Time left:")
.leftColor(Color.ORANGE)
.right(timeLeft)
.build());
}
xpTooltip.render(graphics);

View File

@@ -62,4 +62,9 @@ public interface XpTrackerService
* Get the amount of XP left until goal level
*/
int getEndGoalXp(Skill skill);
/**
* Get the amount of time left until goal level
*/
String getTimeTillGoal(Skill skill);
}

View File

@@ -80,4 +80,10 @@ class XpTrackerServiceImpl implements XpTrackerService
{
return plugin.getSkillSnapshot(skill).getEndGoalXp();
}
@Override
public String getTimeTillGoal(Skill skill)
{
return plugin.getSkillSnapshot(skill).getTimeTillGoal();
}
}