Merge pull request #413 from Noremac201/progressBarFix
XpGlobeTooltip now sets width of itself to prevent overlap; fixes #405
This commit is contained in:
@@ -70,7 +70,7 @@ public class XpGlobesOverlay extends Overlay
|
|||||||
|
|
||||||
private final BufferedImage[] imgCache = new BufferedImage[Skill.values().length - 1];
|
private final BufferedImage[] imgCache = new BufferedImage[Skill.values().length - 1];
|
||||||
|
|
||||||
private static final int TOOLTIP_RECT_SIZE_X = 140;
|
private static final int TOOLTIP_RECT_SIZE_X = 150;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public XpGlobesOverlay(@Nullable Client client, XpGlobesPlugin plugin, XpGlobesConfig config)
|
public XpGlobesOverlay(@Nullable Client client, XpGlobesPlugin plugin, XpGlobesConfig config)
|
||||||
@@ -232,6 +232,7 @@ public class XpGlobesOverlay extends Overlay
|
|||||||
|
|
||||||
PanelComponent xpTooltip = new PanelComponent();
|
PanelComponent xpTooltip = new PanelComponent();
|
||||||
xpTooltip.setPosition(new java.awt.Point(x, y));
|
xpTooltip.setPosition(new java.awt.Point(x, y));
|
||||||
|
xpTooltip.setWidth(TOOLTIP_RECT_SIZE_X);
|
||||||
|
|
||||||
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));
|
||||||
@@ -239,7 +240,7 @@ public class XpGlobesOverlay extends Overlay
|
|||||||
if (mouseOverSkill.getGoalXp() != -1)
|
if (mouseOverSkill.getGoalXp() != -1)
|
||||||
{
|
{
|
||||||
String skillXpToLvl = decimalFormat.format(mouseOverSkill.getGoalXp() - mouseOverSkill.getCurrentXp());
|
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.
|
||||||
ProgressBarComponent progressBar = new ProgressBarComponent();
|
ProgressBarComponent progressBar = new ProgressBarComponent();
|
||||||
|
|||||||
Reference in New Issue
Block a user