Skip to content

Commit

Permalink
hm
Browse files Browse the repository at this point in the history
  • Loading branch information
opZywl committed Dec 9, 2023
1 parent a4f759a commit fb8fa47
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import net.ccbluex.liquidbounce.handler.network.AutoReconnect
import net.ccbluex.liquidbounce.handler.network.ClientFixes
import net.ccbluex.liquidbounce.handler.network.ProxyManager
import net.ccbluex.liquidbounce.ui.client.GuiBackground
import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager
import net.ccbluex.liquidbounce.ui.altmanager.GuiAltManager
import java.io.File
import java.net.Proxy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import net.ccbluex.liquidbounce.event.Render2DEvent
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.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.ccbluex.liquidbounce.ui.font.Fonts
import net.ccbluex.liquidbounce.utils.render.Animation
import net.ccbluex.liquidbounce.utils.render.BlurUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.client.button

import net.ccbluex.liquidbounce.ui.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import java.awt.Color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.client.button;

import net.ccbluex.liquidbounce.ui.font.CFontRenderer;
import net.ccbluex.liquidbounce.ui.font.FontLoaders;
import net.ccbluex.liquidbounce.ui.font.cf.CFontRenderer;
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.ccbluex.liquidbounce.utils.timer.MSTimer;
import net.minecraft.client.Minecraft;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package net.ccbluex.liquidbounce.features.module.modules.client.button

import net.ccbluex.liquidbounce.utils.render.EaseUtils.easeInOutQuad
import net.ccbluex.liquidbounce.utils.render.RenderUtils
import net.ccbluex.liquidbounce.ui.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import java.awt.Color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.ccbluex.liquidbounce.FDPClient;
import net.ccbluex.liquidbounce.handler.network.ClientFixes;
import net.ccbluex.liquidbounce.handler.network.AutoReconnect;
import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager;
import net.ccbluex.liquidbounce.ui.altmanager.GuiAltManager;
import net.ccbluex.liquidbounce.utils.ServerUtils;
import net.ccbluex.liquidbounce.utils.SessionUtils;
import net.ccbluex.liquidbounce.utils.extensions.RendererExtensionKt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import net.ccbluex.liquidbounce.FDPClient;
import net.ccbluex.liquidbounce.features.module.modules.client.HUD;
import net.ccbluex.liquidbounce.features.module.modules.client.ChatControl;
import net.ccbluex.liquidbounce.ui.font.CFontRenderer;
import net.ccbluex.liquidbounce.ui.font.FontLoaders;
import net.ccbluex.liquidbounce.ui.font.cf.CFontRenderer;
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders;
import net.ccbluex.liquidbounce.injection.access.StaticStorage;
import net.ccbluex.liquidbounce.utils.render.EaseUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import net.ccbluex.liquidbounce.FDPClient;
import net.ccbluex.liquidbounce.features.module.modules.client.HUD;
import net.ccbluex.liquidbounce.ui.font.FontLoaders;
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders;
import net.ccbluex.liquidbounce.ui.client.GuiBackground;
import net.ccbluex.liquidbounce.utils.particles.ParticleUtils;
import net.minecraft.client.Minecraft;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.ui.client.altmanager
package net.ccbluex.liquidbounce.ui.altmanager

import me.liuli.elixir.account.MinecraftAccount
import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.event.SessionEvent
import net.ccbluex.liquidbounce.ui.client.altmanager.sub.GuiAdd
import net.ccbluex.liquidbounce.ui.client.altmanager.sub.GuiDirectLogin
import net.ccbluex.liquidbounce.ui.client.altmanager.sub.GuiMicrosoftLoginPending
import net.ccbluex.liquidbounce.ui.altmanager.sub.GuiAdd
import net.ccbluex.liquidbounce.ui.altmanager.sub.GuiDirectLogin
import net.ccbluex.liquidbounce.ui.altmanager.sub.GuiMicrosoftLoginPending
import net.ccbluex.liquidbounce.ui.i18n.LanguageManager
import net.ccbluex.liquidbounce.utils.extensions.drawCenteredString
import net.ccbluex.liquidbounce.utils.login.LoginUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.ui.client.altmanager.sub
package net.ccbluex.liquidbounce.ui.altmanager.sub

import me.liuli.elixir.manage.AccountSerializer
import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager
import net.ccbluex.liquidbounce.ui.altmanager.GuiAltManager
import net.ccbluex.liquidbounce.ui.elements.GuiPasswordField
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.gui.GuiScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.ui.client.altmanager.sub
package net.ccbluex.liquidbounce.ui.altmanager.sub

import me.liuli.elixir.manage.AccountSerializer
import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager
import net.ccbluex.liquidbounce.ui.altmanager.GuiAltManager
import net.ccbluex.liquidbounce.ui.elements.GuiPasswordField
import net.ccbluex.liquidbounce.ui.i18n.LanguageManager
import net.minecraft.client.gui.GuiButton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.ccbluex.liquidbounce.ui.client.altmanager.sub
package net.ccbluex.liquidbounce.ui.altmanager.sub

import me.liuli.elixir.account.MicrosoftAccount
import me.liuli.elixir.compat.OAuthServer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ object ClickGUIModule : Module() {
val maxElementsValue = IntegerValue("MaxElements", 20, 1, 35)
val backgroundValue = ListValue("Background", arrayOf("Default", "Gradient", "None"), "None")
val animationValue = ListValue("Animation", arrayOf("Bread", "Slide", "LiquidBounce", "Zoom", "Ziul", "None"), "Ziul")
val animSpeedValue = FloatValue("AnimSpeed", 1f, 0.01f, 5f)
val gradStartValue = IntegerValue("GradientStartAlpha", 255, 0, 255)
val gradEndValue = IntegerValue("GradientEndAlpha", 0, 0, 255)
val colorRainbow = BoolValue("Rainbow", true)
val colorRedValue = IntegerValue("R", 0, 0, 255).displayable { !colorRainbow.get() } as IntegerValue
val colorGreenValue = IntegerValue("G", 160, 0, 255).displayable { !colorRainbow.get() } as IntegerValue
Expand Down
55 changes: 24 additions & 31 deletions src/main/java/net/ccbluex/liquidbounce/ui/clickgui/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ public class ClickGui extends GuiScreen {
private Panel clickedPanel;
private int mouseX;
private int mouseY;
private double slide, progress = 0;

public long lastMS = System.currentTimeMillis();
private double slide, progress = 0;

public ClickGui() {
final int width = 100;
Expand All @@ -62,10 +61,10 @@ public void setupItems() {

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
if (progress < 1) progress = (float)(System.currentTimeMillis() - lastMS) / (500F / Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getAnimSpeedValue().get()); // fully fps async
if (progress < 1) progress += 0.1 * (1 - partialTicks);
else progress = 1;

switch (ClickGUIModule.INSTANCE.getAnimationValue().get().toLowerCase()) {
switch (Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).INSTANCE.getAnimationValue().get().toLowerCase()) {
case "liquidbounce":
case "ziul":
slide = EaseUtils.easeOutBack(progress);
Expand All @@ -87,29 +86,26 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {

final double scale = Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getScaleValue().get();

mouseX /= (int) scale;
mouseY /= (int) scale;
mouseX /= scale;
mouseY /= scale;

this.mouseX = mouseX;
this.mouseY = mouseY;

switch (Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getBackgroundValue().get()) {
switch (Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).INSTANCE.getBackgroundValue().get()) {
case "Default":
drawDefaultBackground();
break;
case "Gradient":
drawGradientRect(0, 0, width, height,
ColorUtils.reAlpha(ClickGUIModule.generateColor(), Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getGradEndValue().get()).getRGB(),
ColorUtils.reAlpha(ClickGUIModule.generateColor(), Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getGradStartValue().get()).getRGB());
drawGradientRect(0, 0, width, height, ColorUtils.reAlpha(ClickGUIModule.INSTANCE.generateColor(), 40).getRGB(), ClickGUIModule.INSTANCE.generateColor().getRGB());
break;
default:
break;
}

GlStateManager.disableAlpha();
GlStateManager.enableAlpha();
drawDefaultBackground();

switch (Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getAnimationValue().get().toLowerCase()) {
switch (Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).INSTANCE.getAnimationValue().get().toLowerCase()) {
case "bread":
GlStateManager.translate(0, (1.0 - slide) * height * 2.0, 0);
GlStateManager.scale(scale, scale + (1.0 - slide) * 2.0, scale);
Expand Down Expand Up @@ -151,15 +147,15 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
if (Mouse.hasWheel()) {
int wheel = Mouse.getDWheel();
boolean handledScroll = false;

for (int i = panels.size() - 1; i >= 0; i--)
if (panels.get(i).handleScroll(mouseX, mouseY, wheel)) {
handledScroll = true;
break;
}
handledScroll = true;
break;
}

if (!handledScroll)
handleScroll(wheel);
handleScroll(wheel);
}

GlStateManager.disableLighting();
Expand All @@ -184,24 +180,21 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {

super.drawScreen(mouseX, mouseY, partialTicks);
}

private void handleScroll(final int wheel) {
if (wheel == 0)
return;

for(final Panel panel : panels)
panel.setY(panel.getY() + wheel);
panel.setY(panel.getY() + wheel);
}

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
final double scale = Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getScaleValue().get();

mouseX /= (int) scale;
mouseY /= (int) scale;

mouseX /= (int) scale;
mouseY /= (int) scale;
mouseX /= scale;
mouseY /= scale;

for (final Panel panel : panels) {
panel.mouseClicked(mouseX, mouseY, mouseButton);
Expand All @@ -228,8 +221,8 @@ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOEx
protected void mouseReleased(int mouseX, int mouseY, int state) {
final double scale = Objects.requireNonNull(FDPClient.moduleManager.getModule(ClickGUIModule.class)).getScaleValue().get();

mouseX /= (int) scale;
mouseY /= (int) scale;
mouseX /= scale;
mouseY /= scale;

for (Panel panel : panels) {
panel.mouseReleased(mouseX, mouseY, state);
Expand Down Expand Up @@ -273,11 +266,11 @@ public void updateScreen() {
public void onGuiClosed() {
FDPClient.fileManager.saveConfig(modernuiLaunchOption.getClickGuiConfig());
slide = 0;
progress = 0;
progress = 0;
}

@Override
public boolean doesGuiPauseGame() {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.ccbluex.liquidbounce.ui.clickgui.elements.ModuleElement;
import net.ccbluex.liquidbounce.ui.client.gui.options.modernuiLaunchOption;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import org.jetbrains.annotations.NotNull;

import java.io.File;

Expand All @@ -21,7 +20,7 @@ public ClickGuiConfig(final File file) {
}

@Override
public void loadConfig(@NotNull String config) {
public void loadConfig(String config) {
final JsonElement jsonElement = new JsonParser().parse(config);

if (jsonElement instanceof JsonNull)
Expand Down Expand Up @@ -64,7 +63,6 @@ public void loadConfig(@NotNull String config) {
}
}

@NotNull
@Override
public String saveConfig() {
final JsonObject jsonObject = new JsonObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package net.ccbluex.liquidbounce.ui.client.gui;

import net.ccbluex.liquidbounce.FDPClient;
import net.ccbluex.liquidbounce.ui.font.FontLoaders;
import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager;
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders;
import net.ccbluex.liquidbounce.ui.altmanager.GuiAltManager;
import net.ccbluex.liquidbounce.utils.MainMenuButton;
import net.ccbluex.liquidbounce.utils.render.ParticleUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package net.ccbluex.liquidbounce.ui.client.hud.element.elements

import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.ui.font.CFontRenderer
import net.ccbluex.liquidbounce.ui.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.CFontRenderer
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner
import net.ccbluex.liquidbounce.ui.client.hud.element.*
import net.ccbluex.liquidbounce.utils.render.RenderUtils
Expand Down Expand Up @@ -385,22 +385,26 @@ class Notification(
if(nTypeError){
RenderUtils.drawRoundedRect(-x + 9 + textLength, 1f, kek - 1, -28F - 1, 0F, Color(115,69,75).rgb)
RenderUtils.drawRoundedRect(-x + 8 + textLength, 0f, kek, -28F, 0F, Color(89,61,65).rgb)
FontLoaders.M16.DisplayFont2(FontLoaders.M16,title, -x + 6, -25F, Color(249,130,108).rgb, true)
FontLoaders.M16.DisplayFont2(
FontLoaders.M16,title, -x + 6, -25F, Color(249,130,108).rgb, true)
}
if(nTypeInfo) {
RenderUtils.drawRoundedRect(-x + 9 + textLength, 1f, kek - 1, -28F - 1, 0F, Color(70,94,115).rgb)
RenderUtils.drawRoundedRect(-x + 8 + textLength, 0f, kek, -28F, 0F, Color(61,72,87).rgb)
FontLoaders.M16.DisplayFont2(FontLoaders.M16,title, -x + 6, -25F, Color(119,145,147).rgb, true)
FontLoaders.M16.DisplayFont2(
FontLoaders.M16,title, -x + 6, -25F, Color(119,145,147).rgb, true)
}
if(nTypeSuccess){
RenderUtils.drawRoundedRect(-x + 9 + textLength, 1f, kek - 1, -28F - 1, 0F, Color(67,104,67).rgb)
RenderUtils.drawRoundedRect(-x + 8 + textLength, 0f, kek, -28F, 0F, Color(55,78,55).rgb)
FontLoaders.M16.DisplayFont2(FontLoaders.M16,title, -x + 6, -25F, Color(10,142,2).rgb, true)
FontLoaders.M16.DisplayFont2(
FontLoaders.M16,title, -x + 6, -25F, Color(10,142,2).rgb, true)
}
if(nTypeWarning){
RenderUtils.drawRoundedRect(-x + 9 + textLength, 1f, kek - 1, -28F - 1, 0F, Color(103,103,63).rgb)
RenderUtils.drawRoundedRect(-x + 8 + textLength, 0f, kek, -28F, 0F, Color(80,80,57).rgb)
FontLoaders.M16.DisplayFont2(FontLoaders.M16,title, -x + 6, -25F, Color(175,163,0).rgb, true)
FontLoaders.M16.DisplayFont2(
FontLoaders.M16,title, -x + 6, -25F, Color(175,163,0).rgb, true)
}

Stencil.erase(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package net.ccbluex.liquidbounce.ui.client.hud.element.elements

import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.features.value.*
import net.ccbluex.liquidbounce.ui.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner
import net.ccbluex.liquidbounce.ui.client.hud.element.Border
import net.ccbluex.liquidbounce.ui.client.hud.element.Element
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.ccbluex.liquidbounce.ui.client.keybind

import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.ui.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.ccbluex.liquidbounce.ui.client.other.PopUI
import net.ccbluex.liquidbounce.utils.render.RenderUtils
import net.minecraft.client.gui.GuiScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package net.ccbluex.liquidbounce.ui.client.keybind
import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.handler.macro.Macro
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.ui.font.FontLoaders
import net.ccbluex.liquidbounce.ui.font.cf.FontLoaders
import net.ccbluex.liquidbounce.ui.font.Fonts
import net.ccbluex.liquidbounce.ui.i18n.LanguageManager
import net.ccbluex.liquidbounce.utils.MinecraftInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import net.minecraft.util.ResourceLocation
import org.lwjgl.opengl.GL11.*
import java.awt.Color


object ToolDropdown {

private var fullHeight = 0F
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://github.com/SkidderMC/FDPClient/
*/

package net.ccbluex.liquidbounce.ui.font;
package net.ccbluex.liquidbounce.ui.font.cf;

import net.minecraft.client.renderer.texture.DynamicTexture;
import org.lwjgl.opengl.GL11;
Expand Down
Loading

0 comments on commit fb8fa47

Please sign in to comment.