xpglobes: add time to level to tooltip
Co-authored-by: Shaun Dreclin <ShaunDreclin@users.noreply.github.com>
This commit is contained in:
@@ -78,11 +78,22 @@ public interface XpGlobesConfig extends Config
|
|||||||
return true;
|
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(
|
@ConfigItem(
|
||||||
keyName = "hideMaxed",
|
keyName = "hideMaxed",
|
||||||
name = "Hide maxed skills",
|
name = "Hide maxed skills",
|
||||||
description = "Stop globes from showing up for level 99 skills",
|
description = "Stop globes from showing up for level 99 skills",
|
||||||
position = 4
|
position = 14
|
||||||
)
|
)
|
||||||
default boolean hideMaxed()
|
default boolean hideMaxed()
|
||||||
{
|
{
|
||||||
@@ -93,7 +104,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "showVirtualLevel",
|
keyName = "showVirtualLevel",
|
||||||
name = "Show virtual level",
|
name = "Show virtual level",
|
||||||
description = "Shows virtual level if over 99 in a skill and Hide maxed skill is not checked",
|
description = "Shows virtual level if over 99 in a skill and Hide maxed skill is not checked",
|
||||||
position = 5
|
position = 15
|
||||||
)
|
)
|
||||||
default boolean showVirtualLevel()
|
default boolean showVirtualLevel()
|
||||||
{
|
{
|
||||||
@@ -104,7 +115,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "enableCustomArcColor",
|
keyName = "enableCustomArcColor",
|
||||||
name = "Enable custom arc color",
|
name = "Enable custom arc color",
|
||||||
description = "Enables the custom coloring of the globe's arc instead of using the skill's default 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()
|
default boolean enableCustomArcColor()
|
||||||
{
|
{
|
||||||
@@ -116,7 +127,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "Progress arc color",
|
keyName = "Progress arc color",
|
||||||
name = "Progress arc color",
|
name = "Progress arc color",
|
||||||
description = "Change the color of the progress arc in the xp orb",
|
description = "Change the color of the progress arc in the xp orb",
|
||||||
position = 7
|
position = 17
|
||||||
)
|
)
|
||||||
default Color progressArcColor()
|
default Color progressArcColor()
|
||||||
{
|
{
|
||||||
@@ -128,7 +139,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "Progress orb outline color",
|
keyName = "Progress orb outline color",
|
||||||
name = "Progress orb outline color",
|
name = "Progress orb outline color",
|
||||||
description = "Change the color of the progress orb outline",
|
description = "Change the color of the progress orb outline",
|
||||||
position = 8
|
position = 18
|
||||||
)
|
)
|
||||||
default Color progressOrbOutLineColor()
|
default Color progressOrbOutLineColor()
|
||||||
{
|
{
|
||||||
@@ -140,7 +151,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "Progress orb background color",
|
keyName = "Progress orb background color",
|
||||||
name = "Progress orb background color",
|
name = "Progress orb background color",
|
||||||
description = "Change the color of the progress orb background",
|
description = "Change the color of the progress orb background",
|
||||||
position = 9
|
position = 19
|
||||||
)
|
)
|
||||||
default Color progressOrbBackgroundColor()
|
default Color progressOrbBackgroundColor()
|
||||||
{
|
{
|
||||||
@@ -151,7 +162,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "Progress arc width",
|
keyName = "Progress arc width",
|
||||||
name = "Progress arc width",
|
name = "Progress arc width",
|
||||||
description = "Change the stroke width of the progress arc",
|
description = "Change the stroke width of the progress arc",
|
||||||
position = 10
|
position = 20
|
||||||
)
|
)
|
||||||
@Units(Units.PIXELS)
|
@Units(Units.PIXELS)
|
||||||
default int progressArcStrokeWidth()
|
default int progressArcStrokeWidth()
|
||||||
@@ -163,7 +174,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "Orb size",
|
keyName = "Orb size",
|
||||||
name = "Size of orbs",
|
name = "Size of orbs",
|
||||||
description = "Change the size of the xp orbs",
|
description = "Change the size of the xp orbs",
|
||||||
position = 11
|
position = 21
|
||||||
)
|
)
|
||||||
@Units(Units.PIXELS)
|
@Units(Units.PIXELS)
|
||||||
default int xpOrbSize()
|
default int xpOrbSize()
|
||||||
@@ -175,7 +186,7 @@ public interface XpGlobesConfig extends Config
|
|||||||
keyName = "Orb duration",
|
keyName = "Orb duration",
|
||||||
name = "Duration of orbs",
|
name = "Duration of orbs",
|
||||||
description = "Change the duration the xp orbs are visible",
|
description = "Change the duration the xp orbs are visible",
|
||||||
position = 12
|
position = 22
|
||||||
)
|
)
|
||||||
@Units(Units.SECONDS)
|
@Units(Units.SECONDS)
|
||||||
default int xpOrbDuration()
|
default int xpOrbDuration()
|
||||||
|
|||||||
@@ -352,6 +352,16 @@ public class XpGlobesOverlay extends Overlay
|
|||||||
.build());
|
.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);
|
tooltipManager.add(this.xpTooltip);
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class XpStateSingle
|
|||||||
// return time remaining in hh:mm:ss or mm:ss format where hh can be > 24
|
// return time remaining in hh:mm:ss or mm:ss format where hh can be > 24
|
||||||
if (durationHoursTotal > 0)
|
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
|
// Minutes and seconds will always be present
|
||||||
|
|||||||
@@ -62,4 +62,9 @@ public interface XpTrackerService
|
|||||||
* Get the amount of XP left until goal level
|
* Get the amount of XP left until goal level
|
||||||
*/
|
*/
|
||||||
int getEndGoalXp(Skill skill);
|
int getEndGoalXp(Skill skill);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the amount of time left until goal level
|
||||||
|
*/
|
||||||
|
String getTimeTilGoal(Skill skill);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,4 +80,10 @@ class XpTrackerServiceImpl implements XpTrackerService
|
|||||||
{
|
{
|
||||||
return plugin.getSkillSnapshot(skill).getEndGoalXp();
|
return plugin.getSkillSnapshot(skill).getEndGoalXp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTimeTilGoal(Skill skill)
|
||||||
|
{
|
||||||
|
return plugin.getSkillSnapshot(skill).getTimeTillGoalShort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user