Skip to content

Commit

Permalink
refactor/feat: ClickGUI Improvised code and correction of issues caus…
Browse files Browse the repository at this point in the history
…ed by animations and loading
  • Loading branch information
opZywl committed Dec 8, 2024
1 parent c53a3a0 commit 223c5c5
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.util
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.animations.impl.DecelerateAnimation
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal.Main
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal.Screen
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal.Utils
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.render.DrRenderUtils
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.render.StencilUtil
import net.ccbluex.liquidbounce.ui.font.fontmanager.impl.Fonts
import net.ccbluex.liquidbounce.utils.MinecraftInstance.Companion.mc
import net.ccbluex.liquidbounce.utils.extensions.roundToHalf
import net.minecraft.client.gui.ScaledResolution
import java.awt.Color
Expand Down Expand Up @@ -102,7 +102,7 @@ class MainScreen(private val category: Category) : Screen {
val allowedHeight = if (scrollMode == "Value") {
clickHeight.toFloat()
} else {
val sr = ScaledResolution(Utils.mc)
val sr = ScaledResolution(mc)
2 * sr.scaledHeight / 3f
}
Main.allowedClickGuiHeight = allowedHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@
* 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.clickgui.style.styles.fdpdropdown.impl;
package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.impl

import net.minecraft.client.Minecraft;
abstract class Component {

public abstract class Component {
abstract fun initGui()

public Minecraft mc = Minecraft.getMinecraft();
abstract fun keyTyped(typedChar: Char, keyCode: Int)

abstract public void initGui();
abstract fun drawScreen(mouseX: Int, mouseY: Int)

public abstract void keyTyped(char typedChar, int keyCode);
abstract fun mouseClicked(mouseX: Int, mouseY: Int, button: Int)

abstract public void drawScreen(int mouseX, int mouseY);

abstract public void mouseClicked(int mouseX, int mouseY, int button);

abstract public void mouseReleased(int mouseX, int mouseY, int state);
abstract fun mouseReleased(mouseX: Int, mouseY: Int, state: Int)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,22 @@
* 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.clickgui.style.styles.fdpdropdown.utils.normal;
package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal

import net.ccbluex.liquidbounce.features.module.Category;
import net.ccbluex.liquidbounce.features.module.Module;
import net.ccbluex.liquidbounce.features.module.ModuleManager;
import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleManager

import java.util.List;
import java.util.stream.Collectors;
object Main {
var categoryCount: Int = 0

public class Main{
var reloadModules: Boolean = false

public static int categoryCount;
@JvmField
var allowedClickGuiHeight: Float = 300f

public static boolean reloadModules;

public static float allowedClickGuiHeight = 300;

public static List<Module> getModulesInCategory(Category c, ModuleManager moduleManager) {
return moduleManager.getModules().stream().filter(m -> m.getCategory() == c).collect(Collectors.toList());
fun getModulesInCategory(category: Category, moduleManager: ModuleManager): List<Module> {
return moduleManager.modules
.filter { module -> module.category == category }
}

}
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
* Repository: https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal;

public interface Screen extends Utils {
package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal

void initGui();

void keyTyped(char typedChar, int keyCode);
/**
* Interface representing a basic screen structure in the client GUI.
* It defines methods for handling initialization, input events, and rendering.
*/
interface Screen {
/**
* Initializes the GUI components and prepares the screen for rendering.
*
*/
fun initGui()

void drawScreen(int mouseX, int mouseY);
/**
* Handles key input events.
*
*/
fun keyTyped(typedChar: Char, keyCode: Int)

void mouseClicked(int mouseX, int mouseY, int button);
/**
* Renders the screen and its components.
*
*/
fun drawScreen(mouseX: Int, mouseY: Int)

void mouseReleased(int mouseX, int mouseY, int state);
/**
* Handles mouse click events.
*
*/
fun mouseClicked(mouseX: Int, mouseY: Int, button: Int)

}
/**
* Handles mouse release events.
*
*/
fun mouseReleased(mouseX: Int, mouseY: Int, state: Int)
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.render;

import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.animations.Animation;
import net.ccbluex.liquidbounce.ui.client.clickgui.style.styles.fdpdropdown.utils.normal.Utils;
import net.ccbluex.liquidbounce.utils.MinecraftInstance;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
Expand All @@ -18,7 +18,7 @@

import static org.lwjgl.opengl.GL11.*;

public class DrRenderUtils implements Utils {
public class DrRenderUtils extends MinecraftInstance {
/**
* Draws a textured rectangle at z = 0. Args: x, y, u, v, width, height, textureWidth, textureHeight
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import java.awt.Color
*
* Allows to move and customize minecraft scoreboard
*/
@ElementInfo(name = "Scoreboard", force = true)
@ElementInfo(name = "Scoreboard")
class ScoreboardElement(
x: Double = 5.0, y: Double = 0.0, scale: Float = 1F,
side: Side = Side(Side.Horizontal.RIGHT, Side.Vertical.MIDDLE)
Expand Down

0 comments on commit 223c5c5

Please sign in to comment.