Remove 'Actions left' and 'Xp per hour' from Xp Globes when Xp Tracker is disabled

This commit is contained in:
Marshall Briggs
2018-06-08 12:04:37 -07:00
committed by Adam
parent 5663baea30
commit 5f5b75da06
2 changed files with 19 additions and 12 deletions

View File

@@ -248,12 +248,15 @@ public class XpGlobesOverlay extends Overlay
if (mouseOverSkill.getGoalXp() != -1) if (mouseOverSkill.getGoalXp() != -1)
{ {
int actionsLeft = xpTrackerService.getActionsLeft(mouseOverSkill.getSkill()); int actionsLeft = xpTrackerService.getActionsLeft(mouseOverSkill.getSkill());
String actionsLeftString = decimalFormat.format(actionsLeft); if (actionsLeft != Integer.MAX_VALUE)
xpTooltip.getChildren().add(LineComponent.builder() {
.left("Actions left:") String actionsLeftString = decimalFormat.format(actionsLeft);
.leftColor(Color.ORANGE) xpTooltip.getChildren().add(LineComponent.builder()
.right(actionsLeftString) .left("Actions left:")
.build()); .leftColor(Color.ORANGE)
.right(actionsLeftString)
.build());
}
int xpLeft = mouseOverSkill.getGoalXp() - mouseOverSkill.getCurrentXp(); int xpLeft = mouseOverSkill.getGoalXp() - mouseOverSkill.getCurrentXp();
String skillXpToLvl = decimalFormat.format(xpLeft); String skillXpToLvl = decimalFormat.format(xpLeft);
@@ -264,12 +267,15 @@ public class XpGlobesOverlay extends Overlay
.build()); .build());
int xpHr = xpTrackerService.getXpHr(mouseOverSkill.getSkill()); int xpHr = xpTrackerService.getXpHr(mouseOverSkill.getSkill());
String xpHrString = decimalFormat.format(xpHr); if (xpHr != 0)
xpTooltip.getChildren().add(LineComponent.builder() {
.left("Xp per hour:") String xpHrString = decimalFormat.format(xpHr);
.leftColor(Color.ORANGE) xpTooltip.getChildren().add(LineComponent.builder()
.right(xpHrString) .left("Xp per hour:")
.build()); .leftColor(Color.ORANGE)
.right(xpHrString)
.build());
}
//Create progress bar for skill. //Create progress bar for skill.
ProgressBarComponent progressBar = new ProgressBarComponent(); ProgressBarComponent progressBar = new ProgressBarComponent();

View File

@@ -129,6 +129,7 @@ public class XpTrackerPlugin extends Plugin
@Override @Override
protected void shutDown() throws Exception protected void shutDown() throws Exception
{ {
xpState.reset();
pluginToolbar.removeNavigation(navButton); pluginToolbar.removeNavigation(navButton);
} }