Merge pull request #85 from ShaunDreclin/xp-globes-ttl

Add Time to level to XP Globes tooltip
This commit is contained in:
gazivodag
2019-04-24 05:01:19 -04:00
committed by GitHub
3 changed files with 18 additions and 0 deletions

View File

@@ -292,6 +292,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();
}
}