From 81f4ff0fd592b9d38f5ab76d0ccc1ce2f59e161b Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Tue, 15 Aug 2023 01:55:46 +0600 Subject: [PATCH 1/2] Update RegularSlider.java --- .../net/silentclient/client/gui/modmenu/RegularSlider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/silentclient/client/gui/modmenu/RegularSlider.java b/src/main/java/net/silentclient/client/gui/modmenu/RegularSlider.java index 783a12a..9bddea2 100644 --- a/src/main/java/net/silentclient/client/gui/modmenu/RegularSlider.java +++ b/src/main/java/net/silentclient/client/gui/modmenu/RegularSlider.java @@ -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); } } From f39e97c6cbf9a5b74b518fda6c1fc2a422916c69 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Tue, 15 Aug 2023 02:03:09 +0600 Subject: [PATCH 2/2] Slider Fix --- .../net/silentclient/client/gui/lite/clickgui/ModSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java index 941cb0b..92c633f 100644 --- a/src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java @@ -176,7 +176,7 @@ public class ModSettings extends SilentScreen { if (Slider.isDrag(mouseX, mouseY, x, settingY - 1, width) && (System.currentTimeMillis() - initTime) > 500) { double diff = setting.getMax() - setting.getMin(); - double mouse = MathHelper.clamp_double((mouseX - Slider.getLeft(x, width)) / 100D, 0, 1); + double mouse = MathHelper.clamp_double((mouseX - Slider.getLeft(x, width)) / 90D, 0, 1); double newVal = setting.getMin() + mouse * diff; if(newVal != setting.getValDouble()) { setting.setValDouble(newVal);