Add time till next level to xptracker
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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>");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user