diff --git a/src/main/java/dev/resent/visual/ui/ClickGUI.java b/src/main/java/dev/resent/visual/ui/ClickGUI.java index 1ed3e4f6..b4c9fc6f 100644 --- a/src/main/java/dev/resent/visual/ui/ClickGUI.java +++ b/src/main/java/dev/resent/visual/ui/ClickGUI.java @@ -233,25 +233,28 @@ public class ClickGUI extends GuiScreen { fr.drawStringWithShadow(s.name, this.x + 24, height +43 + var, -1); var += 3; } - - NumberSetting ss = ((NumberSetting)s); if(s instanceof NumberSetting) { + NumberSetting ss = ((NumberSetting)s); fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting)s).getValue(), this.x+24, height+41+var, -1); drawRect(width-150, height+43+var, width-45, height+47+var, -1); RenderUtils.drawRoundedRect(width-150+sliderOffset, height+41+var, width-141+sliderOffset, height+50+var, 4, Color.RED.getRGB()); if(dragging) { - sliderOffset = mouseX-(width-150); + sliderOffset = mouseX-(width-150); ss.setValue(sliderOffset*(ss.max/100)); } + if(!dragging) { + sliderOffset = (int) ((ss.getValue() * 100)/ss.max); + } + if(sliderOffset < 0) { dragging = false; sliderOffset = 0; } - if(width-141+sliderOffset > width-45) { + if(width-141+sliderOffset > width-50) { dragging = false; sliderOffset = 100; }