diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesConfig.java index 2a956da851..1f93f0483f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesConfig.java @@ -78,11 +78,22 @@ public interface XpGlobesConfig extends Config return true; } + @ConfigItem( + keyName = "showTimeTilGoal", + name = "Show time til goal", + description = "Shows the amount of time until goal level in the globe tooltip box", + position = 4 + ) + default boolean showTimeTilGoal() + { + return true; + } + @ConfigItem( keyName = "hideMaxed", name = "Hide maxed skills", description = "Stop globes from showing up for level 99 skills", - position = 4 + position = 14 ) default boolean hideMaxed() { @@ -93,7 +104,7 @@ public interface XpGlobesConfig extends Config keyName = "showVirtualLevel", name = "Show virtual level", description = "Shows virtual level if over 99 in a skill and Hide maxed skill is not checked", - position = 5 + position = 15 ) default boolean showVirtualLevel() { @@ -104,7 +115,7 @@ public interface XpGlobesConfig extends Config keyName = "enableCustomArcColor", name = "Enable custom arc color", description = "Enables the custom coloring of the globe's arc instead of using the skill's default color.", - position = 6 + position = 16 ) default boolean enableCustomArcColor() { @@ -116,7 +127,7 @@ public interface XpGlobesConfig extends Config keyName = "Progress arc color", name = "Progress arc color", description = "Change the color of the progress arc in the xp orb", - position = 7 + position = 17 ) default Color progressArcColor() { @@ -128,7 +139,7 @@ public interface XpGlobesConfig extends Config keyName = "Progress orb outline color", name = "Progress orb outline color", description = "Change the color of the progress orb outline", - position = 8 + position = 18 ) default Color progressOrbOutLineColor() { @@ -140,7 +151,7 @@ public interface XpGlobesConfig extends Config keyName = "Progress orb background color", name = "Progress orb background color", description = "Change the color of the progress orb background", - position = 9 + position = 19 ) default Color progressOrbBackgroundColor() { @@ -151,7 +162,7 @@ public interface XpGlobesConfig extends Config keyName = "Progress arc width", name = "Progress arc width", description = "Change the stroke width of the progress arc", - position = 10 + position = 20 ) @Units(Units.PIXELS) default int progressArcStrokeWidth() @@ -163,7 +174,7 @@ public interface XpGlobesConfig extends Config keyName = "Orb size", name = "Size of orbs", description = "Change the size of the xp orbs", - position = 11 + position = 21 ) @Units(Units.PIXELS) default int xpOrbSize() @@ -175,7 +186,7 @@ public interface XpGlobesConfig extends Config keyName = "Orb duration", name = "Duration of orbs", description = "Change the duration the xp orbs are visible", - position = 12 + position = 22 ) @Units(Units.SECONDS) default int xpOrbDuration() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java index 1243c76712..abdc1998a7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java @@ -352,6 +352,16 @@ public class XpGlobesOverlay extends Overlay .build()); } } + + if (config.showTimeTilGoal()) + { + String timeLeft = xpTrackerService.getTimeTilGoal(mouseOverSkill.getSkill()); + xpTooltip.getChildren().add(LineComponent.builder() + .left("Time left:") + .leftColor(Color.ORANGE) + .right(timeLeft) + .build()); + } } tooltipManager.add(this.xpTooltip); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpStateSingle.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpStateSingle.java index cc58c69b55..c5a8226666 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpStateSingle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpStateSingle.java @@ -204,7 +204,7 @@ class XpStateSingle // return time remaining in hh:mm:ss or mm:ss format where hh can be > 24 if (durationHoursTotal > 0) { - return String.format("%02d:%02d:%02d", durationHoursTotal, durationMinutes, durationSeconds); + return String.format("%d:%02d:%02d", durationHoursTotal, durationMinutes, durationSeconds); } // Minutes and seconds will always be present diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerService.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerService.java index f423757528..379aadf9d6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerService.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerService.java @@ -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 getTimeTilGoal(Skill skill); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerServiceImpl.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerServiceImpl.java index 0968d14892..d10f410541 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerServiceImpl.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerServiceImpl.java @@ -80,4 +80,10 @@ class XpTrackerServiceImpl implements XpTrackerService { return plugin.getSkillSnapshot(skill).getEndGoalXp(); } + + @Override + public String getTimeTilGoal(Skill skill) + { + return plugin.getSkillSnapshot(skill).getTimeTillGoalShort(); + } }