Add time till next level to xptracker

This commit is contained in:
nvisser
2018-03-10 15:59:43 +01:00
parent 46553da6da
commit fb87dba205
2 changed files with 17 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ package net.runelite.client.plugins.xptracker;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalTime;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Experience;
@@ -50,6 +51,11 @@ class SkillXPInfo
return toHourly(xpGained);
}
int getXpSec()
{
return getXpHr() / 3600;
}
int getActionsHr()
{
return toHourly(actions);
@@ -85,6 +91,15 @@ class SkillXPInfo
return (int) ((xpGained / xpGoal) * 100);
}
String getTimeTillLevel()
{
if (getXpSec() > 0)
{
return LocalTime.MIN.plusSeconds( getXpRemaining() / getXpSec() ).toString();
}
return "\u221e";
}
void reset(int currentXp)
{
if (startXp != -1)

View File

@@ -238,6 +238,8 @@ class XpInfoBox extends JPanel
+ XpPanel.formatLine(xpInfo.getActions(), "actions")
+ "<br/>"
+ XpPanel.formatLine(xpInfo.getActionsHr(), "actions/hr")
+ "<br/>"
+ xpInfo.getTimeTillLevel() + " till next lvl"
+ "</html>");
}