Merge pull request #631 from nvisser/xp-next-level
Add time until next level to XP tracker
This commit is contained in:
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.xptracker;
|
|||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.LocalTime;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Experience;
|
import net.runelite.api.Experience;
|
||||||
@@ -50,6 +51,11 @@ class SkillXPInfo
|
|||||||
return toHourly(xpGained);
|
return toHourly(xpGained);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getXpSec()
|
||||||
|
{
|
||||||
|
return getXpHr() / 3600;
|
||||||
|
}
|
||||||
|
|
||||||
int getActionsHr()
|
int getActionsHr()
|
||||||
{
|
{
|
||||||
return toHourly(actions);
|
return toHourly(actions);
|
||||||
@@ -85,6 +91,15 @@ class SkillXPInfo
|
|||||||
return (int) ((xpGained / xpGoal) * 100);
|
return (int) ((xpGained / xpGoal) * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getTimeTillLevel()
|
||||||
|
{
|
||||||
|
if (getXpSec() > 0)
|
||||||
|
{
|
||||||
|
return LocalTime.MIN.plusSeconds( getXpRemaining() / getXpSec() ).toString();
|
||||||
|
}
|
||||||
|
return "\u221e";
|
||||||
|
}
|
||||||
|
|
||||||
void reset(int currentXp)
|
void reset(int currentXp)
|
||||||
{
|
{
|
||||||
if (startXp != -1)
|
if (startXp != -1)
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ class XpInfoBox extends JPanel
|
|||||||
+ XpPanel.formatLine(xpInfo.getActions(), "actions")
|
+ XpPanel.formatLine(xpInfo.getActions(), "actions")
|
||||||
+ "<br/>"
|
+ "<br/>"
|
||||||
+ XpPanel.formatLine(xpInfo.getActionsHr(), "actions/hr")
|
+ XpPanel.formatLine(xpInfo.getActionsHr(), "actions/hr")
|
||||||
|
+ "<br/>"
|
||||||
|
+ xpInfo.getTimeTillLevel() + " till next lvl"
|
||||||
+ "</html>");
|
+ "</html>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user