mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 07:21:32 +01:00
Update RegularSlider.java
This commit is contained in:
parent
d1f740d0d5
commit
81f4ff0fd5
@ -13,9 +13,9 @@ public class RegularSlider {
|
||||
public static void render(float x, float y, int width, String name, double max, double value) {
|
||||
Client.getInstance().getSilentFontRenderer().drawString(name, x, y, 12, SilentFontRenderer.FontType.TITLE);
|
||||
|
||||
RenderUtil.drawRoundedRect(x, y + 15, 144, 9, 3, Color.black.getRGB());
|
||||
RenderUtil.drawRoundedRect(x, y + 15, width, 9, 3, Color.black.getRGB());
|
||||
if(value != 0) {
|
||||
RenderUtil.drawRoundedRect(x, y + 15, 144F * (float) (value / max), 9, 3, -1);
|
||||
RenderUtil.drawRoundedRect(x, y + 15, width * (float) (value / max), 9, 3, -1);
|
||||
}
|
||||
|
||||
float textLeft = x + width - Client.getInstance().getSilentFontRenderer().getStringWidth(new DecimalFormat("0.00").format(value), 12, SilentFontRenderer.FontType.TITLE);
|
||||
@ -23,6 +23,6 @@ public class RegularSlider {
|
||||
}
|
||||
|
||||
public static boolean isDrag(int mouseX, int mouseY, float x, float y, int width) {
|
||||
return MouseUtils.isInside(mouseX, mouseY, x, y + 15, 144, 9) && Mouse.isButtonDown(0);
|
||||
return MouseUtils.isInside(mouseX, mouseY, x, y + 15, width, 9) && Mouse.isButtonDown(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user