1- package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.nlclickgui.Settings
1+ package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.nlclickgui.settings
22
33import net.ccbluex.liquidbounce.config.BoolValue
44import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.nlclickgui.Downward
@@ -18,46 +18,45 @@ class BoolSetting(s: BoolValue, moduleRender: NlModule) : Downward<BoolValue>(s,
1818 private val hoveringAnimation: Animation = DecelerateAnimation (225 , 1.0 , Direction .BACKWARDS )
1919
2020 override fun draw (mouseX : Int , mouseY : Int ) {
21- val mainx = NeverloseGui .getInstance().x
22- val mainy = NeverloseGui .getInstance().y
23-
21+ val mainx = NeverloseGui .Companion .getInstance().x
22+ val mainy = NeverloseGui .Companion .getInstance().y
2423
2524 val booly = (y + getScrollY()).toInt()
2625
27- Fonts .Nl_16 .drawString(
26+ Fonts .Nl . Nl_16 . Nl_16 .drawString(
2827 setting.name,
29- (mainx + 100 + x).toFloat() ,
28+ (mainx + 100 + x),
3029 (mainy + booly + 57 ).toFloat(),
31- if (NeverloseGui .getInstance().light) Color (95 , 95 , 95 ).rgb else - 1
30+ if (NeverloseGui .Companion . getInstance().light) Color (95 , 95 , 95 ).rgb else - 1
3231 )
3332
3433 val darkRectColor = Color (29 , 29 , 39 , 255 )
3534 val darkRectHover = RenderUtil .brighter(darkRectColor, .8f )
36- val accentCircle = RenderUtil .darker(NeverloseGui .neverlosecolor, .5f )
37-
35+ val accentCircle = RenderUtil .darker(NeverloseGui .Companion .neverlosecolor, .5f )
3836
3937 toggleAnimation.direction = if (setting.get()) Direction .FORWARDS else Direction .BACKWARDS
4038
41-
39+ // CORREÇÃO: Adicionado .toFloat() na posição X
4240 hoveringAnimation.direction = if (
4341 RenderUtil .isHovering(
44- NeverloseGui .getInstance().x + 265 - 32 + x,
45- (NeverloseGui .getInstance().y + (y + getScrollY()).toInt() + 57 ).toFloat(),
42+ ( NeverloseGui .Companion . getInstance().x + 265 - 32 + x).toFloat() ,
43+ (NeverloseGui .Companion . getInstance().y + (y + getScrollY()).toInt() + 57 ).toFloat(),
4644 16f ,
4745 4.5f ,
48- mouseX.toFloat().toInt() ,
49- mouseY.toFloat().toInt()
46+ mouseX,
47+ mouseY
5048 )
5149 ) Direction .FORWARDS else Direction .BACKWARDS
5250
53-
54- RoundedUtil .drawRound(
55- mainx + 265 - 32 + x,
51+ // Fundo do Toggle
52+ // CORREÇÃO: Adicionado .toFloat() na posição X
53+ RoundedUtil .Companion .drawRound(
54+ (mainx + 265 - 32 + x).toFloat(),
5655 (mainy + booly + 57 ).toFloat(),
5756 16f ,
5857 4.5f ,
5958 2f ,
60- if (NeverloseGui .getInstance().light) {
59+ if (NeverloseGui .Companion . getInstance().light) {
6160 RenderUtil .interpolateColorC(
6261 Color (230 , 230 , 230 ),
6362 Color (0 , 112 , 186 ),
@@ -72,6 +71,7 @@ class BoolSetting(s: BoolValue, moduleRender: NlModule) : Downward<BoolValue>(s,
7271 }
7372 )
7473
74+ // Efeito de Glow
7575 RenderUtil .fakeCircleGlow(
7676 (mainx + 265 + 3 - 32 + x + 11 * toggleAnimation.getOutput()).toFloat(),
7777 (mainy + booly + 59 ).toFloat(),
@@ -82,15 +82,16 @@ class BoolSetting(s: BoolValue, moduleRender: NlModule) : Downward<BoolValue>(s,
8282
8383 RenderUtil .resetColor()
8484
85- RoundedUtil .drawRound(
85+ // Bolinha do Toggle
86+ RoundedUtil .Companion .drawRound(
8687 (mainx + 265 - 32 + x + 11 * toggleAnimation.getOutput()).toFloat(),
8788 (mainy + booly + 56 ).toFloat(),
8889 6.5f ,
8990 6.5f ,
9091 3f ,
9192 if (setting.get()) {
92- NeverloseGui .neverlosecolor
93- } else if (NeverloseGui .getInstance().light) {
93+ NeverloseGui .Companion . neverlosecolor
94+ } else if (NeverloseGui .Companion . getInstance().light) {
9495 Color (255 , 255 , 255 )
9596 } else {
9697 Color (
@@ -104,21 +105,22 @@ class BoolSetting(s: BoolValue, moduleRender: NlModule) : Downward<BoolValue>(s,
104105
105106 override fun mouseClicked (mouseX : Int , mouseY : Int , mouseButton : Int ) {
106107 if (mouseButton == 0 ) {
108+ // CORREÇÃO: Adicionado .toFloat() na posição X
107109 if (
108110 RenderUtil .isHovering(
109- NeverloseGui .getInstance().x + 265 - 32 + x,
110- (NeverloseGui .getInstance().y + (y + getScrollY()).toInt() + 57 ).toFloat(),
111+ ( NeverloseGui .Companion . getInstance().x + 265 - 32 + x).toFloat() ,
112+ (NeverloseGui .Companion . getInstance().y + (y + getScrollY()).toInt() + 57 ).toFloat(),
111113 16f ,
112114 4.5f ,
113- mouseX.toFloat().toInt() ,
114- mouseY.toFloat().toInt()
115+ mouseX,
116+ mouseY
115117 )
116118 ) {
117- setting.set(! setting.get(), true )
119+ setting.set(! setting.get())
118120 }
119121 }
120122 }
121123
122124 override fun mouseReleased (mouseX : Int , mouseY : Int , state : Int ) {
123125 }
124- }
126+ }
0 commit comments