From 2a118bdb4d74fed561e571384d5e55297e2b2c71 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 16 May 2021 20:10:57 -0400 Subject: [PATCH] ui: queue repaint when progressbar is edited --- .../client/plugins/xptracker/XpInfoBox.java | 4 ---- .../client/ui/components/ProgressBar.java | 24 ++++++++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java index e188a1df57..0a0716c00e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java @@ -304,14 +304,11 @@ class XpInfoBox extends JPanel tooltipLabel == XpProgressBarLabel.PERCENTAGE ? "of goal" : "till goal lvl")); progressBar.setDimmed(skillPaused); - - progressBar.repaint(); } else if (!paused && skillPaused) { // React to the skill state now being paused progressBar.setDimmed(true); - progressBar.repaint(); paused = true; pauseSkill.setText("Unpause"); } @@ -319,7 +316,6 @@ class XpInfoBox extends JPanel { // React to the skill being unpaused (without update) progressBar.setDimmed(false); - progressBar.repaint(); paused = false; pauseSkill.setText("Pause"); } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/ProgressBar.java b/runelite-client/src/main/java/net/runelite/client/ui/components/ProgressBar.java index 54b2eec733..3040440b4d 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/ProgressBar.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/ProgressBar.java @@ -33,7 +33,6 @@ import java.util.List; import javax.swing.JLabel; import javax.swing.SwingConstants; import javax.swing.border.EmptyBorder; -import lombok.Setter; import net.runelite.client.ui.FontManager; import net.runelite.client.ui.components.shadowlabel.JShadowedLabel; @@ -42,13 +41,8 @@ import net.runelite.client.ui.components.shadowlabel.JShadowedLabel; */ public class ProgressBar extends DimmableJPanel { - @Setter private int maximumValue; - - @Setter private int value; - - @Setter private List positions = Collections.emptyList(); private final JLabel leftLabel = new JShadowedLabel(); @@ -157,4 +151,22 @@ public class ProgressBar extends DimmableJPanel return (value * 100) / maximumValue; } + + public void setMaximumValue(int maximumValue) + { + this.maximumValue = maximumValue; + repaint(); + } + + public void setValue(int value) + { + this.value = value; + repaint(); + } + + public void setPositions(List positions) + { + this.positions = positions; + repaint(); + } }