Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feats(legacy): Modern TargetHUD + Gradient Colors to KillAura Circle #5647

Merged
merged 20 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import net.ccbluex.liquidbounce.LiquidBounce
import net.ccbluex.liquidbounce.event.*
import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.modules.combat.Backtrack.runWithSimulatedPosition
import net.ccbluex.liquidbounce.features.module.modules.player.Blink
import net.ccbluex.liquidbounce.features.module.modules.world.Fucker
import net.ccbluex.liquidbounce.features.module.modules.world.Nuker
Expand All @@ -28,7 +29,6 @@ import net.ccbluex.liquidbounce.utils.inventory.ItemUtils.isConsumingItem
import net.ccbluex.liquidbounce.utils.inventory.SilentHotbar
import net.ccbluex.liquidbounce.utils.kotlin.RandomUtils.nextInt
import net.ccbluex.liquidbounce.utils.render.ColorSettingsInteger
import net.ccbluex.liquidbounce.utils.render.ColorUtils.rainbow
import net.ccbluex.liquidbounce.utils.render.ColorUtils.withAlpha
import net.ccbluex.liquidbounce.utils.render.RenderUtils
import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawCircle
Expand Down Expand Up @@ -294,12 +294,8 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R) {
private val aimPointBoxSize by float("AimPointBoxSize", 0.1f, 0f..0.2F) { renderAimPointBox }.subjective()

// Circle options
private val circleRainbow by boolean("CircleRainbow", false) { mark == "Circle" }.subjective()

// TODO: replace this with color value
private val colors = ColorSettingsInteger(
this, "CircleColor"
) { mark == "Circle" && !circleRainbow }.with(132, 102, 255, 100)//.subjective()
private val circleStartColor by color("CircleStartColor", Color.BLUE) { mark == "Circle" }.subjective()
private val circleEndColor by color("CircleEndColor", Color.CYAN.withAlpha(0)) { mark == "Circle" }.subjective()
private val fillInnerCircle by boolean("FillInnerCircle", false) { mark == "Circle" }.subjective()
private val withHeight by boolean("WithHeight", true) { mark == "Circle" }.subjective()
private val animateHeight by boolean("AnimateHeight", false) { withHeight }.subjective()
Expand Down Expand Up @@ -549,7 +545,8 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R) {
fillInnerCircle,
withHeight,
circleYRange.takeIf { animateCircleY },
if (circleRainbow) rainbow().withAlpha(colors.color().alpha) else colors.color()
circleStartColor.rgb,
circleEndColor.rgb
)
}
}
Expand Down Expand Up @@ -1233,13 +1230,15 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R) {

val renderManager = mc.renderManager

val rotationVec = player.interpolatedPosition(player.prevPos, player.eyeHeight) + getVectorForRotation(
serverRotation.lerpWith(currentRotation ?: player.rotation, mc.timer.renderPartialTicks)
) * player.getDistanceToEntityBox(target).coerceAtMost(range.toDouble())
runWithSimulatedPosition(player, player.interpolatedPosition(player.prevPos)) {
val rotationVec = player.eyes + getVectorForRotation(
serverRotation.lerpWith(currentRotation ?: player.rotation, mc.timer.renderPartialTicks)
) * player.getDistanceToEntityBox(target).coerceAtMost(range.toDouble())

val offSetBox = box.offset(rotationVec - renderManager.renderPos)
val offSetBox = box.offset(rotationVec - renderManager.renderPos)

RenderUtils.drawAxisAlignedBB(offSetBox, aimPointBoxColor)
RenderUtils.drawAxisAlignedBB(offSetBox, aimPointBoxColor)
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) {

float radius = 2.5F;

// Draw original
RenderUtils.INSTANCE.drawRoundedRect(xPosition, yPosition, xPosition + width, yPosition + height, enabled ? new Color(0F, 0F, 0F, 120 / 255f).getRGB() : new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB(), radius, RenderUtils.RoundedCorners.ALL);

if (enabled && progress != xPosition) {
// Draw blue overlay
RenderUtils.INSTANCE.drawRoundedRect(xPosition, yPosition, progress, yPosition + height, new Color(0F, 0F, 1F, 1F).getRGB(), radius, RenderUtils.RoundedCorners.ALL);
}
RenderUtils.INSTANCE.withClipping(() -> {
RenderUtils.INSTANCE.drawRoundedRect(xPosition, yPosition, xPosition + width, yPosition + height, enabled ? new Color(0F, 0F, 0F, 120 / 255f).getRGB() : new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB(), radius, RenderUtils.RoundedCorners.ALL);
return null;
}, () -> {
if (enabled && progress != xPosition) {
// Draw blue overlay
RenderUtils.INSTANCE.drawGradientRect(xPosition, yPosition, progress, yPosition + height, Color.CYAN.darker().getRGB(), Color.BLUE.darker().getRGB(), 0F);
}
return null;
});

mc.getTextureManager().bindTexture(buttonTextures);
mouseDragged(mc, mouseX, mouseY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) {

float radius = 2.5F;

// Draw original
RenderUtils.INSTANCE.drawRoundedRect(xPosition, yPosition, xPosition + width, yPosition + height, enabled ? new Color(0F, 0F, 0F, 120 / 255f).getRGB() : new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB(), radius, RenderUtils.RoundedCorners.ALL);

if (enabled && progress != xPosition) {
// Draw blue overlay
RenderUtils.INSTANCE.drawRoundedRect(xPosition, yPosition, progress, yPosition + height, new Color(0F, 0F, 1F, 1F).getRGB(), radius, RenderUtils.RoundedCorners.ALL);
}
RenderUtils.INSTANCE.withClipping(() -> {
RenderUtils.INSTANCE.drawRoundedRect(xPosition, yPosition, xPosition + width, yPosition + height, enabled ? new Color(0F, 0F, 0F, 120 / 255f).getRGB() : new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB(), radius, RenderUtils.RoundedCorners.ALL);
return null;
}, () -> {
if (enabled && progress != xPosition) {
// Draw blue overlay
RenderUtils.INSTANCE.drawGradientRect(xPosition, yPosition, progress, yPosition + height, Color.CYAN.darker().getRGB(), Color.BLUE.darker().getRGB(), 0F);
}
return null;
});

mc.getTextureManager().bindTexture(buttonTextures);
mouseDragged(mc, mouseX, mouseY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@ private void injectClientDraw(int p_drawSelectionBox_1_, int p_drawSelectionBox_
int i1 = this.left + (this.width / 2 - this.getListWidth() / 2);
int j1 = this.left + this.width / 2 + this.getListWidth() / 2;

RenderUtils.INSTANCE.drawRoundedRect(i1 + 2, k, j1 - 1, k + l + 1, new Color(0, 0, 0, 100).getRGB(), 2F, RenderUtils.RoundedCorners.ALL);

RenderUtils.INSTANCE.drawRoundedBorder(i1 + 2, k + l + 1, j1 - 1, k + l + 1, 3F, Color.BLUE.getRGB(), 0F);
RenderUtils.INSTANCE.drawRoundedRect(i1 + 2, k, j1 - 1, k + l + 1, new Color(0, 0, 0, 100).getRGB(), 2F, RenderUtils.RoundedCorners.TOP_ONLY);
RenderUtils.INSTANCE.drawGradientRect(i1 + 2, k + l, j1 - 1, k + l + 1.5f, Color.CYAN.getRGB(), Color.BLUE.getRGB(), 0f);
}

this.drawSlot(j, p_drawSelectionBox_1_, k, l, p_drawSelectionBox_3_, p_drawSelectionBox_4_);
Expand Down
Loading