Skip to content

Commit

Permalink
feats(legacy): Modern TargetHUD + Gradient Colors to KillAura Circle (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
RtxOP authored Feb 19, 2025
1 parent 0cba697 commit 8817bf7
Show file tree
Hide file tree
Showing 12 changed files with 472 additions and 352 deletions.
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

0 comments on commit 8817bf7

Please # to comment.