ui: queue repaint when progressbar is edited
This commit is contained in:
@@ -304,14 +304,11 @@ class XpInfoBox extends JPanel
|
|||||||
tooltipLabel == XpProgressBarLabel.PERCENTAGE ? "of goal" : "till goal lvl"));
|
tooltipLabel == XpProgressBarLabel.PERCENTAGE ? "of goal" : "till goal lvl"));
|
||||||
|
|
||||||
progressBar.setDimmed(skillPaused);
|
progressBar.setDimmed(skillPaused);
|
||||||
|
|
||||||
progressBar.repaint();
|
|
||||||
}
|
}
|
||||||
else if (!paused && skillPaused)
|
else if (!paused && skillPaused)
|
||||||
{
|
{
|
||||||
// React to the skill state now being paused
|
// React to the skill state now being paused
|
||||||
progressBar.setDimmed(true);
|
progressBar.setDimmed(true);
|
||||||
progressBar.repaint();
|
|
||||||
paused = true;
|
paused = true;
|
||||||
pauseSkill.setText("Unpause");
|
pauseSkill.setText("Unpause");
|
||||||
}
|
}
|
||||||
@@ -319,7 +316,6 @@ class XpInfoBox extends JPanel
|
|||||||
{
|
{
|
||||||
// React to the skill being unpaused (without update)
|
// React to the skill being unpaused (without update)
|
||||||
progressBar.setDimmed(false);
|
progressBar.setDimmed(false);
|
||||||
progressBar.repaint();
|
|
||||||
paused = false;
|
paused = false;
|
||||||
pauseSkill.setText("Pause");
|
pauseSkill.setText("Pause");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import java.util.List;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.SwingConstants;
|
import javax.swing.SwingConstants;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import lombok.Setter;
|
|
||||||
import net.runelite.client.ui.FontManager;
|
import net.runelite.client.ui.FontManager;
|
||||||
import net.runelite.client.ui.components.shadowlabel.JShadowedLabel;
|
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
|
public class ProgressBar extends DimmableJPanel
|
||||||
{
|
{
|
||||||
@Setter
|
|
||||||
private int maximumValue;
|
private int maximumValue;
|
||||||
|
|
||||||
@Setter
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
@Setter
|
|
||||||
private List<Integer> positions = Collections.emptyList();
|
private List<Integer> positions = Collections.emptyList();
|
||||||
|
|
||||||
private final JLabel leftLabel = new JShadowedLabel();
|
private final JLabel leftLabel = new JShadowedLabel();
|
||||||
@@ -157,4 +151,22 @@ public class ProgressBar extends DimmableJPanel
|
|||||||
|
|
||||||
return (value * 100) / maximumValue;
|
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<Integer> positions)
|
||||||
|
{
|
||||||
|
this.positions = positions;
|
||||||
|
repaint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user