Skip to content

Commit

Permalink
Removed useless Fonts
Browse files Browse the repository at this point in the history
Cleaned files
Embed CrossHair Module in HUD Module
display improvements
  • Loading branch information
zywl committed Dec 27, 2023
1 parent 8b37788 commit b1c0fef
Show file tree
Hide file tree
Showing 33 changed files with 202 additions and 811 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object ChatControl : Module() {
val chatClearValue = BoolValue("NoChatClear", true)
val chatCombineValue = BoolValue("ChatCombine", true)
val fontChatValue = BoolValue("FontChat", false)
val fontEpsilonValue = FloatValue("FontVectorEpsilon", 0.5f, 0f, 1.5f)
private val fontEpsilonValue = FloatValue("FontVectorEpsilon", 0.5f, 0f, 1.5f)
val chatRectValue = BoolValue("ChatBackGround", false)
val betterChatRectValue = BoolValue("BetterChatRect", false)
val chatAnimValue = BoolValue("ChatAnimation", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,49 @@ import net.ccbluex.liquidbounce.event.ScreenEvent
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.ccbluex.liquidbounce.features.module.ModuleInfo
import net.ccbluex.liquidbounce.ui.cape.GuiCapeManager.height
import net.ccbluex.liquidbounce.ui.clickgui.ClickGUIModule.colorBlueValue
import net.ccbluex.liquidbounce.ui.clickgui.ClickGUIModule.colorGreenValue
import net.ccbluex.liquidbounce.ui.clickgui.ClickGUIModule.colorRedValue
import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner
import net.ccbluex.liquidbounce.utils.render.ColorUtils
import net.ccbluex.liquidbounce.ui.client.hud.element.elements.ColorManager
import net.ccbluex.liquidbounce.utils.render.EaseUtils
import net.ccbluex.liquidbounce.utils.render.RenderUtils
import net.ccbluex.liquidbounce.value.BoolValue
import net.ccbluex.liquidbounce.value.FloatValue
import net.ccbluex.liquidbounce.value.IntegerValue
import net.ccbluex.liquidbounce.value.ListValue
import net.minecraft.client.gui.GuiChat
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.util.MathHelper
import net.minecraft.util.ResourceLocation
import net.minecraft.client.gui.Gui
import java.awt.Color
import java.util.*

@ModuleInfo(name = "HUD", category = ModuleCategory.CLIENT, array = false, defaultOn = true)
object HUD : Module() {

// UI EFFECT
val buttonShadowValue = BoolValue("ShadowButton", true)
val UiShadowValue = ListValue("UIEffectMode", arrayOf("Shadow", "Glow", "None"), "Shadow")

val shadowValue = ListValue("TextShadowMode", arrayOf("LiquidBounce", "Outline", "Default", "Autumn"), "Default")
private val rainbowMode = ListValue("ColorMode", arrayOf("Rainbow", "Light Rainbow", "Static", "Double Color", "Default"), "Light Rainbow")
val movingcolors = BoolValue("MovingColors", false)
val inventoryParticle = BoolValue("InventoryParticle", false)
val hueInterpolation = BoolValue("hueInterpolation", false)
val blurValue = BoolValue("Blur", false)
val HealthValue = BoolValue("Health", true)
val waterMark = BoolValue("Watermark", true)
val arrayListValue = BoolValue("ArrayListAnimation", true)
private val uiEffectValue = BoolValue("UIEffect", true)
val buttonShadowValue = BoolValue("ShadowButton", true).displayable { uiEffectValue.get() }
val UiShadowValue = ListValue("UIEffectMode", arrayOf("Shadow", "Glow", "None"), "Shadow").displayable { uiEffectValue.get() }
val inventoryParticle = BoolValue("InventoryParticle", false).displayable { uiEffectValue.get() }

// CAMERA
private val viewValue = BoolValue("BetterView", true)
val smoothCamera = BoolValue("Smooth", true).displayable { viewValue.get() }
val cameraPositionValue = BoolValue("CameraPosition", false).displayable { viewValue.get() }
val cameraPositionYawValue = FloatValue("Yaw", 10F, -50F, 50F).displayable { cameraPositionValue.get() }
val cameraPositionPitchValue = FloatValue("Pitch", 10F, -50F, 50F).displayable { cameraPositionValue.get() }
val cameraPositionFovValue = FloatValue("DistanceFov", 4F, 1F, 50F).displayable { cameraPositionValue.get() }

// ArrayList
private val arrayList = BoolValue("ArrayList", true)
val shadowValue = ListValue("TextShadowMode", arrayOf("LiquidBounce", "Outline", "Default", "Autumn"), "Default").displayable { arrayList.get() }
private val arrayListValue = BoolValue("ArrayListAnimation", true).displayable { arrayList.get() }
val arraylistXAxisAnimSpeedValue = IntegerValue("ArraylistXAxisAnimSpeed", 10, 5, 20).displayable { arrayListValue.get() }
val arraylistXAxisAnimTypeValue = EaseUtils.getEnumEasingList("ArraylistXAxisAnimType").displayable { arrayListValue.get() }
val arraylistXAxisAnimOrderValue = EaseUtils.getEnumEasingOrderList("ArraylistXAxisHotbarAnimOrder").displayable { !arraylistXAxisAnimTypeValue.equals("NONE") }
val arraylistYAxisAnimSpeedValue = IntegerValue("ArraylistYAxisAnimSpeed", 10, 5, 20).displayable { arrayListValue.get() }
val arraylistYAxisAnimTypeValue = EaseUtils.getEnumEasingList("ArraylistYAxisAnimType")
val arraylistYAxisAnimOrderValue = EaseUtils.getEnumEasingOrderList("ArraylistYAxisHotbarAnimOrder").displayable { !arraylistYAxisAnimTypeValue.equals("NONE") }

private val waterMark = BoolValue("Watermark", true)

private val crossHairValue = BoolValue("CrossHair", true)

/**
* Renders the HUD.
*/
Expand All @@ -61,18 +64,43 @@ object HUD : Module() {
if (mc.currentScreen is GuiHudDesigner) return
FDPClient.hud.render(false, event.partialTicks)
if (waterMark.get()) renderWatermark()
if (HealthValue.get()) mc.fontRendererObj.drawStringWithShadow(
MathHelper.ceiling_float_int(mc.thePlayer.health).toString(),
(width / 2 - 4).toFloat(), (height / 2 - 13).toFloat(), if (mc.thePlayer.health <= 15) Color(255, 0, 0).rgb else Color(0, 255, 0).rgb)
GlStateManager.resetColor()

if (crossHairValue.get()) {
val lrs1 = RenderUtils.width()
val lrs2 = RenderUtils.height()

if (mc.thePlayer.isSprinting) {
drawCrosshair(lrs1 / 2 - 3 - 3, lrs2 / 2, lrs1 / 2 + 6 - 8, lrs2 / 2 + 2 - 1)
drawCrosshair(lrs1 / 2 + 6 - 3, lrs2 / 2, lrs1 / 2 + 10 - 3, lrs2 / 2 + 1)
drawCrosshair(lrs1 / 2, lrs2 / 2 - 6, lrs1 / 2 + 1, lrs2 / 2 - 2)
drawCrosshair(lrs1 / 2, lrs2 / 2 + 6 - 3, lrs1 / 2 + 1, lrs2 / 2 + 7)
} else {
drawCrosshair(lrs1 / 2 + 10 - 19, lrs2 / 2, lrs1 / 2 + 5 - 10, lrs2 / 2 + 1)
drawCrosshair(lrs1 / 2, lrs2 / 2 - 9, lrs1 / 2 + 1, lrs2 / 2 - 5)
drawCrosshair(lrs1 / 2, lrs2 / 2 + 2 + 4, lrs1 / 2 + 1, lrs2 / 2 + 10)
}
drawCrosshair(lrs1 / 2, lrs2 / 2, lrs1 / 2 + 1, lrs2 / 2 + 1)
}

}

private fun drawCrosshair(x1: Int, y1: Int, x2: Int, y2: Int) {
val borderColor = Color(0, 0, 0, 255).rgb
val backgroundColor = Color(255, 255, 255, 255).rgb
val borderWidth = 1
val borderAlpha = 0.7582394f

Gui.drawRect(x1, y1, x2, y2, backgroundColor)
RenderUtils.drawBorderedRect((x1 - borderWidth).toDouble(), y1.toDouble(), x1.toDouble(), y2.toDouble(), borderAlpha.toDouble(), borderColor, Color(255, 190, 255, 0).rgb)
RenderUtils.drawBorderedRect(x2.toDouble(), y1.toDouble(), (x2 + borderWidth).toDouble(), y2.toDouble(), borderAlpha.toDouble(), borderColor, Color(255, 190, 255, 0).rgb)
}

/**
* Renders the watermark.
*/
private fun renderWatermark() {
var width = 3
val colors = getClientColors()
val colors = ColorManager.getClientColors()
mc.fontRendererObj.drawStringWithShadow(
"FDP",
3.0f,
Expand All @@ -89,14 +117,12 @@ object HUD : Module() {
}

@EventTarget
fun onScreen(event: ScreenEvent) {
fun onScreen(event: ScreenEvent?) {
if (mc.theWorld == null || mc.thePlayer == null) {
return
}

if (state && blurValue.get() && !mc.entityRenderer.isShaderActive && event.guiScreen != null && !(event.guiScreen is GuiChat || event.guiScreen is GuiHudDesigner)) {
mc.entityRenderer.loadShader(ResourceLocation("fdpclient/blur.json"))
} else if (mc.entityRenderer.shaderGroup != null && mc.entityRenderer.shaderGroup!!.shaderGroupName.contains("fdpclient/blur.json")) {
if (state && mc.entityRenderer.isShaderActive) {
mc.entityRenderer.stopUseShader()
}
}
Expand All @@ -106,34 +132,4 @@ object HUD : Module() {
FDPClient.hud.handleKey('a', event.key)
}

fun getClientColors(): Array<Color> {
val firstColor: Color
val secondColor: Color
when (rainbowMode.get().lowercase(Locale.getDefault())) {
"light rainbow" -> {
firstColor = ColorUtils.rainbowc(15, 1, .6f, 1F, 1F)!!
secondColor = ColorUtils.rainbowc(15, 40, .6f, 1F, 1F)!!
}
"rainbow" -> {
firstColor = ColorUtils.rainbowc(15, 1, 1F, 1F, 1F)!!
secondColor = ColorUtils.rainbowc(15, 40, 1F, 1F, 1F)!!
}
"double color" -> {
firstColor =
ColorUtils.interpolateColorsBackAndForth(15, 0, Color.PINK, Color.BLUE, hueInterpolation.get())!!
secondColor =
ColorUtils.interpolateColorsBackAndForth(15, 90, Color.PINK, Color.BLUE, hueInterpolation.get())!!
}
"static" -> {
firstColor = Color(colorRedValue.get(), colorGreenValue.get(), colorBlueValue.get())
secondColor = firstColor
}
else -> {
firstColor = Color(-1)
secondColor = Color(-1)
}
}
return arrayOf(firstColor, secondColor)
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ import net.minecraft.util.ResourceLocation
import org.lwjgl.opengl.GL11
import java.awt.Color

@ModuleInfo(name = "VanillaTweaks", description = "Allows you to see through walls in third person view.", category = ModuleCategory.VISUAL)
@ModuleInfo(name = "VanillaTweaks", description = "Vanilla Utilities.", category = ModuleCategory.VISUAL)
object VanillaTweaks : Module() {
//
var alpha2 = 0
//

private var alpha2 = 0

// NoAchievements
val noAchievements = BoolValue("NoAchievements", false)

// CameraClip
val cameraClipValue = BoolValue("CameraClip", false)

val hurtCam = BoolValue("HurtCam", false)
// HurtCam
private val hurtCam = BoolValue("HurtCam", false)
val modeValue = ListValue("Mode", arrayOf("Vanilla", "Cancel", "FPS"), "Vanilla").displayable { hurtCam.get() }
private val colorRedValue = IntegerValue("R", 255, 0, 255).displayable { modeValue.equals("FPS") }
private val colorGreenValue = IntegerValue("G", 0, 0, 255).displayable { modeValue.equals("FPS") }
Expand All @@ -43,7 +48,7 @@ object VanillaTweaks : Module() {
private val fpsHeightValue = IntegerValue("FPSHeight", 25, 10, 50).displayable { modeValue.equals("FPS") }

//AntiBlind
val antiBlindValue = BoolValue("AntiBlind", false)
private val antiBlindValue = BoolValue("AntiBlind", false)
val confusionEffectValue = BoolValue("Confusion", false).displayable { antiBlindValue.get() }
val pumpkinEffectValue = BoolValue("Pumpkin", true).displayable { antiBlindValue.get() }
val fireEffectValue = FloatValue("FireAlpha", 0.3f, 0f, 1f).displayable { antiBlindValue.get() }
Expand All @@ -52,7 +57,7 @@ object VanillaTweaks : Module() {
val bossHealthValue = BoolValue("Boss-Health", true).displayable { antiBlindValue.get() }

//NoFOV
val noFov = BoolValue("NoFOV", false)
private val noFov = BoolValue("NoFOV", false)
val fovValue = FloatValue("FOV", 1f, 0f, 1.5f).displayable { noFov.get() }

//WorldColor
Expand All @@ -71,22 +76,15 @@ object VanillaTweaks : Module() {
//CustomFog
val customFog = BoolValue("CustomFog", false)
val customFogDistance = FloatValue("FogDistance", 0.10f, 0.001f, 2.0f).displayable { customFog.get() }
val customFogRValue = IntegerValue("FogRed", 255, 0, 255) { customFog.get() }
val customFogGValue = IntegerValue("FogGreen", 255, 0, 255) { customFog.get() }
val customFogBValue = IntegerValue("FogBlue", 255, 0, 255) { customFog.get() }

//CameraPosition
val smoothCamera = BoolValue("Smooth", false)
val cameraPositionValue = BoolValue("CameraPosition", false)
val cameraPositionYawValue = FloatValue("Yaw", 10F, -50F, 50F).displayable { cameraPositionValue.get() }
val cameraPositionPitchValue = FloatValue("Pitch", 10F, -50F, 50F).displayable { cameraPositionValue.get() }
val cameraPositionFovValue = FloatValue("DistanceFov", 4F, 1F, 50F).displayable { cameraPositionValue.get() }
private val customFogRValue = IntegerValue("FogRed", 255, 0, 255) { customFog.get() }
private val customFogGValue = IntegerValue("FogGreen", 255, 0, 255) { customFog.get() }
private val customFogBValue = IntegerValue("FogBlue", 255, 0, 255) { customFog.get() }

//FPSHurtCam
private val fpsHurtCam = BoolValue("FPSHurtCam", false)
val hurtcamColorRValue = IntegerValue("HurtColorRed", 255, 0, 255) { fpsHurtCam.get() }
val hurtcamColorGValue = IntegerValue("HurtColorGreen", 255, 0, 255) { fpsHurtCam.get() }
val hurtcamColorBValue = IntegerValue("HurtColorBlue", 255, 0, 255) { fpsHurtCam.get() }
private val hurtcamColorRValue = IntegerValue("HurtColorRed", 255, 0, 255) { fpsHurtCam.get() }
private val hurtcamColorGValue = IntegerValue("HurtColorGreen", 255, 0, 255) { fpsHurtCam.get() }
private val hurtcamColorBValue = IntegerValue("HurtColorBlue", 255, 0, 255) { fpsHurtCam.get() }
private val colorModeValue = ListValue("Color", arrayOf("Custom", "Rainbow", "Slowly", "Fade"), "Custom").displayable { fpsHurtCam.get() }
private val saturationValue = FloatValue("Saturation", 1f, 0f, 1f).displayable { fpsHurtCam.get() }
private val brightnessValue = FloatValue("Brightness", 1f, 0f, 1f).displayable { fpsHurtCam.get() }
Expand Down Expand Up @@ -161,6 +159,8 @@ object VanillaTweaks : Module() {

@EventTarget
fun onTick(event: TickEvent) {

mc.guiAchievement.clearAchievements()
try {

if (mc.thePlayer != null) {
Expand All @@ -186,6 +186,7 @@ object VanillaTweaks : Module() {
}
}

@JvmStatic
fun drawGradientSidewaysV(left: Double, top: Double, right: Double, bottom: Double, col1: Int, col2: Int) {
if (fpsHurtCam.get()) {
val f = (col1 shr 24 and 255).toFloat() / 255.0f
Expand Down Expand Up @@ -219,13 +220,13 @@ object VanillaTweaks : Module() {
}
}
fun getColor(index: Int): Color {
var colorModeValue = colorModeValue.get()
var colorRedValue = hurtcamColorRValue.get()
var colorGreenValue = hurtcamColorGValue.get()
var colorBlueValue = hurtcamColorBValue.get()
var mixerSecondsValue = mixerSecondsValue.get()
var saturationValue = saturationValue.get()
var brightnessValue = brightnessValue.get()
val colorModeValue = colorModeValue.get()
val colorRedValue = hurtcamColorRValue.get()
val colorGreenValue = hurtcamColorGValue.get()
val colorBlueValue = hurtcamColorBValue.get()
val mixerSecondsValue = mixerSecondsValue.get()
val saturationValue = saturationValue.get()
val brightnessValue = brightnessValue.get()
return when (colorModeValue) {
"Custom" -> Color(colorRedValue, colorGreenValue, colorBlueValue)
"Rainbow" -> Color(
Expand All @@ -237,7 +238,7 @@ object VanillaTweaks : Module() {
)
)

"Slowly" -> ColorUtils.slowlyRainbow(System.nanoTime(), index, saturationValue, brightnessValue)!!
"Slowly" -> ColorUtils.slowlyRainbow(System.nanoTime(), index, saturationValue, brightnessValue)
else -> ColorUtils.fade(Color(colorRedValue, colorGreenValue, colorBlueValue), index, 100)
}
}
Expand Down
Loading

0 comments on commit b1c0fef

Please sign in to comment.