xpglobes: add configs for globe tooltips

Co-authored-by: Adam <Adam@sigterm.info>
This commit is contained in:
Gustavo Rodrigues
2019-07-29 17:00:52 -03:00
committed by Adam
parent d066ca97a3
commit 3701a57606
2 changed files with 74 additions and 32 deletions

View File

@@ -44,11 +44,44 @@ public interface XpGlobesConfig extends Config
return true;
}
@ConfigItem(
keyName = "showXpLeft",
name = "Show XP Left",
description = "Shows XP Left inside the globe tooltip box",
position = 1
)
default boolean showXpLeft()
{
return true;
}
@ConfigItem(
keyName = "showActionsLeft",
name = "Show actions left",
description = "Shows the number of actions left inside the globe tooltip box",
position = 2
)
default boolean showActionsLeft()
{
return true;
}
@ConfigItem(
keyName = "showXpHour",
name = "Show XP/hr",
description = "Shows XP per hour inside the globe tooltip box",
position = 3
)
default boolean showXpHour()
{
return true;
}
@ConfigItem(
keyName = "hideMaxed",
name = "Hide maxed skills",
description = "Stop globes from showing up for level 99 skills ",
position = 1
description = "Stop globes from showing up for level 99 skills",
position = 4
)
default boolean hideMaxed()
{
@@ -59,7 +92,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 = 2
position = 5
)
default boolean enableCustomArcColor()
{
@@ -71,7 +104,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 = 3
position = 6
)
default Color progressArcColor()
{
@@ -83,7 +116,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 = 4
position = 7
)
default Color progressOrbOutLineColor()
{
@@ -95,7 +128,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 = 5
position = 8
)
default Color progressOrbBackgroundColor()
{
@@ -106,7 +139,7 @@ public interface XpGlobesConfig extends Config
keyName = "Progress arc width",
name = "Progress arc width",
description = "Change the stroke width of the progress arc",
position = 6
position = 9
)
default int progressArcStrokeWidth()
{
@@ -117,7 +150,7 @@ public interface XpGlobesConfig extends Config
keyName = "Orb size",
name = "Size of orbs",
description = "Change the size of the xp orbs",
position = 7
position = 10
)
default int xpOrbSize()
{
@@ -128,7 +161,7 @@ public interface XpGlobesConfig extends Config
keyName = "Orb duration",
name = "Duration of orbs",
description = "Change the duration the xp orbs are visible",
position = 8
position = 11
)
default int xpOrbDuration()
{

View File

@@ -263,34 +263,43 @@ public class XpGlobesOverlay extends Overlay
{
XpActionType xpActionType = xpTrackerService.getActionType(mouseOverSkill.getSkill());
int actionsLeft = xpTrackerService.getActionsLeft(mouseOverSkill.getSkill());
if (actionsLeft != Integer.MAX_VALUE)
if (config.showActionsLeft())
{
String actionsLeftString = decimalFormat.format(actionsLeft);
xpTooltip.getChildren().add(LineComponent.builder()
.left(xpActionType.getLabel() + " left:")
.leftColor(Color.ORANGE)
.right(actionsLeftString)
.build());
int actionsLeft = xpTrackerService.getActionsLeft(mouseOverSkill.getSkill());
if (actionsLeft != Integer.MAX_VALUE)
{
String actionsLeftString = decimalFormat.format(actionsLeft);
xpTooltip.getChildren().add(LineComponent.builder()
.left(xpActionType.getLabel() + " left:")
.leftColor(Color.ORANGE)
.right(actionsLeftString)
.build());
}
}
int xpLeft = goalXp - mouseOverSkill.getCurrentXp();
String skillXpToLvl = decimalFormat.format(xpLeft);
xpTooltip.getChildren().add(LineComponent.builder()
.left("XP left:")
.leftColor(Color.ORANGE)
.right(skillXpToLvl)
.build());
int xpHr = xpTrackerService.getXpHr(mouseOverSkill.getSkill());
if (xpHr != 0)
if (config.showXpLeft())
{
String xpHrString = decimalFormat.format(xpHr);
int xpLeft = goalXp - mouseOverSkill.getCurrentXp();
String skillXpToLvl = decimalFormat.format(xpLeft);
xpTooltip.getChildren().add(LineComponent.builder()
.left("XP per hour:")
.leftColor(Color.ORANGE)
.right(xpHrString)
.build());
.left("XP left:")
.leftColor(Color.ORANGE)
.right(skillXpToLvl)
.build());
}
if (config.showXpHour())
{
int xpHr = xpTrackerService.getXpHr(mouseOverSkill.getSkill());
if (xpHr != 0)
{
String xpHrString = decimalFormat.format(xpHr);
xpTooltip.getChildren().add(LineComponent.builder()
.left("XP per hour:")
.leftColor(Color.ORANGE)
.right(xpHrString)
.build());
}
}
}