Add xp per hour to xp globes mouse-over tooltip

This commit is contained in:
Jonathan
2018-05-06 23:39:15 +02:00
committed by Adam
parent 35d9384c01
commit 56872da881
3 changed files with 17 additions and 0 deletions

View File

@@ -263,6 +263,10 @@ public class XpGlobesOverlay extends Overlay
.right(skillXpToLvl)
.build());
int xpHr = xpTrackerService.getXpHr(mouseOverSkill.getSkill());
String xpHrString = decimalFormat.format(xpHr);
lines.add(new PanelComponent.Line("Xp per hour:", Color.ORANGE, xpHrString, Color.WHITE));
//Create progress bar for skill.
ProgressBarComponent progressBar = new ProgressBarComponent();
double progress = mouseOverSkill.getSkillProgress(Experience.getXpForLevel(mouseOverSkill.getCurrentLevel()),

View File

@@ -48,4 +48,11 @@ public interface XpTrackerService
* @return
*/
int getActionsLeft(Skill skill);
/**
* Get the amount of xp per hour
* @param skill
* @return
*/
int getXpHr(Skill skill);
}

View File

@@ -56,4 +56,10 @@ class XpTrackerServiceImpl implements XpTrackerService
{
return plugin.getSkillSnapshot(skill).getActionsRemainingToGoal();
}
@Override
public int getXpHr(Skill skill)
{
return plugin.getSkillSnapshot(skill).getXpPerHour();
}
}