Skip to content

Commit

Permalink
feat(legacy): added rounded-rect to blackhotbar (CCBlueX#4068)
Browse files Browse the repository at this point in the history
  • Loading branch information
EclipsesDev authored Oct 5, 2024
1 parent 177b8d4 commit eb1dedf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner
import net.ccbluex.liquidbounce.value.BoolValue
import net.ccbluex.liquidbounce.value.FloatValue
import net.minecraft.client.gui.GuiChat
import net.minecraft.util.ResourceLocation

object HUD : Module("HUD", Category.RENDER, defaultInArray = false, gameDetecting = false, hideModule = true) {
val blackHotbar by BoolValue("BlackHotbar", true)
val roundedHotbarRadius by FloatValue("RoundedHotbar-Radius", 0F, 0F..5F) { blackHotbar }
val inventoryParticle by BoolValue("InventoryParticle", false)
private val blur by BoolValue("Blur", false)
val fontChat by BoolValue("FontChat", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer;
import net.ccbluex.liquidbounce.utils.ClassUtils;
import net.ccbluex.liquidbounce.utils.render.FakeItemRender;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.GuiStreamIndicator;
Expand Down Expand Up @@ -120,6 +121,7 @@ public void updateTick() {
@Overwrite
protected void renderTooltip(ScaledResolution sr, float partialTicks) {
final HUD hud = HUD.INSTANCE;
final RenderUtils render = RenderUtils.INSTANCE;

if (mc.getRenderViewEntity() instanceof EntityPlayer) {
EntityPlayer entityPlayer = (EntityPlayer) mc.getRenderViewEntity();
Expand All @@ -133,9 +135,9 @@ protected void renderTooltip(ScaledResolution sr, float partialTicks) {
int middleScreen = sr.getScaledWidth() / 2;
int height = sr.getScaledHeight() - 1;

color(1f, 1f, 1f, 1f);
drawRect(middleScreen - 91, height - 22, middleScreen + 91, height, Integer.MIN_VALUE);
drawRect(middleScreen - 91 - 1 + slot * 20 + 1, height - 22, middleScreen - 91 - 1 + slot * 20 + 23, height - 23 - 1 + 24, Integer.MAX_VALUE);
resetColor();
render.drawRoundedRectInt(middleScreen - 91, height - 22, middleScreen + 91, height, Integer.MIN_VALUE, hud.getRoundedHotbarRadius());
render.drawRoundedRectInt(middleScreen - 91 - 1 + slot * 20 + 1, height - 22, middleScreen - 91 - 1 + slot * 20 + 23, height - 23 - 1 + 24, Integer.MAX_VALUE, hud.getRoundedHotbarRadius());

enableRescaleNormal();
glEnable(GL_BLEND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Arraylist(
"Rect-Color",
arrayOf("Custom", "Random", "Rainbow", "Gradient"),
"Rainbow"
) { rectMode != "None" }
) { rectMode !in setOf("None", "Outline") }
private val isCustomRectSupported = { rectMode != "None" && rectColorMode == "Custom" }
private val rectRed by IntegerValue("Rect-R", 255, 0..255, isSupported = isCustomRectSupported)
private val rectGreen by IntegerValue("Rect-G", 255, 0..255, isSupported = isCustomRectSupported)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/ccbluex/liquidbounce/value/Value.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
package net.ccbluex.liquidbounce.value

import com.google.gson.JsonArray
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
Expand Down

0 comments on commit eb1dedf

Please sign in to comment.