diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/NameTags.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/NameTags.kt index 494368092fe..76e3ae2bd14 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/NameTags.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/NameTags.kt @@ -20,8 +20,8 @@ import net.ccbluex.liquidbounce.utils.render.ColorUtils import net.ccbluex.liquidbounce.utils.render.RenderUtils.disableGlCap import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawTexturedModalRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.enableGlCap -import net.ccbluex.liquidbounce.utils.render.RenderUtils.quickDrawBorderedRectNew -import net.ccbluex.liquidbounce.utils.render.RenderUtils.quickDrawRectNew2 +import net.ccbluex.liquidbounce.utils.render.RenderUtils.quickDrawBorderedRect +import net.ccbluex.liquidbounce.utils.render.RenderUtils.quickDrawRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.resetCaps import net.ccbluex.liquidbounce.value.* import net.minecraft.client.renderer.GlStateManager.* @@ -213,7 +213,7 @@ object NameTags : Module("NameTags", Category.RENDER, hideModule = false) { val borderColor = Color(borderColorRed, borderColorGreen, borderColorBlue, borderColorAlpha) - if (border) quickDrawBorderedRectNew( + if (border) quickDrawBorderedRect( -width - 2F, -2F, width + 4F, @@ -222,19 +222,19 @@ object NameTags : Module("NameTags", Category.RENDER, hideModule = false) { borderColor.rgb, bgColor.rgb ) - else quickDrawRectNew2( + else quickDrawRect( -width - 2F, -2F, width + 4F, fontRenderer.FONT_HEIGHT + 2F + if (healthBar) 2F else 0F, bgColor.rgb ) if (healthBar) { - quickDrawRectNew2( + quickDrawRect( -width - 2F, fontRenderer.FONT_HEIGHT + 3F, -width - 2F + dist, fontRenderer.FONT_HEIGHT + 4F, Color(50, 50, 50).rgb ) - quickDrawRectNew2( + quickDrawRect( -width - 2F, fontRenderer.FONT_HEIGHT + 3F, -width - 2F + (dist * (getHealth(entity, healthFromScoreboard) / entity.maxHealth).coerceIn(0F, 1F)), diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/ChestStealer.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/ChestStealer.kt index 161869f28fe..46b95ae12d9 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/ChestStealer.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/ChestStealer.kt @@ -24,7 +24,7 @@ import net.ccbluex.liquidbounce.utils.inventory.InventoryManager.canClickInvento import net.ccbluex.liquidbounce.utils.inventory.InventoryUtils.countSpaceInInventory import net.ccbluex.liquidbounce.utils.inventory.InventoryUtils.hasSpaceInInventory import net.ccbluex.liquidbounce.utils.inventory.InventoryUtils.serverSlot -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.utils.timing.TimeUtils.randomDelay import net.ccbluex.liquidbounce.value.BoolValue import net.ccbluex.liquidbounce.value.IntegerValue @@ -337,9 +337,9 @@ object ChestStealer : Module("ChestStealer", Category.WORLD, hideModule = false) easingProgress += (progress - easingProgress) / 6f * event.partialTicks - drawRectNew(minX - 2, minY - 2, maxX + 2, maxY + 2, Color(200, 200, 200).rgb) - drawRectNew(minX, minY, maxX, maxY, Color(50, 50, 50).rgb) - drawRectNew(minX, minY, minX + (maxX - minX) * easingProgress, maxY, Color.HSBtoRGB(easingProgress / 5, 1f, 1f) or 0xFF0000) + drawRect(minX - 2, minY - 2, maxX + 2, maxY + 2, Color(200, 200, 200).rgb) + drawRect(minX, minY, maxX, maxY, Color(50, 50, 50).rgb) + drawRect(minX, minY, minX + (maxX - minX) * easingProgress, maxY, Color.HSBtoRGB(easingProgress / 5, 1f, 1f) or 0xFF0000) } @EventTarget diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiContributors.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiContributors.kt index 367c186bd83..ce44832e550 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiContributors.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiContributors.kt @@ -16,7 +16,7 @@ import net.ccbluex.liquidbounce.utils.misc.HttpUtils.get import net.ccbluex.liquidbounce.utils.misc.HttpUtils.requestStream import net.ccbluex.liquidbounce.utils.render.CustomTexture import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawLoadingCircle -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen import net.minecraft.client.gui.GuiSlot @@ -54,7 +54,7 @@ class GuiContributors(private val prevGui: GuiScreen) : GuiScreen() { list.drawScreen(mouseX, mouseY, partialTicks) - drawRectNew(width / 4f, 40f, width.toFloat(), height - 40f, Integer.MIN_VALUE) + drawRect(width / 4f, 40f, width.toFloat(), height - 40f, Integer.MIN_VALUE) if (credits.isNotEmpty()) { val credit = credits[list.selectedSlot] diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiServerStatus.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiServerStatus.kt index 550e6d871cd..310dacdd5ec 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiServerStatus.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiServerStatus.kt @@ -8,7 +8,7 @@ package net.ccbluex.liquidbounce.ui.client import net.ccbluex.liquidbounce.lang.translationMenu import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.misc.HttpUtils.responseCode -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen import org.lwjgl.input.Keyboard @@ -38,7 +38,7 @@ class GuiServerStatus(private val prevGui: GuiScreen) : GuiScreen() { drawBackground(0) var i = height / 4 + 40 - drawRectNew( + drawRect( width / 2f - 115, i - 5f, width / 2f + 115, diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiDonatorCape.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiDonatorCape.kt index 244bb152c8c..3735eb9adcd 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiDonatorCape.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiDonatorCape.kt @@ -11,7 +11,7 @@ import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager import net.ccbluex.liquidbounce.ui.elements.GuiPasswordField import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.misc.MiscUtils -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen import net.minecraft.client.gui.GuiTextField @@ -71,7 +71,7 @@ class GuiDonatorCape(private val prevGui: GuiAltManager) : GuiScreen() { override fun drawScreen(mouseX : Int, mouseY : Int, partialTicks : Float) { // Draw background to screen drawBackground(0) - drawRectNew(30f, 30f, width - 30f, height - 30f, Integer.MIN_VALUE) + drawRect(30f, 30f, width - 30f, height - 30f, Integer.MIN_VALUE) // Draw title and status Fonts.font40.drawCenteredString("Donator Cape", width / 2f, 45f, 0xffffff) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiSessionLogin.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiSessionLogin.kt index 112f484d945..0532713a3bb 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiSessionLogin.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/GuiSessionLogin.kt @@ -10,7 +10,7 @@ import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.ClientUtils.LOGGER import net.ccbluex.liquidbounce.utils.login.LoginUtils -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen import net.minecraft.client.gui.GuiTextField @@ -59,7 +59,7 @@ class GuiSessionLogin(private val prevGui: GuiAltManager) : GuiScreen() { override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) { // Draw background to screen drawBackground(0) - drawRectNew(30f, 30f, width - 30f, height - 30f, Integer.MIN_VALUE) + drawRect(30f, 30f, width - 30f, height - 30f, Integer.MIN_VALUE) // Draw title and status Fonts.font40.drawCenteredString("Session Login", width / 2f, height / 2 - 150f, 0xffffff) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/altgenerator/GuiTheAltening.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/altgenerator/GuiTheAltening.kt index 6980a8bd254..50034cf0a94 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/altgenerator/GuiTheAltening.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/altmanager/menus/altgenerator/GuiTheAltening.kt @@ -20,7 +20,7 @@ import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.ClientUtils.LOGGER import net.ccbluex.liquidbounce.utils.TabUtils import net.ccbluex.liquidbounce.utils.misc.MiscUtils -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen import net.minecraft.client.gui.GuiTextField @@ -83,7 +83,7 @@ class GuiTheAltening(private val prevGui: GuiAltManager) : GuiScreen() { override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) { // Draw background to screen drawBackground(0) - drawRectNew(30f, 30f, width - 30f, height - 30f, Integer.MIN_VALUE) + drawRect(30f, 30f, width - 30f, height - 30f, Integer.MIN_VALUE) // Draw title and status Fonts.font40.drawCenteredString("TheAltening", width / 2f, height / 2 - 180f, 0xffffff) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/BlackStyle.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/BlackStyle.kt index 569e6654125..4e0d223a77c 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/BlackStyle.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/BlackStyle.kt @@ -18,7 +18,7 @@ import net.ccbluex.liquidbounce.utils.extensions.component1 import net.ccbluex.liquidbounce.utils.extensions.component2 import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawBorderedRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawFilledCircle -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNewInt +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.value.* import net.minecraft.client.gui.ScaledResolution import net.minecraft.util.StringUtils @@ -79,7 +79,7 @@ object BlackStyle : Style() { } override fun drawButtonElement(mouseX: Int, mouseY: Int, buttonElement: ButtonElement) { - drawRectNewInt( + drawRect( buttonElement.x - 1, buttonElement.y - 1, buttonElement.x + buttonElement.width + 1, @@ -94,11 +94,11 @@ object BlackStyle : Style() { } override fun drawModuleElementAndClick(mouseX: Int, mouseY: Int, moduleElement: ModuleElement, mouseButton: Int?): Boolean { - drawRectNewInt( + drawRect( moduleElement.x - 1, moduleElement.y - 1, moduleElement.x + moduleElement.width + 1, moduleElement.y + moduleElement.height + 1, getHoverColor(Color(40, 40, 40), moduleElement.hoverTime) ) - drawRectNewInt( + drawRect( moduleElement.x - 1, moduleElement.y - 1, moduleElement.x + moduleElement.width + 1, moduleElement.y + moduleElement.height + 1, getHoverColor(Color(20, 20, 20, moduleElement.slowlyFade), moduleElement.hoverTime, !moduleElement.module.isActive) ) @@ -231,8 +231,8 @@ object BlackStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(x, y, x + width, y + 2, Int.MAX_VALUE) - drawRectNewInt(x, y, sliderValue, y + 2, color.rgb) + drawRect(x, y, x + width, y + 2, Int.MAX_VALUE) + drawRect(x, y, sliderValue, y + 2, color.rgb) drawFilledCircle(sliderValue, y + 1, 3f, color) font35.drawString(text, minX + 2, yPos + 3, Color.WHITE.rgb) @@ -269,8 +269,8 @@ object BlackStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(x, y, x + width, y + 2, Int.MAX_VALUE) - drawRectNewInt(x, y, sliderValue, y + 2, color.rgb) + drawRect(x, y, x + width, y + 2, Int.MAX_VALUE) + drawRect(x, y, sliderValue, y + 2, color.rgb) drawFilledCircle(sliderValue, y + 1, 3f, color) font35.drawString(text, minX + 2, yPos + 3, Color.WHITE.rgb) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/LiquidBounceStyle.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/LiquidBounceStyle.kt index 47985d00969..572c86eb7b9 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/LiquidBounceStyle.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/LiquidBounceStyle.kt @@ -18,7 +18,7 @@ import net.ccbluex.liquidbounce.utils.block.BlockUtils.getBlockName import net.ccbluex.liquidbounce.utils.extensions.component1 import net.ccbluex.liquidbounce.utils.extensions.component2 import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawBorderedRect -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNewInt +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.value.* import net.minecraft.client.gui.ScaledResolution import net.minecraft.util.StringUtils @@ -36,7 +36,7 @@ object LiquidBounceStyle : Style() { font35.drawString(panel.name, xPos, panel.y + 7, Color.WHITE.rgb) if (panel.scrollbar && panel.fade > 0) { - drawRectNewInt(panel.x - 2, panel.y + 21, panel.x, panel.y + 16 + panel.fade, Color.DARK_GRAY.rgb) + drawRect(panel.x - 2, panel.y + 21, panel.x, panel.y + 16 + panel.fade, Color.DARK_GRAY.rgb) val visibleRange = panel.getVisibleRange() val minY = panel.y + 21 + panel.fade * @@ -46,7 +46,7 @@ object LiquidBounceStyle : Style() { if (visibleRange.last > 0) visibleRange.last / panel.elements.lastIndex.toFloat() else 0f - drawRectNewInt(panel.x - 2, minY.roundToInt(), panel.x, maxY.roundToInt(), Color.GRAY.rgb) + drawRect(panel.x - 2, minY.roundToInt(), panel.x, maxY.roundToInt(), Color.GRAY.rgb) } } @@ -106,7 +106,7 @@ object LiquidBounceStyle : Style() { moduleElement.settingsWidth = font35.getStringWidth(text) + 8 - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) if (mouseButton == 0 && mouseX in minX..maxX @@ -137,7 +137,7 @@ object LiquidBounceStyle : Style() { return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString("§c$text", minX + 2, yPos + 4, Color.WHITE.rgb) font35.drawString( @@ -151,7 +151,7 @@ object LiquidBounceStyle : Style() { moduleElement.settingsWidth = font35.getStringWidth(valueOfList) + 16 if (value.openList) { - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) if (mouseButton == 0 && mouseX in minX..maxX @@ -192,12 +192,12 @@ object LiquidBounceStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) - drawRectNewInt(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) + drawRect(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) val displayValue = value.get().coerceIn(value.range) val sliderValue = (moduleElement.x + moduleElement.width + (moduleElement.settingsWidth - 12) * (displayValue - value.minimum) / (value.maximum - value.minimum)).roundToInt() - drawRectNewInt(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) + drawRect(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) font35.drawString(text, minX + 2, yPos + 4, Color.WHITE.rgb) @@ -222,12 +222,12 @@ object LiquidBounceStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) - drawRectNewInt(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) + drawRect(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) val displayValue = value.get().coerceIn(value.range) val sliderValue = moduleElement.x + moduleElement.width + (moduleElement.settingsWidth - 12) * (displayValue - value.minimum) / (value.maximum - value.minimum) - drawRectNewInt(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) + drawRect(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) font35.drawString(text, minX + 2, yPos + 4, Color.WHITE.rgb) @@ -248,7 +248,7 @@ object LiquidBounceStyle : Style() { return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString(displayString, minX + 2, yPos + 4, Color.WHITE.rgb) @@ -259,7 +259,7 @@ object LiquidBounceStyle : Style() { moduleElement.settingsWidth = font35.getStringWidth(text) + 8 - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString(text, minX + 2, yPos + 4, Color.WHITE.rgb) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/NullStyle.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/NullStyle.kt index 3125e3cd945..e8a211d6009 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/NullStyle.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/NullStyle.kt @@ -18,7 +18,7 @@ import net.ccbluex.liquidbounce.utils.block.BlockUtils.getBlockName import net.ccbluex.liquidbounce.utils.extensions.component1 import net.ccbluex.liquidbounce.utils.extensions.component2 import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawBorderedRect -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNewInt +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.value.* import net.minecraft.client.gui.ScaledResolution import net.minecraft.util.StringUtils @@ -31,7 +31,7 @@ import kotlin.math.roundToInt object NullStyle : Style() { private fun getNegatedColor() = guiColor.inv() override fun drawPanel(mouseX: Int, mouseY: Int, panel: Panel) { - drawRectNewInt(panel.x - 3, panel.y, panel.x + panel.width + 3, panel.y + 19, guiColor) + drawRect(panel.x - 3, panel.y, panel.x + panel.width + 3, panel.y + 19, guiColor) if (panel.fade > 0) drawBorderedRect(panel.x, panel.y + 19, panel.x + panel.width, panel.y + 19 + panel.fade, 1, Int.MIN_VALUE, Int.MIN_VALUE) @@ -51,7 +51,7 @@ object NullStyle : Style() { val x = mouseX.clamp(0, (scaledWidth / scale - width).roundToInt()) val y = mouseY.clamp(0, (scaledHeight / scale - height).roundToInt()) - drawRectNewInt(x + 9, y, x + width, y + height, guiColor) + drawRect(x + 9, y, x + width, y + height, guiColor) lines.forEachIndexed { index, text -> font35.drawString(text, x + 12, y + 3 + (font35.fontHeight) * index, getNegatedColor()) } @@ -106,7 +106,7 @@ object NullStyle : Style() { return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString(text, minX + 2, yPos + 4, if (value.get()) guiColor else Int.MAX_VALUE @@ -128,7 +128,7 @@ object NullStyle : Style() { return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString("§c$text", minX + 2, yPos + 4, Color.WHITE.rgb) font35.drawString( @@ -151,7 +151,7 @@ object NullStyle : Style() { return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString(">", minX + 2, yPos + 4, if (value.get() == valueOfList) guiColor else Int.MAX_VALUE @@ -183,12 +183,12 @@ object NullStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) - drawRectNewInt(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) + drawRect(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) val displayValue = value.get().coerceIn(value.range) val sliderValue = (moduleElement.x + moduleElement.width + (moduleElement.settingsWidth - 12) * (displayValue - value.minimum) / (value.maximum - value.minimum)).roundToInt() - drawRectNewInt(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) + drawRect(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) font35.drawString(text, minX + 2, yPos + 4, Color.WHITE.rgb) @@ -213,12 +213,12 @@ object NullStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) - drawRectNewInt(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 24, Int.MIN_VALUE) + drawRect(minX + 4, yPos + 18, maxX - 4, yPos + 19, Int.MAX_VALUE) val displayValue = value.get().coerceIn(value.range) val sliderValue = moduleElement.x + moduleElement.width + (moduleElement.settingsWidth - 12) * (displayValue - value.minimum) / (value.maximum - value.minimum) - drawRectNewInt(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) + drawRect(8 + sliderValue, yPos + 15, sliderValue + 11, yPos + 21, guiColor) font35.drawString(text, minX + 2, yPos + 4, Color.WHITE.rgb) @@ -239,7 +239,7 @@ object NullStyle : Style() { return true } - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString(displayString, minX + 2, yPos + 4, Color.WHITE.rgb) @@ -250,7 +250,7 @@ object NullStyle : Style() { moduleElement.settingsWidth = font35.getStringWidth(text) + 8 - drawRectNewInt(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) + drawRect(minX, yPos + 2, maxX, yPos + 14, Int.MIN_VALUE) font35.drawString(text, minX + 2, yPos + 4, Color.WHITE.rgb) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/SlowlyStyle.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/SlowlyStyle.kt index 85892448fd4..98b618422b2 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/SlowlyStyle.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui/style/styles/SlowlyStyle.kt @@ -18,7 +18,7 @@ import net.ccbluex.liquidbounce.utils.extensions.component1 import net.ccbluex.liquidbounce.utils.extensions.component2 import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawBorderedRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawFilledCircle -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNewInt +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.value.* import net.minecraft.client.gui.ScaledResolution import net.minecraft.util.StringUtils @@ -59,7 +59,7 @@ object SlowlyStyle : Style() { } override fun drawButtonElement(mouseX: Int, mouseY: Int, buttonElement: ButtonElement) { - drawRectNewInt(buttonElement.x - 1, buttonElement.y - 1, buttonElement.x + buttonElement.width + 1, buttonElement.y + buttonElement.height + 1, + drawRect(buttonElement.x - 1, buttonElement.y - 1, buttonElement.x + buttonElement.width + 1, buttonElement.y + buttonElement.height + 1, getHoverColor( if (buttonElement.color != Int.MAX_VALUE) Color(7, 152, 252) else Color(54, 71, 96), buttonElement.hoverTime @@ -70,10 +70,10 @@ object SlowlyStyle : Style() { } override fun drawModuleElementAndClick(mouseX: Int, mouseY: Int, moduleElement: ModuleElement, mouseButton: Int?): Boolean { - drawRectNewInt(moduleElement.x - 1, moduleElement.y - 1, moduleElement.x + moduleElement.width + 1, moduleElement.y + moduleElement.height + 1, + drawRect(moduleElement.x - 1, moduleElement.y - 1, moduleElement.x + moduleElement.width + 1, moduleElement.y + moduleElement.height + 1, getHoverColor(Color(54, 71, 96), moduleElement.hoverTime) ) - drawRectNewInt(moduleElement.x - 1, moduleElement.y - 1, moduleElement.x + moduleElement.width + 1, moduleElement.y + moduleElement.height + 1, + drawRect(moduleElement.x - 1, moduleElement.y - 1, moduleElement.x + moduleElement.width + 1, moduleElement.y + moduleElement.height + 1, getHoverColor(Color(7, 152, 252, moduleElement.slowlyFade), moduleElement.hoverTime, !moduleElement.module.isActive) ) @@ -196,8 +196,8 @@ object SlowlyStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(x, y, x + width, y + 2, Int.MAX_VALUE) - drawRectNewInt(x, y, sliderValue, y + 2, color.rgb) + drawRect(x, y, x + width, y + 2, Int.MAX_VALUE) + drawRect(x, y, sliderValue, y + 2, color.rgb) drawFilledCircle(sliderValue, y + 1, 3f, color) font35.drawString(text, minX + 2, yPos + 3, Color.WHITE.rgb) @@ -231,8 +231,8 @@ object SlowlyStyle : Style() { if (mouseButton == 0) return true } - drawRectNewInt(x, y, x + width, y + 2, Int.MAX_VALUE) - drawRectNewInt(x, y, sliderValue, y + 2, color.rgb) + drawRect(x, y, x + width, y + 2, Int.MAX_VALUE) + drawRect(x, y, sliderValue, y + 2, color.rgb) drawFilledCircle(sliderValue, y + 1, 3f, color) font35.drawString(text, minX + 2, yPos + 3, Color.WHITE.rgb) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/designer/EditorPanel.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/designer/EditorPanel.kt index 2279b4bc904..17a41b62c8d 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/designer/EditorPanel.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/designer/EditorPanel.kt @@ -15,8 +15,6 @@ import net.ccbluex.liquidbounce.ui.client.hud.element.Side import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.MinecraftInstance import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNewInt import net.ccbluex.liquidbounce.utils.render.RenderUtils.makeScissorBox import net.ccbluex.liquidbounce.value.* import net.minecraft.client.gui.ScaledResolution @@ -87,7 +85,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In } // Draw panel - drawRectNewInt(x, y + 12, x + width, y + realHeight, Color(0, 0, 0, 150).rgb) + drawRect(x, y + 12, x + width, y + realHeight, Color(0, 0, 0, 150).rgb) when { create -> drawCreate(mouseX, currMouseY) currentElement != null -> drawEditor(mouseX, currMouseY) @@ -96,11 +94,11 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In // Scrolling end if (shouldScroll) { - drawRectNewInt(x + width - 5, y + 15, x + width - 2, y + 197, + drawRect(x + width - 5, y + 15, x + width - 2, y + 197, Color(41, 41, 41).rgb) val v = 197 * (-scroll / (realHeight - 170F)) - drawRectNew(x + width - 5F, y + 15 + v, x + width - 2F, y + 20 + v, + drawRect(x + width - 5F, y + 15 + v, x + width - 2F, y + 20 + v, Color(37, 126, 255).rgb) glDisable(GL_SCISSOR_TEST) @@ -152,7 +150,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In realHeight += 10 } - drawRectNewInt(x, y, x + width, y + 12, guiColor) + drawRect(x, y, x + width, y + 12, guiColor) Fonts.font35.drawString("§lCreate element", x + 2F, y + 3.5F, Color.WHITE.rgb) } @@ -198,7 +196,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In realHeight += 10 } - drawRectNewInt(x, y, x + width, y + 12, guiColor) + drawRect(x, y, x + width, y + 12, guiColor) glColor4f(1f, 1f, 1f, 1f) Fonts.font35.drawString("§lEditor", x + 2F, y + 3.5f, Color.WHITE.rgb) @@ -208,7 +206,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In val dialogWidth = width val dialogHeight = 30 - drawRectNewInt(dialogX, dialogY + 10, dialogX + dialogWidth, dialogY + dialogHeight + 10, Color(0, 0, 0, 150).rgb) + drawRect(dialogX, dialogY + 10, dialogX + dialogWidth, dialogY + dialogHeight + 10, Color(0, 0, 0, 150).rgb) val confirmationMessage = "You sure you want to reset?" Fonts.font35.drawString(confirmationMessage, dialogX + 8f, dialogY.toFloat() + 12, Color.WHITE.rgb) @@ -220,11 +218,11 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In val buttonY = dialogY + dialogHeight - buttonHeight + 8 // Yes button - drawRectNewInt(yesButtonX, buttonY, yesButtonX + buttonWidth, buttonY + buttonHeight, Color.GREEN.rgb) + drawRect(yesButtonX, buttonY, yesButtonX + buttonWidth, buttonY + buttonHeight, Color.GREEN.rgb) Fonts.font35.drawString("Yes", yesButtonX + 8f, buttonY.toFloat() + 5, Color.WHITE.rgb) // No button - drawRectNewInt(noButtonX, buttonY, noButtonX + buttonWidth, buttonY + buttonHeight, Color.RED.rgb) + drawRect(noButtonX, buttonY, noButtonX + buttonWidth, buttonY + buttonHeight, Color.RED.rgb) Fonts.font35.drawString("No", noButtonX + 10f, buttonY.toFloat() + 5, Color.WHITE.rgb) if (Mouse.isButtonDown(0) && !mouseDown) { @@ -354,7 +352,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In // Slider mark val sliderValue = x + ((prevWidth - 18F) * (current - min) / (max - min)) - drawRectNew(8F + sliderValue, y + height + 9F, sliderValue + 11F, y + height + drawRect(8F + sliderValue, y + height + 9F, sliderValue + 11F, y + height + 15F, Color(37, 126, 255).rgb) // Slider changer @@ -389,7 +387,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In // Slider mark val sliderValue = x + ((prevWidth - 18F) * (current - min) / (max - min)) - drawRectNew(8F + sliderValue, y + height + 9F, sliderValue + 11F, y + height + drawRect(8F + sliderValue, y + height + 9F, sliderValue + 11F, y + height + 15F, Color(37, 126, 255).rgb) // Slider changer @@ -461,7 +459,7 @@ class EditorPanel(private val hudDesigner: GuiHudDesigner, var x: Int, var y: In } // Header - drawRectNewInt(x, y, x + width, y + 12, guiColor) + drawRect(x, y, x + width, y + 12, guiColor) Fonts.font35.drawString("§l${element.name}", x + 2F, y + 3.5F, Color.WHITE.rgb) // Delete button diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Cooldown.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Cooldown.kt index 97d0817c5c9..d853fcea9d1 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Cooldown.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Cooldown.kt @@ -10,7 +10,7 @@ import net.ccbluex.liquidbounce.ui.client.hud.element.Element import net.ccbluex.liquidbounce.ui.client.hud.element.ElementInfo import net.ccbluex.liquidbounce.ui.client.hud.element.Side import net.ccbluex.liquidbounce.utils.CooldownHelper.getAttackCooldownProgress -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import java.awt.Color /** @@ -29,8 +29,8 @@ class Cooldown(x: Double = 0.0, y: Double = -14.0, scale: Float = 1F, val progress = getAttackCooldownProgress() if (progress < 1.0) { - drawRectNew(-25f, 0f, 25f, 3f, Color(0, 0, 0, 150).rgb) - drawRectNew(-25f, 0f, 25f - 50f * progress.toFloat(), 3f, Color(0, 111, 255, 200).rgb) + drawRect(-25f, 0f, 25f, 3f, Color(0, 0, 0, 150).rgb) + drawRect(-25f, 0f, 25f - 50f * progress.toFloat(), 3f, Color(0, 111, 255, 200).rgb) } return Border(-25F, 0F, 25F, 3F) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Inventory.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Inventory.kt index 06bae506bfe..83616fd90f3 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Inventory.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Inventory.kt @@ -12,7 +12,7 @@ import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.render.ColorUtils import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawBorder -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew2 +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRoundedRect2 import net.ccbluex.liquidbounce.value.* import net.minecraft.client.gui.FontRenderer @@ -57,7 +57,7 @@ class Inventory : Element(300.0, 50.0) { drawRoundedRect2(0F, startY, width, height, Color(0,0,0, backgroundAlpha), roundedRectRadius) if (borderValue) { drawBorder(0f, startY, width, height, 3f, borderColor.rgb) - drawRectNew2(0F, 0f, width, 1f, borderColor) + drawRect(0F, 0f, width, 1f, borderColor) } // Reset color resetColor() diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Notifications.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Notifications.kt index c00979c32d0..c4ece5f98b7 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Notifications.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Notifications.kt @@ -16,7 +16,7 @@ import net.ccbluex.liquidbounce.ui.client.hud.element.Side import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.render.AnimationUtils import net.ccbluex.liquidbounce.utils.render.RenderUtils.deltaTime -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import org.lwjgl.opengl.GL11.glColor4f import java.awt.Color @@ -76,8 +76,8 @@ class Notification(private val message: String, private val delay: Float = 60F) */ fun drawNotification() { // Draw notification - drawRectNew(-x + 8 + textLength, 0F, -x, -20F, Color.BLACK.rgb) - drawRectNew(-x, 0F, -x - 5, -20F, Color(0, 160, 255).rgb) + drawRect(-x + 8 + textLength, 0F, -x, -20F, Color.BLACK.rgb) + drawRect(-x, 0F, -x - 5, -20F, Color(0, 160, 255).rgb) Fonts.font35.drawString(message, -x + 4, -14F, Int.MAX_VALUE) glColor4f(1f, 1f, 1f, 1f) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Radar.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Radar.kt index 57e6481487d..372f85ccd08 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Radar.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Radar.kt @@ -14,7 +14,7 @@ import net.ccbluex.liquidbounce.utils.EntityUtils.isSelected import net.ccbluex.liquidbounce.utils.extensions.toRadians import net.ccbluex.liquidbounce.utils.render.MiniMapRegister import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawBorder -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.glColor import net.ccbluex.liquidbounce.utils.render.RenderUtils.makeScissorBox import net.ccbluex.liquidbounce.utils.render.SafeVertexBuffer @@ -83,7 +83,7 @@ class Radar(x: Double = 5.0, y: Double = 130.0) : Element(x, y) { val size = size if (!minimap) { - drawRectNew(0F, 0F, size, size, Color(backgroundRed, backgroundGreen, backgroundBlue, backgroundAlpha).rgb) + drawRect(0F, 0F, size, size, Color(backgroundRed, backgroundGreen, backgroundBlue, backgroundAlpha).rgb) } val viewDistance = viewDistance * 16f diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Target.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Target.kt index 8074ed58d05..fb231d6fb65 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Target.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Target.kt @@ -13,7 +13,7 @@ import net.ccbluex.liquidbounce.ui.font.Fonts import net.ccbluex.liquidbounce.utils.EntityUtils.getHealth import net.ccbluex.liquidbounce.utils.extensions.getDistanceToEntityBox import net.ccbluex.liquidbounce.utils.render.RenderUtils.deltaTime -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRectNew +import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRoundedBorderRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawScaledCustomSizeModalRect import net.ccbluex.liquidbounce.utils.render.animation.AnimationUtil @@ -180,7 +180,7 @@ class Target : Element() { // Health bar val healthBarWidth = (targetHealth / maxHealth) * (width - 6f) - drawRectNew(3F, 34F, 3f + healthBarWidth, 36F, healthColor.rgb) + drawRect(3F, 34F, 3f + healthBarWidth, 36F, healthColor.rgb) // Easing health update easingHealth += ((targetHealth - easingHealth) / 2f.pow(10f - fadeSpeed)) * deltaTime @@ -188,12 +188,12 @@ class Target : Element() { // Heal animation, only animate from the right side if (easingHealth < targetHealth) { - drawRectNew(3f + easingHealthWidth, 34F, 3f + healthBarWidth, 36F, Color(44, 201, 144).rgb) + drawRect(3f + easingHealthWidth, 34F, 3f + healthBarWidth, 36F, Color(44, 201, 144).rgb) } // Damage animation, only animate from the right side if (easingHealth > targetHealth) { - drawRectNew(3f + healthBarWidth, 34F, 3f + easingHealthWidth, 36F, Color(252, 185, 65).rgb) + drawRect(3f + healthBarWidth, 34F, 3f + easingHealthWidth, 36F, Color(252, 185, 65).rgb) } if (fadeMode && shouldRender || (smoothMode && shouldRender && width == width) || delayCounter < vanishDelay) { diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/render/RenderUtils.kt b/src/main/java/net/ccbluex/liquidbounce/utils/render/RenderUtils.kt index b1cc597b8ec..45b90b0cadc 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/render/RenderUtils.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/render/RenderUtils.kt @@ -35,28 +35,28 @@ object RenderUtils : MinecraftInstance() { } glNewList(DISPLAY_LISTS_2D[0], GL_COMPILE) - quickDrawRectNew(-7f, 2f, -4f, 3f) - quickDrawRectNew(4f, 2f, 7f, 3f) - quickDrawRectNew(-7f, 0.5f, -6f, 3f) - quickDrawRectNew(6f, 0.5f, 7f, 3f) + quickDrawRect(-7f, 2f, -4f, 3f) + quickDrawRect(4f, 2f, 7f, 3f) + quickDrawRect(-7f, 0.5f, -6f, 3f) + quickDrawRect(6f, 0.5f, 7f, 3f) glEndList() glNewList(DISPLAY_LISTS_2D[1], GL_COMPILE) - quickDrawRectNew(-7f, 3f, -4f, 3.3f) - quickDrawRectNew(4f, 3f, 7f, 3.3f) - quickDrawRectNew(-7.3f, 0.5f, -7f, 3.3f) - quickDrawRectNew(7f, 0.5f, 7.3f, 3.3f) + quickDrawRect(-7f, 3f, -4f, 3.3f) + quickDrawRect(4f, 3f, 7f, 3.3f) + quickDrawRect(-7.3f, 0.5f, -7f, 3.3f) + quickDrawRect(7f, 0.5f, 7.3f, 3.3f) glEndList() glNewList(DISPLAY_LISTS_2D[2], GL_COMPILE) - quickDrawRectNew(4f, -20f, 7f, -19f) - quickDrawRectNew(-7f, -20f, -4f, -19f) - quickDrawRectNew(6f, -20f, 7f, -17.5f) - quickDrawRectNew(-7f, -20f, -6f, -17.5f) + quickDrawRect(4f, -20f, 7f, -19f) + quickDrawRect(-7f, -20f, -4f, -19f) + quickDrawRect(6f, -20f, 7f, -17.5f) + quickDrawRect(-7f, -20f, -6f, -17.5f) glEndList() glNewList(DISPLAY_LISTS_2D[3], GL_COMPILE) - quickDrawRectNew(7f, -20f, 7.3f, -17.5f) - quickDrawRectNew(-7.3f, -20f, -7f, -17.5f) - quickDrawRectNew(4f, -20.3f, 7.3f, -20f) - quickDrawRectNew(-7.3f, -20.3f, -4f, -20f) + quickDrawRect(7f, -20f, 7.3f, -17.5f) + quickDrawRect(-7.3f, -20f, -7f, -17.5f) + quickDrawRect(4f, -20.3f, 7.3f, -20f) + quickDrawRect(-7.3f, -20.3f, -4f, -20f) glEndList() } @@ -278,46 +278,15 @@ object RenderUtils : MinecraftInstance() { tessellator.draw() } - /** - * Optimized version of quickDrawRect (Float) - */ - fun quickDrawRectNew(x: Float, y: Float, x2: Float, y2: Float) { - val tessellator = Tessellator.getInstance() - val worldRenderer = tessellator.worldRenderer - - worldRenderer.begin(GL_QUADS, DefaultVertexFormats.POSITION) - worldRenderer.pos(x2.toDouble(), y.toDouble(), 0.0).endVertex() - worldRenderer.pos(x.toDouble(), y.toDouble(), 0.0).endVertex() - worldRenderer.pos(x.toDouble(), y2.toDouble(), 0.0).endVertex() - worldRenderer.pos(x2.toDouble(), y2.toDouble(), 0.0).endVertex() - tessellator.draw() - } - - /** - * Optimized version of quickDrawRect (Color) - */ - fun quickDrawRectNew2(x: Float, y: Float, x2: Float, y2: Float, color: Int) { - val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer - - glColor(color) - worldrenderer.begin(GL_QUADS, DefaultVertexFormats.POSITION) - worldrenderer.pos(x2.toDouble(), y.toDouble(), 0.0).endVertex() - worldrenderer.pos(x.toDouble(), y.toDouble(), 0.0).endVertex() - worldrenderer.pos(x.toDouble(), y2.toDouble(), 0.0).endVertex() - worldrenderer.pos(x2.toDouble(), y2.toDouble(), 0.0).endVertex() - tessellator.draw() - } - - fun drawRect(x: Float, y: Float, x2: Float, y2: Float, color: Color) = drawRectNew(x, y, x2, y2, color.rgb) + fun drawRect(x: Float, y: Float, x2: Float, y2: Float, color: Color) = drawRect(x, y, x2, y2, color.rgb) fun drawBorderedRect(x: Float, y: Float, x2: Float, y2: Float, width: Float, color1: Int, color2: Int) { - drawRectNew(x, y, x2, y2, color2) + drawRect(x, y, x2, y2, color2) drawBorder(x, y, x2, y2, width, color1) } fun drawBorderedRect(x: Int, y: Int, x2: Int, y2: Int, width: Int, borderColor: Int, rectColor: Int) { - drawRectNewInt(x, y, x2, y2, rectColor) + drawRect(x, y, x2, y2, rectColor) drawBorder(x, y, x2, y2, width, borderColor) } @@ -419,24 +388,72 @@ object RenderUtils : MinecraftInstance() { glDisable(GL_LINE_SMOOTH) } + fun quickDrawRect(x: Float, y: Float, x2: Float, y2: Float) { + glBegin(GL_QUADS) + glVertex2d(x2.toDouble(), y.toDouble()) + glVertex2d(x.toDouble(), y.toDouble()) + glVertex2d(x.toDouble(), y2.toDouble()) + glVertex2d(x2.toDouble(), y2.toDouble()) + glEnd() + } + + fun drawRect(x: Float, y: Float, x2: Float, y2: Float, color: Int) { + glEnable(GL_BLEND) + glDisable(GL_TEXTURE_2D) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + glEnable(GL_LINE_SMOOTH) + glColor(color) + glBegin(GL_QUADS) + glVertex2f(x2, y) + glVertex2f(x, y) + glVertex2f(x, y2) + glVertex2f(x2, y2) + glEnd() + glEnable(GL_TEXTURE_2D) + glDisable(GL_BLEND) + glDisable(GL_LINE_SMOOTH) + } + + fun drawRect(x: Int, y: Int, x2: Int, y2: Int, color: Int) { + glEnable(GL_BLEND) + glDisable(GL_TEXTURE_2D) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + glEnable(GL_LINE_SMOOTH) + glColor(color) + glBegin(GL_QUADS) + glVertex2i(x2, y) + glVertex2i(x, y) + glVertex2i(x, y2) + glVertex2i(x2, y2) + glEnd() + glEnable(GL_TEXTURE_2D) + glDisable(GL_BLEND) + glDisable(GL_LINE_SMOOTH) + } + /** - * Optimized version of quickDrawBorderedRect + * Like [.drawRect], but without setup */ - fun quickDrawBorderedRectNew(x: Float, y: Float, x2: Float, y2: Float, width: Float, color1: Int, color2: Int) { - quickDrawRectNew2(x, y, x2, y2, color2) - - val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer + fun quickDrawRect(x: Float, y: Float, x2: Float, y2: Float, color: Int) { + glColor(color) + glBegin(GL_QUADS) + glVertex2d(x2.toDouble(), y.toDouble()) + glVertex2d(x.toDouble(), y.toDouble()) + glVertex2d(x.toDouble(), y2.toDouble()) + glVertex2d(x2.toDouble(), y2.toDouble()) + glEnd() + } + fun quickDrawBorderedRect(x: Float, y: Float, x2: Float, y2: Float, width: Float, color1: Int, color2: Int) { + quickDrawRect(x, y, x2, y2, color2) glColor(color1) glLineWidth(width) - worldrenderer.begin(GL_LINE_LOOP, DefaultVertexFormats.POSITION) - worldrenderer.pos(x2.toDouble(), y.toDouble(), 0.0).endVertex() - worldrenderer.pos(x.toDouble(), y.toDouble(), 0.0).endVertex() - worldrenderer.pos(x.toDouble(), y2.toDouble(), 0.0).endVertex() - worldrenderer.pos(x2.toDouble(), y2.toDouble(), 0.0).endVertex() - - tessellator.draw() + glBegin(GL_LINE_LOOP) + glVertex2d(x2.toDouble(), y.toDouble()) + glVertex2d(x.toDouble(), y.toDouble()) + glVertex2d(x.toDouble(), y2.toDouble()) + glVertex2d(x2.toDouble(), y2.toDouble()) + glEnd() } fun drawLoadingCircle(x: Float, y: Float) { @@ -541,93 +558,6 @@ object RenderUtils : MinecraftInstance() { return floatArrayOf(newX1, newY1, newX2, newY2) } - /** - * Optimized version of drawRect (Float) - */ - fun drawRectNew(x1: Float, y1: Float, x2: Float, y2: Float, color: Int) { - val alpha = ((color shr 24) and 0xFF) / 255f - val red = ((color shr 16) and 0xFF) / 255f - val green = ((color shr 8) and 0xFF) / 255f - val blue = (color and 0xFF) / 255f - - glEnable(GL_BLEND) - glDisable(GL_TEXTURE_2D) - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - glShadeModel(GL_SMOOTH) - - val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer - worldrenderer.begin(GL_QUADS, DefaultVertexFormats.POSITION_COLOR) - - worldrenderer.pos(x1.toDouble(), y2.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x2.toDouble(), y2.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x2.toDouble(), y1.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x1.toDouble(), y1.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - - tessellator.draw() - - glEnable(GL_TEXTURE_2D) - glDisable(GL_BLEND) - } - - /** - * Optimized version of drawRect (Float) - */ - fun drawRectNew2(x1: Float, y1: Float, x2: Float, y2: Float, color: Color) { - val red = color.red.toFloat() / 255f - val green = color.green.toFloat() / 255f - val blue = color.blue.toFloat() / 255f - val alpha = color.alpha.toFloat() / 255f - - glEnable(GL_BLEND) - glDisable(GL_TEXTURE_2D) - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - glShadeModel(GL_SMOOTH) - - val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer - worldrenderer.begin(GL_QUADS, DefaultVertexFormats.POSITION_COLOR) - - worldrenderer.pos(x1.toDouble(), y2.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x2.toDouble(), y2.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x2.toDouble(), y1.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x1.toDouble(), y1.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - - tessellator.draw() - - glEnable(GL_TEXTURE_2D) - glDisable(GL_BLEND) - } - - /** - * Optimized version of drawRect (Int) - */ - fun drawRectNewInt(x1: Int, y1: Int, x2: Int, y2: Int, color: Int) { - val alpha = ((color shr 24) and 0xFF) / 255f - val red = ((color shr 16) and 0xFF) / 255f - val green = ((color shr 8) and 0xFF) / 255f - val blue = (color and 0xFF) / 255f - - glEnable(GL_BLEND) - glDisable(GL_TEXTURE_2D) - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - glShadeModel(GL_SMOOTH) - - val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer - worldrenderer.begin(GL_QUADS, DefaultVertexFormats.POSITION_COLOR) - - worldrenderer.pos(x1.toDouble(), y2.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x2.toDouble(), y2.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x2.toDouble(), y1.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - worldrenderer.pos(x1.toDouble(), y1.toDouble(), 0.0).color(red, green, blue, alpha).endVertex() - - tessellator.draw() - - glEnable(GL_TEXTURE_2D) - glDisable(GL_BLEND) - } - fun drawCircle(x: Float, y: Float, radius: Float, start: Int, end: Int) { enableBlend() disableTexture2D() @@ -818,7 +748,7 @@ object RenderUtils : MinecraftInstance() { setGlCap(GL_BLEND, true) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) val width = Fonts.font35.getStringWidth(string) / 2 - drawRectNewInt(-width - 1, -1, width + 1, Fonts.font35.FONT_HEIGHT, Int.MIN_VALUE) + drawRect(-width - 1, -1, width + 1, Fonts.font35.FONT_HEIGHT, Int.MIN_VALUE) Fonts.font35.drawString(string, -width.toFloat(), 1.5f, Color.WHITE.rgb, true) resetCaps() glColor4f(1f, 1f, 1f, 1f)