xpglobes: don't break at virt level 126

This commit is contained in:
Adam
2018-01-14 11:25:37 -05:00
parent f6f134467d
commit 958d2558f5
3 changed files with 14 additions and 14 deletions

View File

@@ -32,7 +32,7 @@ public class Experience
/** /**
* Maximum level under 200m xp * Maximum level under 200m xp
*/ */
private static final int MAX_VIRT_LEVEL = 126; public static final int MAX_VIRT_LEVEL = 126;
private static final int[] XP_FOR_LEVEL = new int[MAX_VIRT_LEVEL]; private static final int[] XP_FOR_LEVEL = new int[MAX_VIRT_LEVEL];

View File

@@ -229,7 +229,6 @@ public class XpGlobesOverlay extends Overlay
DecimalFormat decimalFormat = new DecimalFormat("###,###,###"); DecimalFormat decimalFormat = new DecimalFormat("###,###,###");
String skillCurrentXp = decimalFormat.format(mouseOverSkill.getCurrentXp()); String skillCurrentXp = decimalFormat.format(mouseOverSkill.getCurrentXp());
String skillXpToLvl = decimalFormat.format(mouseOverSkill.getGoalXp() - mouseOverSkill.getCurrentXp());
PanelComponent xpTooltip = new PanelComponent(); PanelComponent xpTooltip = new PanelComponent();
xpTooltip.setPosition(new java.awt.Point(x, y)); xpTooltip.setPosition(new java.awt.Point(x, y));
@@ -237,6 +236,9 @@ public class XpGlobesOverlay extends Overlay
List<PanelComponent.Line> lines = xpTooltip.getLines(); List<PanelComponent.Line> lines = xpTooltip.getLines();
lines.add(new PanelComponent.Line(skillName, Color.WHITE, skillLevel, Color.WHITE)); lines.add(new PanelComponent.Line(skillName, Color.WHITE, skillLevel, Color.WHITE));
lines.add(new PanelComponent.Line("Current xp:", Color.ORANGE, skillCurrentXp, Color.WHITE)); lines.add(new PanelComponent.Line("Current xp:", Color.ORANGE, skillCurrentXp, Color.WHITE));
if (mouseOverSkill.getGoalXp() != -1)
{
String skillXpToLvl = decimalFormat.format(mouseOverSkill.getGoalXp() - mouseOverSkill.getCurrentXp());
lines.add(new PanelComponent.Line("Xp to level: ", Color.ORANGE, skillXpToLvl, Color.WHITE)); lines.add(new PanelComponent.Line("Xp to level: ", Color.ORANGE, skillXpToLvl, Color.WHITE));
//Create progress bar for skill. //Create progress bar for skill.
@@ -246,6 +248,8 @@ public class XpGlobesOverlay extends Overlay
progressBar.setProgress(progress); progressBar.setProgress(progress);
xpTooltip.setProgressBar(progressBar); xpTooltip.setProgressBar(progressBar);
}
xpTooltip.render(graphics, parent); xpTooltip.render(graphics, parent);
} }
} }

View File

@@ -100,12 +100,8 @@ public class XpGlobesPlugin extends Plugin
return; return;
} }
int startingXp = 0; int startingXp = Experience.getXpForLevel(currentLevel);
if (currentLevel > 1) int goalXp = currentLevel + 1 <= Experience.MAX_VIRT_LEVEL ? Experience.getXpForLevel(currentLevel + 1) : -1;
{
startingXp = Experience.getXpForLevel(currentLevel);
}
int goalXp = Experience.getXpForLevel(currentLevel + 1);
if (cachedGlobe != null) if (cachedGlobe != null)
{ {