@@ -18,12 +18,12 @@ import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.Side
1818import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.SideGui.managers.SideGuiColorManager.colorHexInput
1919import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.SideGui.managers.SideGuiColorManager.getColorHexFieldArea
2020import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.SideGui.managers.SideGuiConfigsManager
21- import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown. utils.animations.Animation
22- import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown. utils.animations.Direction
23- import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown. utils.animations.impl.DecelerateAnimation
24- import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown. utils.normal.TimerUtil
21+ import net.ccbluex.liquidbounce.utils.animations.Animation
22+ import net.ccbluex.liquidbounce.utils.animations.Direction
23+ import net.ccbluex.liquidbounce.utils.animations.impl.DecelerateAnimation
24+ import net.ccbluex.liquidbounce.utils.timing.MSTimer
2525import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.objects.Drag
26- import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown. utils.render.DrRenderUtils
26+ import net.ccbluex.liquidbounce.utils.render.RenderUtils
2727import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer.Companion.assumeNonVolatile
2828import net.ccbluex.liquidbounce.ui.font.Fonts
2929import net.ccbluex.liquidbounce.utils.client.ClientThemesUtils
@@ -60,7 +60,7 @@ class SideGui : GuiPanel() {
6060 private var animScroll = 0f
6161
6262 private val smooth = floatArrayOf(0f , 0f , 0f , 0f )
63- private var timerUtil: TimerUtil ? = null
63+ private var timerUtil: MSTimer ? = null
6464
6565 private var draggingSlider = false
6666 private var clickingHeader = false
@@ -72,7 +72,7 @@ class SideGui : GuiPanel() {
7272 rectHeight = 350f
7373
7474 val sr = ScaledResolution (MinecraftInstance .mc)
75- timerUtil = TimerUtil ()
75+ timerUtil = MSTimer ()
7676 drag = Drag (
7777 x = (sr.scaledWidth - 30 ).toFloat(),
7878 y = sr.scaledHeight / 2f - rectHeight / 2f
@@ -156,7 +156,7 @@ class SideGui : GuiPanel() {
156156 drawCategoryTabs(mouseX, mouseY, alpha)
157157
158158 // Separator line
159- DrRenderUtils .drawRect2(
159+ RenderUtils .drawRect2(
160160 drag!! .x + 20.0 ,
161161 drag!! .y + 50.0 ,
162162 (rectWidth - 40 ).toDouble(),
@@ -177,7 +177,7 @@ class SideGui : GuiPanel() {
177177 }
178178
179179 override fun mouseClicked (mouseX : Int , mouseY : Int , button : Int ) {
180- val isHoveringMainRect = DrRenderUtils .isHovering(drag!! .x, drag!! .y, rectWidth, rectHeight, mouseX, mouseY)
180+ val isHoveringMainRect = RenderUtils .isHovering(drag!! .x, drag!! .y, rectWidth, rectHeight, mouseX, mouseY)
181181 if (isHoveringMainRect && button == 0 && ! focused) {
182182 focused = true
183183 return
@@ -187,8 +187,8 @@ class SideGui : GuiPanel() {
187187 clickingHeader = isHoveringHeader(mouseX, mouseY)
188188
189189 if (! draggingSlider && ! clickingHeader) {
190- val canDrag = DrRenderUtils .isHovering(drag!! .x, drag!! .y, rectWidth, 50f , mouseX, mouseY) ||
191- DrRenderUtils .isHovering(drag!! .x, drag!! .y, 20f , rectHeight, mouseX, mouseY)
190+ val canDrag = RenderUtils .isHovering(drag!! .x, drag!! .y, rectWidth, 50f , mouseX, mouseY) ||
191+ RenderUtils .isHovering(drag!! .x, drag!! .y, 20f , rectHeight, mouseX, mouseY)
192192 drag!! .onClick(mouseX, mouseY, button, canDrag)
193193 }
194194
@@ -200,14 +200,14 @@ class SideGui : GuiPanel() {
200200 if (currentCategory == " Color" ) {
201201 checkColorCategoryInteractions(mouseX, mouseY, drag!! )
202202 val (hexX, hexY, hexW, hexH) = getColorHexFieldArea(drag!! )
203- if (DrRenderUtils .isHovering(hexX, hexY, hexW, hexH, mouseX, mouseY)) {
203+ if (RenderUtils .isHovering(hexX, hexY, hexW, hexH, mouseX, mouseY)) {
204204 colorHexFocused = true
205205 }
206206 }
207207 if (currentCategory == " Background" ) {
208208 checkBackgroundInteractions(mouseX, mouseY)
209209 val (hexX, hexY, hexW, hexH) = getBgHexFieldArea(drag!! )
210- if (DrRenderUtils .isHovering(hexX, hexY, hexW, hexH, mouseX, mouseY)) {
210+ if (RenderUtils .isHovering(hexX, hexY, hexW, hexH, mouseX, mouseY)) {
211211 bgHexFocused = true
212212 }
213213 }
@@ -216,7 +216,7 @@ class SideGui : GuiPanel() {
216216 val fadeSpeedSliderY = drag!! .y + 20
217217 val fadeSpeedSliderWidth = 80f
218218 val fadeSpeedSliderHeight = 10f
219- if (DrRenderUtils .isHovering(fadeSpeedSliderX, fadeSpeedSliderY, fadeSpeedSliderWidth, fadeSpeedSliderHeight, mouseX, mouseY)
219+ if (RenderUtils .isHovering(fadeSpeedSliderX, fadeSpeedSliderY, fadeSpeedSliderWidth, fadeSpeedSliderHeight, mouseX, mouseY)
220220 && button == 0 ) {
221221 draggingSlider = true
222222 }
@@ -235,7 +235,7 @@ class SideGui : GuiPanel() {
235235 }
236236
237237 private fun drawUiCategory (alpha : Int ) {
238- Fonts .InterBold_26 .drawString(" Not Finished - Coming Soon" , drag!! .x + rectWidth / 2 , drag!! .y + rectHeight / 2 , DrRenderUtils .applyOpacity(- 1 , alpha / 255f ))
238+ Fonts .InterBold_26 .drawString(" Not Finished - Coming Soon" , drag!! .x + rectWidth / 2 , drag!! .y + rectHeight / 2 , RenderUtils .applyOpacity(- 1 , alpha / 255f ))
239239 }
240240
241241 private fun handleMouseWheel () {
@@ -248,7 +248,7 @@ class SideGui : GuiPanel() {
248248
249249 private fun updateAnimations (mouseX : Int , mouseY : Int ) {
250250 clickAnimation?.direction = if (focused) Direction .FORWARDS else Direction .BACKWARDS
251- val hovering = DrRenderUtils .isHovering(drag!! .x, drag!! .y, rectWidth, rectHeight, mouseX, mouseY)
251+ val hovering = RenderUtils .isHovering(drag!! .x, drag!! .y, rectWidth, rectHeight, mouseX, mouseY)
252252 hoverAnimation?.direction = if (hovering) Direction .FORWARDS else Direction .BACKWARDS
253253 val sr = ScaledResolution (MinecraftInstance .mc)
254254 val stillAnimating = ! timerUtil!! .hasTimeElapsed(6000 ) || (! hoverAnimation!! .isDone || (hoverAnimation!! .isDone && hoverAnimation!! .direction == Direction .FORWARDS ))
@@ -284,26 +284,26 @@ class SideGui : GuiPanel() {
284284 }
285285
286286 private fun drawCategoryTabs (mouseX : Int , mouseY : Int , alpha : Int ) {
287- val textColor = DrRenderUtils .applyOpacity(- 1 , alpha / 255f )
287+ val textColor = RenderUtils .applyOpacity(- 1 , alpha / 255f )
288288 val totalWidth = 4 * 60f + 3 * 10f
289289 val startX = drag!! .x + rectWidth / 2f - totalWidth / 2f
290290 val yVal = drag!! .y + 15
291291
292292 var xOffset = 0f
293293 categories.forEachIndexed { index, cat ->
294294 val xVal = startX + xOffset
295- val hovered = DrRenderUtils .isHovering(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), mouseX, mouseY)
295+ val hovered = RenderUtils .isHovering(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), mouseX, mouseY)
296296 val catHoverAnim = categoryAnimation[cat]?.get(0 )
297297 val catEnableAnim = categoryAnimation[cat]?.get(1 )
298298 catHoverAnim?.direction = if (hovered) Direction .FORWARDS else Direction .BACKWARDS
299299 catEnableAnim?.direction = if (currentCategory == cat) Direction .FORWARDS else Direction .BACKWARDS
300300 val baseColor = Color (45 , 45 , 45 , alpha)
301- val colorToInterpolate = DrRenderUtils .applyOpacity(generateColor(index).rgb, alpha / 255f )
301+ val colorToInterpolate = RenderUtils .applyOpacity(generateColor(index).rgb, alpha / 255f )
302302 val colorToInterpolateAsColor = Color (colorToInterpolate, true )
303303 val hoverOut = catHoverAnim?.output?.toFloat() ? : 0f
304304 val enableOut = catEnableAnim?.output?.toFloat() ? : 0f
305- val hoverColor: Color = DrRenderUtils .interpolateColorC(baseColor, DrRenderUtils .brighter(baseColor, 0.8f ), hoverOut)
306- val finalColor: Color = DrRenderUtils .interpolateColorC(hoverColor, colorToInterpolateAsColor, enableOut)
305+ val hoverColor: Color = RenderUtils .interpolateColorC(baseColor, RenderUtils .brighter(baseColor, 0.8f ), hoverOut)
306+ val finalColor: Color = RenderUtils .interpolateColorC(hoverColor, colorToInterpolateAsColor, enableOut)
307307 drawCustomShapeWithRadius(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), 6f , finalColor)
308308 Fonts .InterBold_26 .drawCenteredString(cat, xVal, yVal, textColor)
309309 xOffset + = 60f + 10f
@@ -324,7 +324,7 @@ class SideGui : GuiPanel() {
324324 var xOffset = 0f
325325 categories.forEach { cat ->
326326 val xVal = startX + xOffset
327- val hovered = DrRenderUtils .isHovering(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), mouseX, mouseY)
327+ val hovered = RenderUtils .isHovering(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), mouseX, mouseY)
328328 if (hovered) {
329329 currentCategory = cat
330330 return
@@ -343,7 +343,7 @@ class SideGui : GuiPanel() {
343343 var xOffset = 0f
344344 categories.forEach { _ ->
345345 val xVal = startX + xOffset
346- val hovered = DrRenderUtils .isHovering(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), mouseX, mouseY)
346+ val hovered = RenderUtils .isHovering(xVal - 30 , yVal - 5 , 60f , (Fonts .InterBold_26 .height + 10 ).toFloat(), mouseX, mouseY)
347347 if (hovered) return true
348348 xOffset + = 60f + 10f
349349 }
@@ -354,8 +354,8 @@ class SideGui : GuiPanel() {
354354 * Overlays, gradients, bloom effect.
355355 */
356356 private fun drawOverlays (sr : ScaledResolution , alpha : Int , mouseX : Int , mouseY : Int ) {
357- DrRenderUtils .setAlphaLimit(0f )
358- DrRenderUtils .drawGradientRect2(
357+ RenderUtils .setAlphaLimit(0f )
358+ RenderUtils .drawGradientRect2(
359359 drag!! .x + 20.0 ,
360360 drag!! .y + 51.0 ,
361361 (rectWidth - 40 ).toDouble(),
@@ -365,15 +365,15 @@ class SideGui : GuiPanel() {
365365 )
366366 val colorIndex = 0
367367 val moveAnimOut = moveOverGradientAnimation?.output?.toFloat() ? : 0f
368- DrRenderUtils .drawGradientRectSideways2(
368+ RenderUtils .drawGradientRectSideways2(
369369 (sr.scaledWidth - 40 ).toDouble(),
370370 0.0 ,
371371 40.0 ,
372372 sr.scaledHeight.toDouble(),
373- DrRenderUtils .applyOpacity(generateColor(colorIndex).rgb, 0f ),
374- DrRenderUtils .applyOpacity(generateColor(colorIndex).rgb, 0.4f * moveAnimOut)
373+ RenderUtils .applyOpacity(generateColor(colorIndex).rgb, 0f ),
374+ RenderUtils .applyOpacity(generateColor(colorIndex).rgb, 0.4f * moveAnimOut)
375375 )
376- DrRenderUtils .setAlphaLimit(1f )
376+ RenderUtils .setAlphaLimit(1f )
377377 drawBloom(mouseX - 5 , mouseY - 5 , 10 , 10 , 16 , Color (guiColor))
378378 }
379379}
0 commit comments