diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobe.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobe.java index 95ad93f3ef..8ff8ec82bd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobe.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobe.java @@ -38,13 +38,12 @@ public class XpGlobe private Instant time; private double skillProgressRadius; - public XpGlobe(Skill skill, int currentXp, int currentLevel, int goalXp, Instant time) + public XpGlobe(Skill skill, int currentXp, int currentLevel, int goalXp) { this.skill = skill; this.currentXp = currentXp; this.currentLevel = currentLevel; this.goalXp = goalXp; - this.time = time; } public Skill getSkill() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java index e62c655abd..2309cf1c44 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java @@ -105,13 +105,14 @@ public class XpGlobes extends Plugin cachedGlobe.setGoalXp(goalXp); cachedGlobe.setTime(Instant.now()); cachedGlobe.setSkillProgressRadius(startingXp, currentXp, goalXp); + + this.addXpGlobe(globeCache[skillIdx], MAXIMUM_SHOWN_GLOBES); } else { - globeCache[skillIdx] = new XpGlobe(skill, currentXp, currentLevel, goalXp, Instant.now()); + //dont draw non cached globes, this is triggered on login to setup all of the initial values + globeCache[skillIdx] = new XpGlobe(skill, currentXp, currentLevel, goalXp); } - - this.addXpGlobe(globeCache[skillIdx], MAXIMUM_SHOWN_GLOBES); } public List getXpGlobes() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java index 05d62fa1bc..02035f35b0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobesOverlay.java @@ -84,20 +84,20 @@ public class XpGlobesOverlay extends Overlay return null; } + //check the width of the client if we can draw properly + int clientWidth = client.isResized() ? client.getClientWidth() : client.getViewportHeight(); + if (clientWidth <= 0) + { + return null; + } + int queueSize = plugin.getXpGlobesSize(); if (queueSize > 0) { List xpChangedQueue = plugin.getXpGlobes(); int markersLength = (queueSize * (DEFAULT_CIRCLE_WIDTH)) + ((MINIMUM_STEP_WIDTH - DEFAULT_CIRCLE_WIDTH) * (queueSize - 1)); - int startDrawX; - if (client.isResized()) - { - startDrawX = (client.getClientWidth() - markersLength) / 2; - } - else - { - startDrawX = (client.getViewportHeight() - markersLength) / 2; - } + int startDrawX = (clientWidth - markersLength) / 2; + for (XpGlobe xpGlobe : xpChangedQueue) { renderProgressCircle(graphics, xpGlobe, startDrawX, DEFAULT_START_Y);