From 482105a8484cc022f6aa54338e0d4b35ea4f2cf8 Mon Sep 17 00:00:00 2001 From: opZywl Date: Sat, 18 Nov 2023 19:34:09 +0000 Subject: [PATCH] why spam this ?? --- .../ui/client/gui/ClickGUIModule.kt | 25 +- .../client/gui/clickgui/fonts/logo/info.java | 6 - .../gui/clickgui/style/styles/BjurStyle.java | 395 ------------ .../style/styles/Slight/SlightUI.java | 5 + .../style/styles/dropdown/DropdownGUI.java | 6 + .../style/styles/light/LightClickGUI.java | 7 +- .../style/styles/novoline/ClickyUI.java | 6 + .../style/styles/onetap/OtcClickGUi.java | 8 + .../style/styles/tenacity/MainScreen.java | 174 ------ .../styles/tenacity/SideGui/GuiPanel.java | 25 - .../styles/tenacity/SideGui/SideGui.java | 226 ------- .../styles/tenacity/TenacityClickGUI.java | 134 ---- .../style/styles/tenacity/impl/Component.java | 22 - .../styles/tenacity/impl/ModuleRect.java | 166 ----- .../tenacity/impl/SettingComponents.java | 570 ------------------ 15 files changed, 35 insertions(+), 1740 deletions(-) delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/BjurStyle.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/MainScreen.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/GuiPanel.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/SideGui.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/TenacityClickGUI.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/Component.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/ModuleRect.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/SettingComponents.java diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/ClickGUIModule.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/ClickGUIModule.kt index c334975d52..d9d582505e 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/ClickGUIModule.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/ClickGUIModule.kt @@ -22,7 +22,6 @@ import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.light.LightC import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.newVer.NewUi import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.novoline.ClickyUI import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.onetap.OtcClickGUi -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.tenacity.TenacityClickGUI import net.ccbluex.liquidbounce.ui.client.gui.options.modernuiLaunchOption import net.ccbluex.liquidbounce.utils.render.ColorUtils.rainbow import net.minecraft.network.play.server.S2EPacketCloseWindow @@ -59,10 +58,6 @@ object ClickGUIModule : Module() { } } - val backback = BoolValue("Background Accent", true) - val scrollMode = ListValue("Scroll Mode", arrayOf("Screen Height", "Value"), "Value") - val colormode = ListValue("Setting Accent", arrayOf("White", "Color"), "Color") - val clickHeight = IntegerValue("Tab Height", 250, 100, 500) val scaleValue = FloatValue("Scale", 0.70f, 0.7f, 2f) val maxElementsValue = IntegerValue("MaxElements", 20, 1, 35) val backgroundValue = ListValue("Background", arrayOf("Default", "Gradient", "None"), "None") @@ -75,24 +70,14 @@ object ClickGUIModule : Module() { val getClosePrevious = BoolValue("ClosePrevious", false) val disp = BoolValue("DisplayValue", true) - private var lightClickGUI = LightClickGUI() - private var otcGui = OtcClickGUi() - private var novoline = ClickyUI() - private var slight = SlightUI() - private var dropdown = DropdownGUI() - private var tena = TenacityClickGUI() - private var bjur = BjurStyle() - override fun onEnable() { when { - styleValue.get().contains("Novoline") -> mc.displayGuiScreen(novoline) - styleValue.get().contains("OneTap") -> mc.displayGuiScreen(otcGui) - styleValue.get().contains("Light") -> mc.displayGuiScreen(lightClickGUI) - styleValue.get().equals("Classic", ignoreCase = true) -> mc.displayGuiScreen(dropdown) - styleValue.get().equals("Tenacity", ignoreCase = true) -> mc.displayGuiScreen(tena) + styleValue.get().contains("Novoline") -> mc.displayGuiScreen(ClickyUI.getInstance()) + styleValue.get().contains("OneTap") -> mc.displayGuiScreen(OtcClickGUi.getInstance()) + styleValue.get().contains("Light") -> mc.displayGuiScreen(LightClickGUI.getInstance()) + styleValue.get().equals("Classic", ignoreCase = true) -> mc.displayGuiScreen(DropdownGUI.getInstance()) styleValue.get().equals("LB+", ignoreCase = true) -> mc.displayGuiScreen(NewUi.getInstance()) - styleValue.get().equals("Bjur", ignoreCase = true) -> mc.displayGuiScreen(bjur) - styleValue.get().contains("Slight") -> mc.displayGuiScreen(slight) + styleValue.get().contains("Slight") -> mc.displayGuiScreen(SlightUI.getInstance()) else -> { updateStyle() mc.displayGuiScreen(modernuiLaunchOption.clickGui) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/fonts/logo/info.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/fonts/logo/info.java index 2e7c4a54c6..c90e269f68 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/fonts/logo/info.java +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/fonts/logo/info.java @@ -7,18 +7,12 @@ import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.api.FontManager; import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.impl.SimpleFontManager; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.tenacity.SideGui.SideGui; - public class info { public static String Name = "FDPCLIENT"; public static String version = ""; public static String username; - private final SideGui sideGui = new SideGui(); private static info INSTANCE; - public SideGui getSideGui() { - return sideGui; - } public static info getInstance() { if (INSTANCE == null) INSTANCE = new info(); return INSTANCE; diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/BjurStyle.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/BjurStyle.java deleted file mode 100644 index 206a54d595..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/BjurStyle.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles; - -import java.awt.Color; -import java.io.IOException; -import net.ccbluex.liquidbounce.FDPClient; -import net.ccbluex.liquidbounce.features.module.Module; -import net.ccbluex.liquidbounce.features.module.ModuleCategory; -import net.ccbluex.liquidbounce.features.value.*; -import net.ccbluex.liquidbounce.ui.client.gui.ClickGUIModule; -import net.ccbluex.liquidbounce.ui.font.Fonts; -import net.ccbluex.liquidbounce.ui.font.GameFontRenderer; -import net.ccbluex.liquidbounce.utils.render.Colors; -import net.ccbluex.liquidbounce.utils.render.RenderUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -public class BjurStyle extends GuiScreen { - boolean previousmouse = true; - - public float moveX = 0.0F; - - public float moveY = 0.0F; - - boolean bind = false; - - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - sr = new ScaledResolution(this.mc); - if (alpha < 255) - alpha += 5; - if (this.hue > 255.0F) - this.hue = 0.0F; - float hue = this.hue; - float h2 = this.hue + 85.0F; - float h3 = this.hue + 170.0F; - if (hue > 255.0F) - hue = 0.0F; - if (h2 > 255.0F) - h2 -= 255.0F; - if (h3 > 255.0F) - h3 -= 255.0F; - Color color33 = Color.getHSBColor(hue / 255.0F, 0.9F, 1.0F); - Color color34 = Color.getHSBColor(h2 / 255.0F, 0.9F, 1.0F); - Color color35 = Color.getHSBColor(h3 / 255.0F, 0.9F, 1.0F); - int color36 = color33.getRGB(); - int color37 = color34.getRGB(); - int color38 = color35.getRGB(); - int color39 = (new Color(ClickGUIModule.INSTANCE.getColorRedValue().get(), ClickGUIModule.INSTANCE.getColorGreenValue().get(), ClickGUIModule.INSTANCE.getColorBlueValue().get(), alpha)).getRGB(); - this.hue += 0.1F; - RenderUtils.rectangleBordered(startX, startY, (startX + 450.0F), (startY + 350.0F), 0.01D, Colors.getColor(90, alpha), Colors.getColor(0, alpha)); - RenderUtils.rectangleBordered((startX + 1.0F), (startY + 1.0F), (startX + 450.0F - 1.0F), (startY + 350.0F - 1.0F), 1.0D, Colors.getColor(90, alpha), Colors.getColor(61, alpha)); - RenderUtils.rectangleBordered(startX + 2.5D, startY + 2.5D, (startX + 450.0F) - 2.5D, (startY + 350.0F) - 2.5D, 0.01D, Colors.getColor(61, alpha), Colors.getColor(0, alpha)); - RenderUtils.rectangleBordered((startX + 3.0F), (startY + 3.0F), (startX + 450.0F - 3.0F), (startY + 350.0F - 3.0F), 0.01D, Colors.getColor(27, alpha), Colors.getColor(61, alpha)); - if (alpha >= 55) { - RenderUtils.drawGradientSideways((startX + 3.0F), (startY + 3.0F), (startX + 225.0F), startY + 3.6D, color36, color37); - RenderUtils.drawGradientSideways((startX + 225.0F), (startY + 3.0F), (startX + 450.0F - 3.0F), startY + 3.6D, color37, color38); - } - RenderUtils.drawRect(startX + 98.0F, startY + 48.0F, startX + 432.0F, startY + 318.0F, (new Color(30, 30, 30, alpha)).getRGB()); - RenderUtils.drawRect(startX + 100.0F, startY + 50.0F, startX + 430.0F, startY + 315.0F, (new Color(35, 35, 35, alpha)).getRGB()); - RenderUtils.drawRect(startX + 200.0F, startY + 50.0F, startX + 430.0F, startY + 315.0F, (new Color(37, 37, 37, alpha)).getRGB()); - RenderUtils.drawRect(startX + 202.0F, startY + 50.0F, startX + 430.0F, startY + 315.0F, (new Color(40, 40, 40, alpha)).getRGB()); - Fonts.font40.drawCenteredString("LA MIERDA", startX + 50.0F, startY + 12.0F, (new Color(255, 255, 255, alpha)).getRGB()); - Fonts.font35.drawCenteredString("ClickGUI", startX + 50.0F, startY + 32.0F, color39); - Fonts.font35.drawString("", startX + 15.0F, startY + 330.0F, (new Color(180, 180, 180, alpha)).getRGB()); - int dWheel = Mouse.getDWheel(); - if (isCategoryHovered(startX + 100.0F, startY + 40.0F, startX + 200.0F, startY + 315.0F, mouseX, mouseY)) { - if (dWheel < 0 && moduleStart < FDPClient.moduleManager.getModuleInCategory(currentModuleType).size() - 1) - moduleStart++; - if (dWheel > 0 && moduleStart > 0) - moduleStart--; - } - if (isCategoryHovered(startX + 200.0F, startY + 50.0F, startX + 430.0F, startY + 315.0F, mouseX, mouseY)) { - if (dWheel < 0 && valueStart < currentModule.getValues().size() - 1) - valueStart++; - if (dWheel > 0 && valueStart > 0) - valueStart--; - } - float mY = startY + 12.0F; - for (int i = 0; i < FDPClient.moduleManager.getModuleInCategory(currentModuleType).size(); i++) { - Module module = FDPClient.moduleManager.getModuleInCategory(currentModuleType).get(i); - if (mY > startY + 250.0F) - break; - if (i >= moduleStart) { - if (!module.getState()) { - RenderUtils.drawRect(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) ? (new Color(60, 60, 60, alpha)).getRGB() : (new Color(35, 35, 35, alpha)).getRGB()); - RenderUtils.drawFilledCircle((startX + (isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) ? 112 : 110)), (mY + 58.0F), 3.0D, (new Color(70, 70, 70, alpha)).getRGB(), 5); - Fonts.font35.drawString(module.getName(), startX + (isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) ? 122 : 120), mY + 55.0F, (new Color(175, 175, 175, alpha)).getRGB()); - } else { - RenderUtils.drawRect(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) ? (new Color(60, 60, 60, alpha)).getRGB() : (new Color(35, 35, 35, alpha)).getRGB()); - RenderUtils.drawFilledCircle((startX + (isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) ? 112 : 110)), (mY + 58.0F), 3.0D, (new Color(100, 255, 100, alpha)).getRGB(), 5); - Fonts.font35.drawString(module.getName(), startX + (isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) ? 122 : 120), mY + 55.0F, (new Color(255, 255, 255, alpha)).getRGB()); - } - if (isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY)) { - if (!this.previousmouse && Mouse.isButtonDown(0)) { - if (module.getState()) { - module.setState(false); - } else { - module.setState(true); - } - this.previousmouse = true; - } - if (!this.previousmouse && Mouse.isButtonDown(1)) - this.previousmouse = true; - } - if (!Mouse.isButtonDown(0)) - this.previousmouse = false; - if (isSettingsButtonHovered(startX + 100.0F, mY + 45.0F, startX + 200.0F, mY + 70.0F, mouseX, mouseY) && Mouse.isButtonDown(1)) { - for (int j = 0; j < currentModule.getValues().size(); j++) { - // if (value instanceof BoolValue) - // ((BoolValue)value).setAnim(55.0F); - } - currentModule = module; - valueStart = 0; - } - mY += 25.0F; - } - } - mY = startY + 12.0F; - GameFontRenderer font = Fonts.font35; - for (int k = 0; k < currentModule.getValues().size() && mY <= startY + 250.0F; k++) { - if (k >= valueStart) { - Value value2 = currentModule.getValues().get(k); - if (value2 instanceof TextValue) { - TextValue textValue = (TextValue)value2; - Fonts.font40.drawString(textValue.getName() + ": " + textValue.get(), startX + 220.0F, mY + 50.0F, (new Color(175, 175, 175, alpha)).getRGB()); - mY += 20.0F; - } - if (value2 instanceof BlockValue) { - BlockValue blockValue = (BlockValue)value2; - Fonts.font40.drawString(blockValue.getName() + ": " + blockValue.get(), startX + 220.0F, mY + 50.0F, (new Color(175, 175, 175, alpha)).getRGB()); - mY += 20.0F; - } - if (value2 instanceof FontValue) { - FontValue fontValue = (FontValue)value2; - Fonts.font40.drawString(fontValue.getName() + ": " + fontValue.get(), startX + 220.0F, mY + 50.0F, (new Color(175, 175, 175, alpha)).getRGB()); - mY += 20.0F; - } - if (value2 instanceof IntegerValue) { - IntegerValue floatValue = (IntegerValue)value2; - float x = startX + 320.0F; - double render = (68.0F * (floatValue.getValue() - floatValue.getMinimum()) / (floatValue.getMaximum() - floatValue.getMinimum())); - RenderUtils.drawRect(x + 2.0F, mY + 52.0F, (float)(x + 75.0D), mY + 53.0F, (isButtonHovered(x, mY + 45.0F, x + 100.0F, mY + 57.0F, mouseX, mouseY) && Mouse.isButtonDown(0)) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(30, 30, 30, alpha)).getRGB()); - RenderUtils.drawRect(x + 2.0F, mY + 52.0F, (float)(x + render + 6.5D), mY + 53.0F, (new Color(35, 35, 255, alpha)).getRGB()); - RenderUtils.drawFilledCircle(((float)(x + render + 2.0D) + 3.0F), mY + 52.25D, 1.5D, (new Color(35, 35, 255, alpha)).getRGB(), 5); - Fonts.font40.drawString(floatValue.getName(), startX + 220.0F, mY + 50.0F, (new Color(175, 175, 175, alpha)).getRGB()); - Fonts.font40.drawString(floatValue.getValue().toString(), startX + 320.0F - font.getStringWidth(value2.getValue().toString()), mY + 50.0F, (new Color(255, 255, 255, alpha)).getRGB()); - if (!Mouse.isButtonDown(0)) - this.previousmouse = false; - if (isButtonHovered(x, mY + 45.0F, x + 100.0F, mY + 57.0F, mouseX, mouseY) && Mouse.isButtonDown(0)) { - if (!this.previousmouse && Mouse.isButtonDown(0)) { - render = floatValue.getMinimum(); - double max = floatValue.getMaximum(); - double valAbs = mouseX - x + 1.0D; - double perc = valAbs / 68.0D; - perc = Math.min(Math.max(0.0D, perc), 1.0D); - double valRel = (max - render) * perc; - float val = (float)(render + valRel); - val = (float)(Math.round(val * 1.0D) / 1.0D); - } - if (!Mouse.isButtonDown(0)) - this.previousmouse = false; - } - mY += 20.0F; - } - if (value2 instanceof FloatValue) { - FloatValue floatValue2 = (FloatValue)value2; - float x = startX + 320.0F; - double render = (68.0F * (floatValue2.getValue() - floatValue2.getMinimum()) / (floatValue2.getMaximum() - floatValue2.getMinimum())); - RenderUtils.drawRect(x + 2.0F, mY + 52.0F, (float)(x + 75.0D), mY + 53.0F, (isButtonHovered(x, mY + 45.0F, x + 100.0F, mY + 57.0F, mouseX, mouseY) && Mouse.isButtonDown(0)) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(30, 30, 30, alpha)).getRGB()); - RenderUtils.drawRect(x + 2.0F, mY + 52.0F, (float)(x + render + 6.5D), mY + 53.0F, (new Color(35, 35, 255, alpha)).getRGB()); - RenderUtils.drawFilledCircle(((float)(x + render + 2.0D) + 3.0F), mY + 52.25D, 1.5D, (new Color(35, 35, 255, alpha)).getRGB(), 5); - Fonts.font40.drawString(floatValue2.getName(), startX + 220.0F, mY + 50.0F, (new Color(175, 175, 175, alpha)).getRGB()); - Fonts.font40.drawString(floatValue2.getValue().toString(), startX + 320.0F - font.getStringWidth(value2.getValue().toString()), mY + 50.0F, (new Color(255, 255, 255, alpha)).getRGB()); - if (!Mouse.isButtonDown(0)) - this.previousmouse = false; - if (isButtonHovered(x, mY + 45.0F, x + 100.0F, mY + 57.0F, mouseX, mouseY) && Mouse.isButtonDown(0)) { - if (!this.previousmouse && Mouse.isButtonDown(0)) { - render = floatValue2.getMinimum(); - double max = floatValue2.getMaximum(); - double valAbs = mouseX - x + 1.0D; - double perc = valAbs / 68.0D; - perc = Math.min(Math.max(0.0D, perc), 1.0D); - double valRel = (max - render) * perc; - float val = (float)(render + valRel); - val = (float)(Math.round(val * 100.00000223517424D) / 100.00000223517424D); - floatValue2.setValue(val); - } - if (!Mouse.isButtonDown(0)) - this.previousmouse = false; - } - mY += 20.0F; - } - if (value2 instanceof BoolValue) { - BoolValue boolValue = (BoolValue)value2; - float x = startX + 320.0F; - Fonts.font40.drawString(boolValue.getName(), startX + 220.0F, mY + 50.0F, (new Color(175, 175, 175, alpha)).getRGB()); - if (boolValue.getValue()) { - RenderUtils.drawRect(x + 50.0F, mY + 50.0F, x + 65.0F, mY + 59.0F, isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(20, 20, 20, alpha)).getRGB()); - RenderUtils.drawFilledCircle((x + 50.0F), mY + 54.5D, 4.5D, isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(20, 20, 20, alpha)).getRGB(), 10); - RenderUtils.drawFilledCircle((x + 65.0F), mY + 54.5D, 4.5D, isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(20, 20, 20, alpha)).getRGB(), 10); - RenderUtils.drawFilledCircle((x + 65.0F), mY + 54.5D, 5.0D, (new Color(35, 35, 255, alpha)).getRGB(), 10); - } else { - RenderUtils.drawRect(x + 50.0F, mY + 50.0F, x + 65.0F, mY + 59.0F, isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(20, 20, 20, alpha)).getRGB()); - RenderUtils.drawFilledCircle((x + 50.0F), mY + 54.5D, 4.5D, isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(20, 20, 20, alpha)).getRGB(), 10); - RenderUtils.drawFilledCircle((x + 65.0F), mY + 54.5D, 4.5D, isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(20, 20, 20, alpha)).getRGB(), 10); - RenderUtils.drawFilledCircle((x + 50.0F), mY + 54.5D, 5.0D, (new Color(56, 56, 56, alpha)).getRGB(), 10); - } - if (isCheckBoxHovered(x + 50.0F - 5.0F, mY + 50.0F, x + 65.0F + 6.0F, mY + 59.0F, mouseX, mouseY)) { - if (!this.previousmouse && Mouse.isButtonDown(0)) { - this.previousmouse = true; - this.mouse = true; - } - if (this.mouse) { - boolValue.setValue(!(Boolean) boolValue.getValue()); - this.mouse = false; - } - } - if (!Mouse.isButtonDown(0)) - this.previousmouse = false; - mY += 20.0F; - } - if (value2 instanceof ListValue) { - ListValue listValue = (ListValue)value2; - float x = startX + 320.0F; - Fonts.font40.drawString(listValue.getName(), startX + 220.0F, mY + 52.0F, (new Color(175, 175, 175, alpha)).getRGB()); - RenderUtils.drawRect(x + 5.0F, mY + 45.0F, x + 75.0F, mY + 65.0F, isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB()); - RenderUtils.drawRect(x + 2.0F, mY + 48.0F, x + 78.0F, mY + 62.0F, isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB()); - RenderUtils.drawFilledCircle((x + 5.0F), (mY + 48.0F), 3.0D, isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - RenderUtils.drawFilledCircle((x + 5.0F), (mY + 62.0F), 3.0D, isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - RenderUtils.drawFilledCircle((x + 75.0F), (mY + 48.0F), 3.0D, isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - RenderUtils.drawFilledCircle((x + 75.0F), (mY + 62.0F), 3.0D, isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - Fonts.font40.drawString(listValue.get(), x + 40.0F - (font.getStringWidth(listValue.get()) / 2F), mY + 53.0F, (new Color(255, 255, 255, alpha)).getRGB()); - if (isStringHovered(x, mY + 45.0F, x + 75.0F, mY + 65.0F, mouseX, mouseY) && Mouse.isButtonDown(0) && !this.previousmouse) { - if ((listValue.getValues()).length <= listValue.getModeListNumber(listValue.get()) + 1) { - listValue.set(listValue.getValues()[0]); - } else { - listValue.set(listValue.getValues()[listValue.getModeListNumber(listValue.get()) + 1]); - } - this.previousmouse = true; - } - mY += 25.0F; - } - } - } - float x2 = startX + 320.0F; - float yyy = startY + 240.0F; - Fonts.font40.drawString("Bind", startX + 220.0F, yyy + 50.0F, (new Color(170, 170, 170, alpha)).getRGB()); - RenderUtils.drawRect(x2 + 5.0F, yyy + 45.0F, x2 + 75.0F, yyy + 65.0F, isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB()); - RenderUtils.drawRect(x2 + 2.0F, yyy + 48.0F, x2 + 78.0F, yyy + 62.0F, isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB()); - RenderUtils.drawFilledCircle((x2 + 5.0F), (yyy + 48.0F), 3.0D, isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - RenderUtils.drawFilledCircle((x2 + 5.0F), (yyy + 62.0F), 3.0D, isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - RenderUtils.drawFilledCircle((x2 + 75.0F), (yyy + 48.0F), 3.0D, isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - RenderUtils.drawFilledCircle((x2 + 75.0F), (yyy + 62.0F), 3.0D, isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY) ? (new Color(80, 80, 80, alpha)).getRGB() : (new Color(56, 56, 56, alpha)).getRGB(), 5); - Fonts.font40.drawString(Keyboard.getKeyName(currentModule.getKeyBind()), x2 + 40.0F - (font.getStringWidth(Keyboard.getKeyName(currentModule.getKeyBind())) / 2F), yyy + 53.0F, (new Color(255, 255, 255, alpha)).getRGB()); - if ((isHovered(startX, startY, startX + 450.0F, startY + 50.0F, mouseX, mouseY) || isHovered(startX, startY + 315.0F, startX + 450.0F, startY + 350.0F, mouseX, mouseY) || isHovered(startX + 430.0F, startY, startX + 450.0F, startY + 350.0F, mouseX, mouseY)) && Mouse.isButtonDown(0)) { - if (this.moveX == 0.0F && this.moveY == 0.0F) { - this.moveX = mouseX - startX; - this.moveY = mouseY - startY; - } else { - startX = mouseX - this.moveX; - startY = mouseY - this.moveY; - } - this.previousmouse = true; - } else if (this.moveX != 0.0F || this.moveY != 0.0F) { - this.moveX = 0.0F; - this.moveY = 0.0F; - } - if (isHovered((sr.getScaledWidth() / 2F - 40), 0.0F, (sr.getScaledWidth() / 2F + 40), 20.0F, mouseX, mouseY) && Mouse.isButtonDown(0)) { - startX = (sr.getScaledWidth() / 2F - 225); - startY = (sr.getScaledHeight() / 2F - 175); - alpha = 0; - } - RenderUtils.drawRect((sr.getScaledWidth() / 2F - 39), 0.0F, (sr.getScaledWidth() / 2F + 39), 19.0F, (new Color(0, 0, 0, alpha / 2)).getRGB()); - RenderUtils.drawRect((sr.getScaledWidth() / 2F - 40), 0.0F, (sr.getScaledWidth() / 2F + 40), 20.0F, (new Color(0, 0, 0, alpha / 2)).getRGB()); - float k2 = startY + 10.0F; - float xx2 = startX + 5.0F; - for (int i2 = 0; i2 < (ModuleCategory.values()).length; i2++) { - ModuleCategory[] iterator = ModuleCategory.values(); - if (iterator[i2] == currentModuleType) - RenderUtils.drawRect(xx2 + 8.0F, k2 + 12.0F + 60.0F + (i2 * 45), xx2 + 30.0F, k2 + 13.0F + 60.0F + (i2 * 45), color39); - Fonts.font40.drawString(iterator[i2].toString(), xx2 + (isCategoryHovered(xx2 + 8.0F, k2 - 10.0F + 60.0F + (i2 * 45), xx2 + 80.0F, k2 + 20.0F + 60.0F + (i2 * 45), mouseX, mouseY) ? 27 : 25), k2 + 56.0F + (45 * i2), (new Color(255, 255, 255, alpha)).getRGB()); - try { - if (isCategoryHovered(xx2 + 8.0F, k2 - 10.0F + 60.0F + (i2 * 45), xx2 + 80.0F, k2 + 20.0F + 60.0F + (i2 * 45), mouseX, mouseY) && Mouse.isButtonDown(0)) { - currentModuleType = iterator[i2]; - currentModule = FDPClient.moduleManager.getModuleInCategory(currentModuleType).get(0); - moduleStart = 0; - valueStart = 0; - for (int x3 = 0; x3 < currentModule.getValues().size(); x3++) { - // if (value3 instanceof BoolValue) - // ((BoolValue)value3).setAnim(55.0F); - } - } - } catch (Exception e) { - System.err.println(e); - } - } - } - - public void initGui() { - for (int i = 0; i < currentModule.getValues().size(); i++) { - // if (value instanceof BoolValue) - // ((BoolValue)value).setAnim(55.0F); - } - super.initGui(); - } - - public void keyTyped(char typedChar, int keyCode) { - if (this.bind) { - currentModule.setKeyBind(keyCode); - if (keyCode == 1) - currentModule.setKeyBind(0); - this.bind = false; - } else if (keyCode == 1) { - this.mc.displayGuiScreen((GuiScreen)null); - ((ClickGUIModule) FDPClient.moduleManager.getModule(ClickGUIModule.class)).setState(false); - if (this.mc.currentScreen == null) - this.mc.setIngameFocus(); - } - } - - public void mouseClicked(int mouseX, int mouseY, int button) throws IOException { - float mY = startY + 30.0F; - for (int i = 0; i < currentModule.getValues().size() && mY <= startY + 350.0F; i++) { - if (i >= valueStart) { - Value value = currentModule.getValues().get(i); - if (value instanceof FloatValue) - mY += 20.0F; - if (value instanceof BoolValue) - mY += 20.0F; - if (value instanceof ListValue) - mY += 25.0F; - } - } - float x2 = startX + 320.0F; - float yyy = startY + 240.0F; - if (isHovered(x2 + 2.0F, yyy + 45.0F, x2 + 78.0F, yyy + 65.0F, mouseX, mouseY)) - this.bind = true; - super.mouseClicked(mouseX, mouseY, button); - } - - public boolean isStringHovered(float f, float y, float g, float y2, int mouseX, int mouseY) { - return (mouseX >= f && mouseX <= g && mouseY >= y && mouseY <= y2); - } - - public boolean isSettingsButtonHovered(float x, float y, float x2, float y2, int mouseX, int mouseY) { - return (mouseX >= x && mouseX <= x2 && mouseY >= y && mouseY <= y2); - } - - public boolean isButtonHovered(float f, float y, float g, float y2, int mouseX, int mouseY) { - return (mouseX >= f && mouseX <= g && mouseY >= y && mouseY <= y2); - } - - public boolean isCheckBoxHovered(float f, float y, float g, float y2, int mouseX, int mouseY) { - return (mouseX >= f && mouseX <= g && mouseY >= y && mouseY <= y2); - } - - public boolean isCategoryHovered(float x, float y, float x2, float y2, int mouseX, int mouseY) { - return (mouseX >= x && mouseX <= x2 && mouseY >= y && mouseY <= y2); - } - - public boolean isHovered(float x, float y, float x2, float y2, int mouseX, int mouseY) { - return (mouseX >= x && mouseX <= x2 && mouseY >= y && mouseY <= y2); - } - - public void onGuiClosed() { - alpha = 0; - } - - public static ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - - public static ModuleCategory currentModuleType = ModuleCategory.COMBAT; - - public static Module currentModule = FDPClient.moduleManager.getModuleInCategory(currentModuleType).get(0); - - public static float startX = (sr.getScaledWidth() / 2F - 225); - - public static float startY = (sr.getScaledHeight() / 2F - 175); - - public static int moduleStart = 0; - - public static int valueStart = 0; - - boolean mouse; - - float hue; - - public static int alpha; -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/Slight/SlightUI.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/Slight/SlightUI.java index 8107bfce2e..f226e7ac4f 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/Slight/SlightUI.java +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/Slight/SlightUI.java @@ -4,6 +4,7 @@ import net.ccbluex.liquidbounce.features.module.Module; import net.ccbluex.liquidbounce.features.module.ModuleCategory; import net.ccbluex.liquidbounce.features.value.*; +import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.onetap.OtcClickGUi; import net.ccbluex.liquidbounce.ui.font.Fonts; import net.ccbluex.liquidbounce.ui.font.GameFontRenderer; import net.ccbluex.liquidbounce.utils.render.Colors; @@ -25,6 +26,10 @@ public class SlightUI extends GuiScreen implements GuiYesNoCallback { + private static SlightUI instance; + public static SlightUI getInstance() { + return instance == null ? instance = new SlightUI() : instance; + } public static ModuleCategory currentModuleType = ModuleCategory.COMBAT; public static Module currentModule = (Module) FDPClient.moduleManager.getModuleInCategory(currentModuleType).get(0); public static float startX = 100.0F; diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/dropdown/DropdownGUI.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/dropdown/DropdownGUI.java index f29db7f0f5..5f77ca968c 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/dropdown/DropdownGUI.java +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/dropdown/DropdownGUI.java @@ -6,6 +6,7 @@ package net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.dropdown; import net.ccbluex.liquidbounce.features.module.ModuleCategory; +import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.Slight.SlightUI; import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner; import net.ccbluex.liquidbounce.utils.render.RenderUtils; import net.minecraft.client.gui.GuiScreen; @@ -21,6 +22,11 @@ import java.util.concurrent.CopyOnWriteArrayList; public class DropdownGUI extends GuiScreen { + private static DropdownGUI instance; + public static DropdownGUI getInstance() { + return instance == null ? instance = new DropdownGUI() : instance; + } + private final List tabs = new CopyOnWriteArrayList<>(); private boolean dragging; private int dragX; diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/light/LightClickGUI.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/light/LightClickGUI.java index 69d080c713..9b94da87ce 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/light/LightClickGUI.java +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/light/LightClickGUI.java @@ -11,6 +11,7 @@ import net.ccbluex.liquidbounce.features.module.ModuleCategory; import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.light.LightSettings.InputBox; import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.light.ModuleSettings.Settings; +import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.newVer.NewUi; import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner; import net.ccbluex.liquidbounce.ui.font.Fonts; import net.ccbluex.liquidbounce.utils.AnimationHelper; @@ -29,8 +30,10 @@ public class LightClickGUI extends GuiScreen implements GuiYesNoCallback { - // light style by dg636 & opzywl - + private static LightClickGUI instance; + public static LightClickGUI getInstance() { + return instance == null ? instance = new LightClickGUI() : instance; + } private ModuleCategory currentCategory = ModuleCategory.COMBAT; private Module currentModule = FDPClient.moduleManager.getModuleInCategory(currentCategory).get(0); private float startX = 50, startY = 25; diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/novoline/ClickyUI.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/novoline/ClickyUI.java index 89f21e14e9..b628d83c0d 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/novoline/ClickyUI.java +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/novoline/ClickyUI.java @@ -6,6 +6,7 @@ import com.google.common.collect.Lists; import net.ccbluex.liquidbounce.features.module.ModuleCategory; +import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.onetap.OtcClickGUi; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; @@ -17,6 +18,11 @@ import java.util.ArrayList; public class ClickyUI extends GuiScreen { + + private static ClickyUI instance; + public static ClickyUI getInstance() { + return instance == null ? instance = new ClickyUI() : instance; + } public static ArrayList windows = Lists.newArrayList(); public int scrollVelocity; public static boolean binding; diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/onetap/OtcClickGUi.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/onetap/OtcClickGUi.java index 662e5ec879..694c6e3ce8 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/onetap/OtcClickGUi.java +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/onetap/OtcClickGUi.java @@ -2,6 +2,7 @@ import net.ccbluex.liquidbounce.features.module.ModuleCategory; import net.ccbluex.liquidbounce.ui.client.gui.ClickGUIModule; +import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.light.LightClickGUI; import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.onetap.Utils.OtcScroll; import net.ccbluex.liquidbounce.ui.font.Fonts; import net.ccbluex.liquidbounce.utils.render.RenderUtils; @@ -16,6 +17,11 @@ import java.util.List; public class OtcClickGUi extends GuiScreen { + + private static OtcClickGUi instance; + public static OtcClickGUi getInstance() { + return instance == null ? instance = new OtcClickGUi() : instance; + } private static float mainx; private float x; private static float mainy; @@ -40,6 +46,8 @@ public OtcClickGUi() { this.x += Fonts.fontTahoma.getStringWidth(this.newcatename(category)) + 10; } } + + public String newcatename(final ModuleCategory moduleCategory) { if (moduleCategory.getDisplayName().equals("Combat")) { diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/MainScreen.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/MainScreen.java deleted file mode 100644 index 23ece503b0..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/MainScreen.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity; - -import net.ccbluex.liquidbounce.FDPClient; - -import net.ccbluex.liquidbounce.features.module.Module; -import net.ccbluex.liquidbounce.features.module.ModuleCategory; -import net.ccbluex.liquidbounce.ui.client.gui.ClickGUIModule; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.impl.Fonts; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.tenacity.impl.ModuleRect; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Animation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Direction; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.DecelerateAnimation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.normal.Main; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.normal.Screen; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.DrRenderUtils; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.StencilUtil; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.Scroll; -import net.ccbluex.liquidbounce.utils.MathUtils; -import net.minecraft.client.gui.ScaledResolution; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.stream.Collectors; - -import static net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.DrRenderUtils.isHovering; - -public class MainScreen implements Screen { - - private final ModuleCategory category; - private final float rectWidth = 110; - private final float categoryRectHeight = 18; - public Animation animation; - public HashMap moduleAnimMap = new HashMap<>(); - public Animation openingAnimation; - private List moduleRects; - - public MainScreen(ModuleCategory category) { - this.category = category; - } - - @Override - public void initGui() { - if (moduleRects == null) { - moduleRects = new ArrayList<>(); - for (Module module : Main.getModulesInCategory(category, FDPClient.moduleManager).stream().sorted(Comparator.comparing(Module::getName)).collect(Collectors.toList())) { - ModuleRect moduleRect = new ModuleRect(module); - moduleRects.add(moduleRect); - moduleAnimMap.put(moduleRect, new DecelerateAnimation(250, 1)); - } - } - - if (moduleRects != null) { - moduleRects.forEach(ModuleRect::initGui); - } - - } - - @Override - public void keyTyped(char typedChar, int keyCode) { - if (moduleRects != null) { - moduleRects.forEach(moduleRect -> moduleRect.keyTyped(typedChar, keyCode)); - } - } - - @Override - public void drawScreen(int mouseX, int mouseY) { - float animClamp = (float) Math.max(0, Math.min(255, 255 * animation.getOutput())); - int alphaAnimation = (int) animClamp; - int categoryRectColor = new Color(29, 29, 29, alphaAnimation).getRGB(); - int textColor = new Color(255, 255, 255, alphaAnimation).getRGB(); - - category.getDrag().onDraw(mouseX, mouseY); - float x = category.getDrag().getX(), y = category.getDrag().getY(); - DrRenderUtils.drawRect2(x, y, rectWidth, categoryRectHeight, categoryRectColor); - DrRenderUtils.setAlphaLimit(0); - Fonts.SFBOLD.SFBOLD_26.SFBOLD_26.drawString(category.name(), x + 5, y + Fonts.SFBOLD.SFBOLD_26.SFBOLD_26.getMiddleOfBox(categoryRectHeight), textColor); - - String l = ""; - if (category.name().equalsIgnoreCase("Combat")) { - l = "D"; - } else if (category.name().equalsIgnoreCase("Movement")) { - l = "A"; - } else if (category.name().equalsIgnoreCase("Player")) { - l = "B"; - } else if (category.name().equalsIgnoreCase("Render")) { - l = "C"; - } else if (category.name().equalsIgnoreCase("Exploit")) { - l = "G"; - } else if (category.name().equalsIgnoreCase("Misc")) { - l = "F"; - } - - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.resetColor(); - Fonts.ICONFONT.ICONFONT_20.ICONFONT_20.drawString(l, x + rectWidth - (Fonts.ICONFONT.ICONFONT_20.ICONFONT_20.stringWidth(l) + 5), - y + Fonts.ICONFONT.ICONFONT_20.ICONFONT_20.getMiddleOfBox(categoryRectHeight), textColor); - - if (category.name().equalsIgnoreCase("World")){ - Fonts.CheckFont.CheckFont_20.CheckFont_20.drawString("b", x + rectWidth - (Fonts.CheckFont.CheckFont_20.CheckFont_20.stringWidth("b") + 5), - y + Fonts.ICONFONT.ICONFONT_20.ICONFONT_20.getMiddleOfBox(categoryRectHeight), textColor); - } - - // ClickGuiMod clickGUIMod = (ClickGuiMod) Tenacity.INSTANCE.getModuleCollection().get(ClickGuiMod.class); - - if (ClickGUIModule.INSTANCE.getScrollMode().equals("Value")) { - Main.allowedClickGuiHeight = ClickGUIModule.INSTANCE.getClickHeight().get().floatValue(); - } else { - ScaledResolution sr = new ScaledResolution(mc); - Main.allowedClickGuiHeight = 2 * sr.getScaledHeight() / 3f; - } - - float allowedHeight = Main.allowedClickGuiHeight; - - - boolean hoveringMods = isHovering(x, y + categoryRectHeight, rectWidth, allowedHeight, mouseX, mouseY); - - - float scaleAnim = Math.max(1, (float) openingAnimation.getOutput() + .7f); - float width = rectWidth; - - StencilUtil.initStencilToWrite(); - DrRenderUtils.drawRect2(x - 100, y + categoryRectHeight, rectWidth + 150, allowedHeight, -1); - StencilUtil.readStencilBuffer(1); - - double scroll = category.getScroll().getScroll(); - double count = 0; - for (ModuleRect moduleRect : moduleRects) { - Animation animation = moduleAnimMap.get(moduleRect); - animation.setDirection(moduleRect.module.getExpanded() ? Direction.FORWARDS : Direction.BACKWARDS); - - moduleRect.settingAnimation = animation; - moduleRect.alphaAnimation = alphaAnimation; - moduleRect.x = x; - moduleRect.height = 17; - moduleRect.panelLimitY = y; - moduleRect.openingAnimation = openingAnimation; - moduleRect.y = (float) (y + categoryRectHeight + (count * 17) + MathUtils.INSTANCE.roundToHalf(scroll)); - moduleRect.width = rectWidth; - moduleRect.drawScreen(mouseX, mouseY); - - count += 1 + (moduleRect.getSettingSize()); - } - - if (hoveringMods) { - category.getScroll().onScroll(30); - float hiddenHeight = (float) ((count * 17) - allowedHeight); - category.getScroll().setMinScroll(Math.max(0, hiddenHeight)); - } - - StencilUtil.uninitStencilBuffer(); - - } - - @Override - public void mouseClicked(int mouseX, int mouseY, int button) { - boolean canDrag = isHovering(category.getDrag().getX(), category.getDrag().getY(), rectWidth, categoryRectHeight, mouseX, mouseY); - category.getDrag().onClick(mouseX, mouseY, button, canDrag); - moduleRects.forEach(moduleRect -> moduleRect.mouseClicked(mouseX, mouseY, button)); - } - - @Override - public void mouseReleased(int mouseX, int mouseY, int state) { - category.getDrag().onRelease(state); - moduleRects.forEach(moduleRect -> moduleRect.mouseReleased(mouseX, mouseY, state)); - } -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/GuiPanel.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/GuiPanel.java deleted file mode 100644 index 9e0b07c074..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/GuiPanel.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity.SideGui; - -import net.minecraft.client.Minecraft; - -public abstract class GuiPanel { - - final Minecraft mc = Minecraft.getMinecraft(); - public float rectWidth, rectHeight; - - abstract public void initGui(); - - abstract public void keyTyped(char typedChar, int keyCode); - - abstract public void drawScreen(int mouseX, int mouseY, float partialTicks, int alpha); - - abstract public void mouseClicked(int mouseX, int mouseY, int button); - - abstract public void mouseReleased(int mouseX, int mouseY, int button); - -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/SideGui.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/SideGui.java deleted file mode 100644 index 56c8ab21bd..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/SideGui/SideGui.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity.SideGui; - -import net.ccbluex.liquidbounce.ui.client.gui.ClickGUIModule; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.impl.Fonts; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Animation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Direction; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.DecelerateAnimation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.normal.TimerUtil; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.objects.Drag; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.DrRenderUtils; - -import net.ccbluex.liquidbounce.utils.MathUtils; -import net.ccbluex.liquidbounce.utils.render.RoundedUtil; -import net.minecraft.client.gui.ScaledResolution; - -import java.awt.*; -import java.util.HashMap; - -public class SideGui extends GuiPanel { - private final String[] categories = {"Scripts", "Configs"}; - public boolean focused; - public Animation clickAnimation; - private Animation hoverAnimation; - private Animation textAnimation; - private Animation moveOverGradientAnimation; - private HashMap categoryAnimation = new HashMap<>(); - private Drag drag; - private String currentCategory = "Configs"; - - private TimerUtil timerUtil; - - @Override - public void initGui() { - focused = false; - timerUtil = new TimerUtil(); - rectWidth = 550; - rectHeight = 350; - ScaledResolution sr = new ScaledResolution(mc); - drag = new Drag(sr.getScaledWidth() - 30, sr.getScaledHeight() / 2f - rectHeight / 2f); - textAnimation = new DecelerateAnimation(500, 1); - textAnimation.setDirection(Direction.BACKWARDS); - clickAnimation = new DecelerateAnimation(325, 1); - clickAnimation.setDirection(Direction.BACKWARDS); - categoryAnimation = new HashMap<>(); - for (String category : categories) { - categoryAnimation.put(category, new Animation[]{new DecelerateAnimation(250, 1), new DecelerateAnimation(250, 1)}); - } - - moveOverGradientAnimation = new DecelerateAnimation(250, 1); - moveOverGradientAnimation.setDirection(Direction.BACKWARDS); - - hoverAnimation = new DecelerateAnimation(250, 1); - hoverAnimation.setDirection(Direction.BACKWARDS); - // configPanel.initGui(); - // scriptPanel.initGui(); - } - - @Override - public void keyTyped(char typedChar, int keyCode) { - switch (currentCategory) { - case "Configs": - // configPanel.keyTyped(typedChar, keyCode); - break; - case "Scripts": - //scriptPanel.keyTyped(typedChar, keyCode); - break; - } - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks, int alpha) { - // if (configPanel.reInit) { - // configPanel.initGui(); - // configPanel.reInit = false; - // } - //if (scriptPanel.reInit) { - // scriptPanel.initGui(); - // } - - clickAnimation.setDirection(focused ? Direction.FORWARDS : Direction.BACKWARDS); - boolean hovering = DrRenderUtils.isHovering(drag.getX(), drag.getY(), rectWidth, rectHeight, mouseX, mouseY); - hoverAnimation.setDirection(hovering ? Direction.FORWARDS : Direction.BACKWARDS); - ScaledResolution sr = new ScaledResolution(mc); - - boolean setDirection = !focused && (!timerUtil.hasTimeElapsed(6000) || (!hoverAnimation.isDone() || hoverAnimation.isDone() && hoverAnimation.getDirection().equals(Direction.FORWARDS))); - textAnimation.setDirection(setDirection ? Direction.FORWARDS : Direction.BACKWARDS); - - - if(!textAnimation.isDone() || textAnimation.getDirection().equals(Direction.FORWARDS) && textAnimation.isDone()) { - // FontUtil.iconFont26.drawString(FontUtil.PLAY, drag.getX() - - // ((FontUtil.iconFont26.getStringWidth(FontUtil.PLAY) + 10) * textAnimation.getOutput()), - // drag.getY() + FontUtil.iconFont26.getMiddleOfBox(rectHeight), - // ColorUtil.applyOpacity(-1, (float) textAnimation.getOutput() * 0.5F)); - } - - - if (!clickAnimation.isDone()) { - drag.setX(MathUtils.INSTANCE.interpolateFloat(sr.getScaledWidth() - 30, focused ? sr.getScaledWidth() / 2f - rectWidth / 2f : drag.getX(), (float) clickAnimation.getOutput())); - drag.setY(MathUtils.INSTANCE.interpolateFloat(sr.getScaledHeight() / 2f - rectHeight / 2f, drag.getY(), (float) clickAnimation.getOutput())); - } - - boolean gradient = drag.getX() + rectWidth > sr.getScaledWidth() && focused && (clickAnimation.isDone() && clickAnimation.getDirection().equals(Direction.FORWARDS)); - moveOverGradientAnimation.setDirection(gradient ? Direction.FORWARDS : Direction.BACKWARDS); - - - float rectAlpha = (float) Math.min((float) ((185 + (30 * hoverAnimation.getOutput()) + (70 * clickAnimation.getOutput()))) - (70 * moveOverGradientAnimation.getOutput()), 255); - rectAlpha *= alpha / 255f; - - Color mainRectColor = new Color(30, 30, 30, (int) rectAlpha); - - if (focused) { - drag.onDraw(mouseX, mouseY); - } - - float x = drag.getX(), y = drag.getY(); - RoundedUtil.drawRound(x, y, rectWidth, rectHeight, 9, mainRectColor); - if (!focused) return; - int textColor = DrRenderUtils.applyOpacity(-1, alpha / 255f); - int seperation = 0; - for (String category : categories) { - float xVal = x + rectWidth / 2f - 50 + seperation; - float yVal = y + 15; - - boolean hovered = DrRenderUtils.isHovering(xVal - 30, yVal - 5, 60, Fonts.SFBOLD.SFBOLD_26.SFBOLD_26.getHeight() + 10, mouseX, mouseY); - Animation hoverAnimation = categoryAnimation.get(category)[0]; - Animation enableAnimation = categoryAnimation.get(category)[1]; - - hoverAnimation.setDirection(hovered ? Direction.FORWARDS : Direction.BACKWARDS); - enableAnimation.setDirection(currentCategory.equals(category) ? Direction.FORWARDS : Direction.BACKWARDS); - - Color color22 = new Color(ClickGUIModule.INSTANCE.generateColor().getRGB()); - Color categoryColor = new Color(45, 45, 45, alpha); - Color hoverColor = DrRenderUtils.interpolateColorC(categoryColor, DrRenderUtils.brighter(categoryColor, .8f), (float) hoverAnimation.getOutput()); - Color finalColor = DrRenderUtils.interpolateColorC(hoverColor, DrRenderUtils.applyOpacity(color22, alpha / 255f), (float) enableAnimation.getOutput()); - - RoundedUtil.drawRound(xVal - 30, yVal - 5, 60, Fonts.SFBOLD.SFBOLD_26.SFBOLD_26.getHeight() + 10, 6, finalColor); - - DrRenderUtils.resetColor(); - Fonts.SFBOLD.SFBOLD_26.SFBOLD_26.drawCenteredString(category, xVal, y + 15, textColor); - seperation += 100; - } - - DrRenderUtils.drawRect2(x + 20, y + 50, rectWidth - 40, 1, new Color(45, 45, 45, alpha).getRGB()); - - - if (currentCategory.equals("Scripts")) { - /* scriptPanel.x = x; - scriptPanel.rawY = y; - scriptPanel.rectWidth = rectWidth; - scriptPanel.rectHeight = rectHeight; - scriptPanel.drawScreen(mouseX, mouseY, partialTicks, (int) rectAlpha);*/ - } else { - // configPanel.x = x; - // configPanel.rawY = y; - // configPanel.rectWidth = rectWidth; - // configPanel.rectHeight = rectHeight; - //configPanel.drawScreen(mouseX, mouseY, partialTicks, (int) rectAlpha); - } - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.drawGradientRect2(x + 20, y + 51, rectWidth - 40, 8, new Color(0, 0, 0, (int) (60 * (alpha / 255f))).getRGB(), new Color(0, 0, 0, 0).getRGB()); - - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.drawGradientRectSideways2(sr.getScaledWidth() - 40, 0, 40, sr.getScaledHeight(), - DrRenderUtils.applyOpacity(ClickGUIModule.INSTANCE.generateColor().getRGB(), 0), - DrRenderUtils.applyOpacity(ClickGUIModule.INSTANCE.generateColor().getRGB(), (float) (.4 * moveOverGradientAnimation.getOutput()))); - - DrRenderUtils.setAlphaLimit(1); - } - - @Override - public void mouseClicked(int mouseX, int mouseY, int button) { - boolean hovering = DrRenderUtils.isHovering(drag.getX(), drag.getY(), rectWidth, rectHeight, mouseX, mouseY); - if (hovering && button == 0 && !focused) { - focused = true; - return; - } - - if (focused) { - boolean canDrag = DrRenderUtils.isHovering(drag.getX(), drag.getY(), rectWidth, 50, mouseX, mouseY) - || DrRenderUtils.isHovering(drag.getX(), drag.getY(), 20, rectHeight, mouseX, mouseY); - drag.onClick(mouseX, mouseY, button, canDrag); - - float x = drag.getX(), y = drag.getY(); - int seperation = 0; - for (String category : categories) { - float xVal = x + rectWidth / 2f - 50 + seperation; - float yVal = y + 15; - - boolean hovered = DrRenderUtils.isHovering(xVal - 30, yVal - 5, 60, Fonts.SFBOLD.SFBOLD_26.SFBOLD_26.getHeight() + 10, mouseX, mouseY); - - if (hovered) { - currentCategory = category; - return; - } - seperation += 100; - } - - if (currentCategory.equals("Configs")) { - // configPanel.mouseClicked(mouseX, mouseY, button); - } else { - // scriptPanel.mouseClicked(mouseX, mouseY, button); - } - - } - - } - - @Override - public void mouseReleased(int mouseX, int mouseY, int button) { - if (focused) { - drag.onRelease(button); - ScaledResolution sr = new ScaledResolution(mc); - if (drag.getX() + rectWidth > sr.getScaledWidth() && clickAnimation.isDone()) { - focused = false; - } - if (currentCategory.equals("Configs")) { - // configPanel.mouseReleased(mouseX, mouseY, button); - } - } - } -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/TenacityClickGUI.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/TenacityClickGUI.java deleted file mode 100644 index 5d54d81067..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/TenacityClickGUI.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity; - -import net.ccbluex.liquidbounce.features.module.ModuleCategory; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.logo.info; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.style.styles.tenacity.impl.SettingComponents; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Animation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Direction; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.DecelerateAnimation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.EaseBackIn; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.normal.Main; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.DrRenderUtils; -import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner; -import net.ccbluex.liquidbounce.utils.render.RenderUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Mouse; - -import java.util.ArrayList; -import java.util.List; - -public class TenacityClickGUI extends GuiScreen { - private Animation openingAnimation; - private EaseBackIn fadeAnimation; - private DecelerateAnimation configHover; - private final ResourceLocation hudIcon = new ResourceLocation("fdpclient/ui/clickgui/hud.png"); - private List categoryPanels; - - @Override - public void initGui() { - if (categoryPanels == null || Main.reloadModules) { - categoryPanels = new ArrayList() {{ - for (ModuleCategory category : ModuleCategory.values()) { - // - add(new MainScreen(category)); - } - }}; - Main.reloadModules = false; - } - info.getInstance().getSideGui().initGui(); - fadeAnimation = new EaseBackIn(400, 1, 2f); - openingAnimation = new EaseBackIn(400, .4f, 2f); - configHover = new DecelerateAnimation(250, 1); - - for (MainScreen catPanels : categoryPanels) { - catPanels.animation = fadeAnimation; - catPanels.openingAnimation = openingAnimation; - catPanels.initGui(); - } - } - - @Override - protected void keyTyped(char typedChar, int keyCode) { - if (keyCode == 1) { - openingAnimation.setDirection(Direction.BACKWARDS); - info.getInstance().getSideGui().focused = false; - fadeAnimation.setDirection(openingAnimation.getDirection()); - } - info.getInstance().getSideGui().keyTyped(typedChar, keyCode); - categoryPanels.forEach(categoryPanel -> categoryPanel.keyTyped(typedChar, keyCode)); - } - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - if (Mouse.isButtonDown(0) && mouseX >= 5 && mouseX <= 50 && mouseY <= height - 5 && mouseY >= height - 50) - mc.displayGuiScreen(new GuiHudDesigner()); - RenderUtils.drawImage(hudIcon, 9, height - 41, 32, 32); - - if (Main.reloadModules) { - initGui(); - } - // if (Main.walk.isEnabled()) { - // InvMove.updateStates(); - // } - - //If the closing animation finished then change the gui screen to null - if (openingAnimation.isDone() && openingAnimation.getDirection().equals(Direction.BACKWARDS)) { - mc.displayGuiScreen(null); - return; - } - - boolean focusedConfigGui = info.getInstance().getSideGui().focused; - int fakeMouseX = focusedConfigGui ? 0 : mouseX, fakeMouseY = focusedConfigGui ? 0 : mouseY; - ScaledResolution sr = new ScaledResolution(mc); - - boolean hoveringConfig = DrRenderUtils.isHovering(width - 120, height - 65, 75, 25, fakeMouseX, fakeMouseY); - - configHover.setDirection(hoveringConfig ? Direction.FORWARDS : Direction.BACKWARDS); - int alphaAnimation = Math.max(0, Math.min(255, (int) (255 * fadeAnimation.getOutput()))); - - GlStateManager.color(1, 1, 1, 1); - - SettingComponents.scale = (float) (openingAnimation.getOutput() + .6f); - DrRenderUtils.scale(sr.getScaledWidth() / 2f, sr.getScaledHeight() / 2f, (float) openingAnimation.getOutput() + .6f, () -> { - for (MainScreen catPanels : categoryPanels) { - catPanels.drawScreen(fakeMouseX, fakeMouseY); - } - - info.getInstance().getSideGui().drawScreen(mouseX, mouseY, partialTicks, alphaAnimation); - }); - - - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { - boolean focused = info.getInstance().getSideGui().focused; - info.getInstance().getSideGui().mouseClicked(mouseX, mouseY, mouseButton); - if (!focused) { - categoryPanels.forEach(cat -> cat.mouseClicked(mouseX, mouseY, mouseButton)); - } - } - - @Override - protected void mouseReleased(int mouseX, int mouseY, int state) { - boolean focused = info.getInstance().getSideGui().focused; - info.getInstance().getSideGui().mouseReleased(mouseX, mouseY, state); - if (!focused) { - categoryPanels.forEach(cat -> cat.mouseReleased(mouseX, mouseY, state)); - } - } - -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/Component.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/Component.java deleted file mode 100644 index f86d3248be..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/Component.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity.impl; - -import net.minecraft.client.Minecraft; -public abstract class Component { - - public Minecraft mc = Minecraft.getMinecraft(); - - abstract public void initGui(); - - public abstract void keyTyped(char typedChar, int keyCode); - - 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); -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/ModuleRect.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/ModuleRect.java deleted file mode 100644 index efec2d342d..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/ModuleRect.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity.impl; - -import net.ccbluex.liquidbounce.features.module.Module; -import net.ccbluex.liquidbounce.ui.client.gui.ClickGUIModule; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.impl.Fonts; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.logo.info; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Animation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Direction; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.DecelerateAnimation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.EaseInOutQuad; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.normal.Main; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.DrRenderUtils; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import java.awt.*; - -public class ModuleRect extends Component { - public final info client = info.getInstance(); - public final Module module; - private final SettingComponents settingComponents; - private final Animation animation = new EaseInOutQuad(300, 1, Direction.BACKWARDS); - private final Animation arrowAnimation = new EaseInOutQuad(250, 1, Direction.BACKWARDS); - private final Animation hoverAnimation = new DecelerateAnimation(250, 1, Direction.BACKWARDS); - public Animation settingAnimation; - public Animation openingAnimation; - public float x, y, width, height, panelLimitY; - public int alphaAnimation; - int clickX, clickY; - private double settingSize; - - public ModuleRect(Module module) { - this.module = module; - settingComponents = new SettingComponents(module); - } - - @Override - public void initGui() { - animation.setDirection(module.getState() ? Direction.FORWARDS : Direction.BACKWARDS); - } - - @Override - public void keyTyped(char typedChar, int keyCode) { - if (module.getExpanded()) { - settingComponents.keyTyped(typedChar, keyCode); - } - } - - @Override - public void drawScreen(int mouseX, int mouseY) { - Color rectColor = new Color(43, 45, 50, alphaAnimation); - Color textColor = new Color(255, 255, 255, alphaAnimation); - Color debcolor = new Color(ClickGUIModule.INSTANCE.generateColor().getRGB()); - - Color clickModColor = DrRenderUtils.applyOpacity(debcolor, alphaAnimation / 255f); - float alpha = alphaAnimation / 255f; - - boolean hoveringModule = DrRenderUtils.isHovering(x, y, width, height, mouseX, mouseY); - hoverAnimation.setDirection(hoveringModule ? Direction.FORWARDS : Direction.BACKWARDS); - - // Normal Grey rect - DrRenderUtils.drawRect2(x, y, width, height, DrRenderUtils.interpolateColor(rectColor.getRGB(), DrRenderUtils.brighter(rectColor, .8f).getRGB(), (float) hoverAnimation.getOutput())); - - DrRenderUtils.drawRect2(x, y, width, height, DrRenderUtils.applyOpacity(clickModColor, (float) animation.getOutput()).getRGB()); - - Fonts.SF.SF_20.SF_20.drawString(module.getName(), x + 5, y + Fonts.SF.SF_20.SF_20.getMiddleOfBox(height), textColor.getRGB()); - - if (Keyboard.isKeyDown(Keyboard.KEY_TAB) && module.getKeyBind() != 0) { - String keyName = Keyboard.getKeyName(module.getKeyBind()); - Fonts.SF.SF_20.SF_20.drawString(keyName, x + width - Fonts.SF.SF_20.SF_20.stringWidth(keyName) - 5, y + Fonts.SF.SF_20.SF_20.getMiddleOfBox(height), textColor.getRGB()); - } else { - float arrowSize = 6; - arrowAnimation.setDirection(module.getExpanded() ? Direction.FORWARDS : Direction.BACKWARDS); - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.resetColor(); - DrRenderUtils.drawClickGuiArrow(x + width - (arrowSize + 5), y + height / 2f - 2, arrowSize, arrowAnimation, textColor.getRGB()); - } - - Color settingRectColor = new Color(32, 32, 32, alphaAnimation); - - - double settingHeight = (settingComponents.settingSize) * settingAnimation.getOutput(); - if (module.getExpanded() || !settingAnimation.isDone()) { - //绘制下拉列表背景颜色 - DrRenderUtils.drawRect2(x, y + height, width, settingHeight * height, settingRectColor.getRGB()); - - boolean hoveringSettingsOrModule = DrRenderUtils.isHovering(x, y, width, (float) (height + (settingHeight * height)), mouseX, mouseY); - - - if (ClickGUIModule.INSTANCE.getBackback().get()) { - - DrRenderUtils.resetColor(); - - float accentAlpha = (float) (.85 * animation.getOutput()) * alpha; - - DrRenderUtils.drawRect2(x, y + height, width, (float) (settingHeight * height), DrRenderUtils.applyOpacity(clickModColor, accentAlpha).getRGB()); - } - - - settingComponents.x = x; - settingComponents.y = y + height; - settingComponents.width = width; - settingComponents.rectHeight = height; - settingComponents.panelLimitY = panelLimitY; - settingComponents.alphaAnimation = alphaAnimation; - settingComponents.settingHeightScissor = settingAnimation; - if (!settingAnimation.isDone()) { - GL11.glEnable(GL11.GL_SCISSOR_TEST); - DrRenderUtils.scissor(x, y + height, width, settingHeight * height); - - settingComponents.drawScreen(mouseX, mouseY); - DrRenderUtils.drawGradientRect2(x, y + height, width, 6, new Color(0, 0, 0, 60).getRGB(), new Color(0, 0, 0, 0).getRGB()); - DrRenderUtils.drawGradientRect2(x, y + 11 + (settingHeight * height), width, 6, new Color(0, 0, 0, 0).getRGB(), new Color(0, 0, 0, 60).getRGB()); - GL11.glDisable(GL11.GL_SCISSOR_TEST); - } else { - settingComponents.drawScreen(mouseX, mouseY); - DrRenderUtils.drawGradientRect2(x, y + height, width, 6, new Color(0, 0, 0, 60).getRGB(), new Color(0, 0, 0, 0).getRGB()); - DrRenderUtils.drawGradientRect2(x, y + 11 + (settingHeight * height), width, 6, new Color(0, 0, 0, 0).getRGB(), new Color(0, 0, 0, 60).getRGB()); - } - - } - settingSize = settingHeight; - - } - - @Override - public void mouseClicked(int mouseX, int mouseY, int button) { - boolean hoveringModule = isClickable(y, panelLimitY) && DrRenderUtils.isHovering(x, y, width, height, mouseX, mouseY); - if (hoveringModule) { - switch (button) { - case 0: - clickX = mouseX; - clickY = mouseY; - animation.setDirection(!module.getState() ? Direction.FORWARDS : Direction.BACKWARDS); - module.toggle(); - break; - case 1: - module.setExpanded(!module.getExpanded()); - break; - } - } - if (module.getExpanded()) { - settingComponents.mouseClicked(mouseX, mouseY, button); - } - } - - @Override - public void mouseReleased(int mouseX, int mouseY, int state) { - if (module.getExpanded()) { - settingComponents.mouseReleased(mouseX, mouseY, state); - } - } - - public double getSettingSize() { - return settingSize; - } - - public boolean isClickable(float y, float panelLimitY) { - return y > panelLimitY && y < panelLimitY + Main.allowedClickGuiHeight + 17; - } -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/SettingComponents.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/SettingComponents.java deleted file mode 100644 index efd084f67d..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/clickgui/style/styles/tenacity/impl/SettingComponents.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * FDPClient Hacked Client - * 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.gui.clickgui.style.styles.tenacity.impl; - -import net.ccbluex.liquidbounce.FDPClient; - -import net.ccbluex.liquidbounce.ui.client.gui.ClickGUIModule; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.impl.Fonts; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.normal.Main; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.objects.PasswordField; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.DrRenderUtils; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.render.GuiEvents; -import net.ccbluex.liquidbounce.features.module.Module; -import net.ccbluex.liquidbounce.features.module.impl.client.HUD; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Animation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.Direction; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.DecelerateAnimation; -import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.impl.EaseInOutQuad; -import net.ccbluex.liquidbounce.utils.MathUtils; -import net.ccbluex.liquidbounce.utils.render.RoundedUtil; -import net.ccbluex.liquidbounce.features.value.*; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.OpenGlHelper; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.HashMap; - -import static org.lwjgl.opengl.GL11.*; - -public class SettingComponents extends Component { - public static float scale; - private final Module module; - public Animation settingHeightScissor; - private final HashMap keySettingAnimMap = new HashMap<>(); - private final HashMap sliderintMap = new HashMap<>(); - private final HashMap sliderintAnimMap = new HashMap<>(); - private final HashMap sliderfloatMap = new HashMap<>(); - private final HashMap sliderfloatAnimMap = new HashMap<>(); - private final HashMap sliderMap = new HashMap<>(); - private final HashMap sliderAnimMap = new HashMap<>(); - private final HashMap toggleAnimation = new HashMap<>(); - private final HashMap modeSettingAnimMap = new HashMap<>(); - private final HashMap modeSettingClick = new HashMap<>(); - private final HashMap> modesHoverAnimation = new HashMap<>(); - public Module binding; - public Value draggingNumber; - public float x, y, width, rectHeight, panelLimitY; - public int alphaAnimation; - public double settingSize; - private PasswordField selectedField; - private TextValue selectedStringSetting; - private boolean hueFlag; - - public SettingComponents(Module module) { - this.module = module; - keySettingAnimMap.put( module, new Animation[]{new EaseInOutQuad(250, 1, Direction.BACKWARDS), - new DecelerateAnimation(225, 1, Direction.BACKWARDS)}); - - for (Value setting : module.getValues()) { - - if (setting instanceof NumberValue) { - sliderMap.put((NumberValue) setting, 0f); - sliderAnimMap.put((NumberValue) setting, new Animation[]{new DecelerateAnimation(250, 1, Direction.BACKWARDS), new DecelerateAnimation(200, 1, Direction.BACKWARDS)}); - } - if (setting instanceof FloatValue) { - sliderfloatMap.put((FloatValue) setting, 0f); - sliderfloatAnimMap.put((FloatValue) setting, new Animation[]{new DecelerateAnimation(250, 1, Direction.BACKWARDS), new DecelerateAnimation(200, 1, Direction.BACKWARDS)}); - } - if (setting instanceof IntegerValue) { - sliderintMap.put((IntegerValue) setting, 0f); - sliderintAnimMap.put((IntegerValue) setting, new Animation[]{new DecelerateAnimation(250, 1, Direction.BACKWARDS), new DecelerateAnimation(200, 1, Direction.BACKWARDS)}); - } - if (setting instanceof BoolValue) { - toggleAnimation.put((BoolValue) setting, new Animation[]{new DecelerateAnimation(225, 1, Direction.BACKWARDS), - new DecelerateAnimation(200, 1, Direction.BACKWARDS)}); - } - if (setting instanceof ListValue) { - ListValue modeSetting = (ListValue) setting; - modeSettingClick.put(modeSetting, false); - modeSettingAnimMap.put(modeSetting, new Animation[]{new DecelerateAnimation(225, 1, Direction.BACKWARDS), - new EaseInOutQuad(250, 1, Direction.BACKWARDS)}); - - HashMap modeMap = new HashMap<>(); - for (String mode : modeSetting.getValues()) { - modeMap.put(mode, new DecelerateAnimation(225, 1, Direction.BACKWARDS)); - } - - modesHoverAnimation.put(modeSetting, modeMap); - } - - - } - } - - @Override - public void initGui() { - - } - - @Override - public void keyTyped(char typedChar, int keyCode) { - /* - if (binding != null) { - selectedField = null; - selectedStringSetting = null; - if (keyCode == Keyboard.KEY_SPACE || keyCode == Keyboard.KEY_ESCAPE || keyCode == Keyboard.KEY_DELETE) - binding.setKeyBind(Keyboard.KEY_NONE); - - binding.setKeyBind(keyCode); - binding = null; - return; - } - - */ - - - if (selectedField != null) { - if (keyCode == 1) { - selectedField = null; - selectedStringSetting = null; - return; - } - selectedField.textboxKeyTyped(typedChar, keyCode); - selectedStringSetting.set(selectedField.getText()); - } - } - - - public void handle(int mouseX, int mouseY, int button, GuiEvents type) { - HUD hud = (HUD) FDPClient.moduleManager.getModule(HUD.class); - //Setting up the colors - Color textColor = new Color(255, 255, 255, alphaAnimation); - Color darkRectColor = new Color(48, 50, 55, alphaAnimation); - Color darkRectColorDisabled = new Color(52, 52, 52, alphaAnimation); - Color darkRectHover = DrRenderUtils.brighter(darkRectColor, .8f); - - Color[] colors = new Color[2]; - boolean accent = ClickGUIModule.INSTANCE.getColormode().get().equalsIgnoreCase("Color"); - - Color color2 = new Color(ClickGUIModule.INSTANCE.generateColor().getRGB()); - colors = new Color[]{color2,color2}; - - Color accentedColor = DrRenderUtils.applyOpacity(colors[0], alphaAnimation / 255f); - Color accentedColor2 = DrRenderUtils.applyOpacity(colors[1], alphaAnimation / 255f); - - - double count = 0; - - - - for (Value setting : module.getValues()) { - if (!setting.getDisplayable()) - continue; - - float settingY = (float) MathUtils.INSTANCE.roundToHalf(y + (count * rectHeight)); - if (setting instanceof FloatValue) { - FloatValue numberSetting = (FloatValue) setting; - - String value = Float.toString((float) MathUtils.INSTANCE.round(numberSetting.getValue(), 0.01)); - float regularFontWidth = (float) Fonts.SF.SF_18.SF_18.stringWidth(numberSetting.getName() + ": "); - float valueFontWidth = (float) Fonts.SF.SF_18.SF_18.stringWidth(value); - - float titleX = x + width / 2f - (regularFontWidth + valueFontWidth) / 2f; - float titleY = settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) - - Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) / 2f + 1; - GlStateManager.color(1, 1, 1, 1); - - Fonts.SF.SF_18.SF_18.drawString(numberSetting.getName() + ": ", titleX, titleY, textColor.getRGB()); - GlStateManager.color(1, 1, 1, 1); - - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.drawString(value, titleX + regularFontWidth, titleY, textColor.getRGB()); - - - Animation hoverAnimation = sliderfloatAnimMap.get(numberSetting)[0]; - Animation selectAnimtion = sliderfloatAnimMap.get(numberSetting)[1]; - - float totalSliderWidth = width - 10; - boolean hoveringSlider = isClickable(settingY + 17) && DrRenderUtils.isHovering(x + 5, settingY + 17, totalSliderWidth, 6, mouseX, mouseY); - - if (type == GuiEvents.RELEASE) { - draggingNumber = null; - } - hoverAnimation.setDirection(hoveringSlider || draggingNumber == numberSetting ? Direction.FORWARDS : Direction.BACKWARDS); - selectAnimtion.setDirection(draggingNumber == numberSetting ? Direction.FORWARDS : Direction.BACKWARDS); - if (type == GuiEvents.CLICK && hoveringSlider && button == 0) { - draggingNumber = numberSetting; - } - - - double currentValue = numberSetting.getValue(); - - - if (draggingNumber != null && draggingNumber == setting) { - float percent = Math.min(1, Math.max(0, (mouseX - (x + 5)) / totalSliderWidth)); - double newValue = (percent * (numberSetting.getMaximum() - - numberSetting.getMinimum())) + numberSetting.getMinimum(); - numberSetting.set(newValue); - } - - float sliderMath = (float) (((currentValue) - numberSetting.getMinimum()) - / (numberSetting.getMaximum() - numberSetting.getMinimum())); - - - sliderfloatMap.put(numberSetting, (float) DrRenderUtils.animate(totalSliderWidth * sliderMath, sliderfloatMap.get(numberSetting), .1)); - - - float sliderY = (settingY + 18); - RoundedUtil.drawRound(x + 5, sliderY, totalSliderWidth, 3, 1.5f, DrRenderUtils.applyOpacity(darkRectHover, (float) (.4f + (.2 * hoverAnimation.getOutput())))); - RoundedUtil.drawRound(x + 5, sliderY, Math.max(4, sliderfloatMap.get(numberSetting)), 3, 1.5f, accent ? accentedColor2 : textColor); - - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.fakeCircleGlow(x + 4 + Math.max(4, sliderfloatMap.get(numberSetting)), sliderY + 1.5f, 6, - Color.BLACK, .3f); - - DrRenderUtils.drawGoodCircle(x + 4 + Math.max(4, sliderfloatMap.get(numberSetting)), sliderY + 1.5f, 3.75f, accent ? accentedColor2.getRGB() : textColor.getRGB()); - count += .5f; - } - if (setting instanceof IntegerValue) { - IntegerValue numberSetting = (IntegerValue) setting; - - String value = Float.toString((float) MathUtils.INSTANCE.round(numberSetting.getValue(), 1)); - float regularFontWidth = (float) Fonts.SF.SF_18.SF_18.stringWidth(numberSetting.getName() + ": "); - float valueFontWidth = (float) Fonts.SF.SF_18.SF_18.stringWidth(value); - - float titleX = x + width / 2f - (regularFontWidth + valueFontWidth) / 2f; - float titleY = settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) - - Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) / 2f + 1; - GlStateManager.color(1, 1, 1, 1); - - Fonts.SF.SF_18.SF_18.drawString(numberSetting.getName() + ": ", titleX, titleY, textColor.getRGB()); - GlStateManager.color(1, 1, 1, 1); - - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.drawString(value, titleX + regularFontWidth, titleY, textColor.getRGB()); - - - Animation hoverAnimation = sliderintAnimMap.get(numberSetting)[0]; - Animation selectAnimtion = sliderintAnimMap.get(numberSetting)[1]; - - float totalSliderWidth = width - 10; - boolean hoveringSlider = isClickable(settingY + 17) && DrRenderUtils.isHovering(x + 5, settingY + 17, totalSliderWidth, 6, mouseX, mouseY); - - if (type == GuiEvents.RELEASE) { - draggingNumber = null; - } - hoverAnimation.setDirection(hoveringSlider || draggingNumber == numberSetting ? Direction.FORWARDS : Direction.BACKWARDS); - selectAnimtion.setDirection(draggingNumber == numberSetting ? Direction.FORWARDS : Direction.BACKWARDS); - if (type == GuiEvents.CLICK && hoveringSlider && button == 0) { - draggingNumber = numberSetting; - } - - - double currentValue = numberSetting.getValue(); - - - if (draggingNumber != null && draggingNumber == setting) { - float percent = Math.min(1, Math.max(0, (mouseX - (x + 5)) / totalSliderWidth)); - double newValue = (percent * (numberSetting.getMaximum() - - numberSetting.getMinimum())) + numberSetting.getMinimum(); - numberSetting.set(newValue); - } - - float sliderMath = (float) (((currentValue) - numberSetting.getMinimum()) - / (numberSetting.getMaximum() - numberSetting.getMinimum())); - - - sliderintMap.put(numberSetting, (float) DrRenderUtils.animate(totalSliderWidth * sliderMath, sliderintMap.get(numberSetting), .1)); - - - float sliderY = (settingY + 18); - RoundedUtil.drawRound(x + 5, sliderY, totalSliderWidth, 3, 1.5f, DrRenderUtils.applyOpacity(darkRectHover, (float) (.4f + (.2 * hoverAnimation.getOutput())))); - RoundedUtil.drawRound(x + 5, sliderY, Math.max(4, sliderintMap.get(numberSetting)), 3, 1.5f, accent ? accentedColor2 : textColor); - - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.fakeCircleGlow(x + 4 + Math.max(4, sliderintMap.get(numberSetting)), sliderY + 1.5f, 6, - Color.BLACK, .3f); - - DrRenderUtils.drawGoodCircle(x + 4 + Math.max(4, sliderintMap.get(numberSetting)), sliderY + 1.5f, 3.75f, accent ? accentedColor2.getRGB() : textColor.getRGB()); - count += .5f; - } - if (setting instanceof NumberValue) { - NumberValue numberSetting = (NumberValue) setting; - - String value = Float.toString((float) MathUtils.INSTANCE.round(numberSetting.getValue(), numberSetting.getInc())); - float regularFontWidth = (float) Fonts.SF.SF_18.SF_18.stringWidth(numberSetting.getName() + ": "); - float valueFontWidth = (float) Fonts.SF.SF_18.SF_18.stringWidth(value); - - float titleX = x + width / 2f - (regularFontWidth + valueFontWidth) / 2f; - float titleY = settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) - - Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) / 2f + 1; - GlStateManager.color(1, 1, 1, 1); - - Fonts.SF.SF_18.SF_18.drawString(numberSetting.getName() + ": ", titleX, titleY, textColor.getRGB()); - GlStateManager.color(1, 1, 1, 1); - - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.drawString(value, titleX + regularFontWidth, titleY, textColor.getRGB()); - - - Animation hoverAnimation = sliderAnimMap.get(numberSetting)[0]; - Animation selectAnimtion = sliderAnimMap.get(numberSetting)[1]; - - float totalSliderWidth = width - 10; - boolean hoveringSlider = isClickable(settingY + 17) && DrRenderUtils.isHovering(x + 5, settingY + 17, totalSliderWidth, 6, mouseX, mouseY); - - if (type == GuiEvents.RELEASE) { - draggingNumber = null; - } - hoverAnimation.setDirection(hoveringSlider || draggingNumber == numberSetting ? Direction.FORWARDS : Direction.BACKWARDS); - selectAnimtion.setDirection(draggingNumber == numberSetting ? Direction.FORWARDS : Direction.BACKWARDS); - if (type == GuiEvents.CLICK && hoveringSlider && button == 0) { - draggingNumber = numberSetting; - } - - - double currentValue = numberSetting.getValue(); - - - if (draggingNumber != null && draggingNumber == setting) { - float percent = Math.min(1, Math.max(0, (mouseX - (x + 5)) / totalSliderWidth)); - double newValue = (percent * (numberSetting.getMaximum() - - numberSetting.getMinimum())) + numberSetting.getMinimum(); - numberSetting.setValue(newValue); - } - - float sliderMath = (float) (((currentValue) - numberSetting.getMinimum()) - / (numberSetting.getMaximum() - numberSetting.getMinimum())); - - - sliderMap.put(numberSetting, (float) DrRenderUtils.animate(totalSliderWidth * sliderMath, sliderMap.get(numberSetting), .1)); - - - float sliderY = (settingY + 18); - RoundedUtil.drawRound(x + 5, sliderY, totalSliderWidth, 3, 1.5f, DrRenderUtils.applyOpacity(darkRectHover, (float) (.4f + (.2 * hoverAnimation.getOutput())))); - RoundedUtil.drawRound(x + 5, sliderY, Math.max(4, sliderMap.get(numberSetting)), 3, 1.5f, accent ? accentedColor2 : textColor); - - DrRenderUtils.setAlphaLimit(0); - DrRenderUtils.fakeCircleGlow(x + 4 + Math.max(4, sliderMap.get(numberSetting)), sliderY + 1.5f, 6, - Color.BLACK, .3f); - - DrRenderUtils.drawGoodCircle(x + 4 + Math.max(4, sliderMap.get(numberSetting)), sliderY + 1.5f, 3.75f, accent ? accentedColor2.getRGB() : textColor.getRGB()); - count += .5f; - } - if (setting instanceof BoolValue) { - BoolValue booleanSetting = (BoolValue) setting; - - Animation toggleAnimation = this.toggleAnimation.get(booleanSetting)[0]; - Animation hoverAnimation = this.toggleAnimation.get(booleanSetting)[1]; - - DrRenderUtils.resetColor(); - OpenGlHelper.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO); - GlStateManager.enableBlend(); - - Fonts.SF.SF_18.SF_18.drawString(booleanSetting.getName(), (int) MathUtils.INSTANCE.roundToHalf(x + 4), settingY + - 5, textColor.getRGB()); - - float switchWidth = 16; - - boolean hoveringSwitch = isClickable(settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) - 1) && - DrRenderUtils.isHovering(x + width - (switchWidth + 6), settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) - 1, - switchWidth, 8, mouseX, mouseY); - - hoverAnimation.setDirection(hoveringSwitch ? Direction.FORWARDS : Direction.BACKWARDS); - - if (type == GuiEvents.CLICK && hoveringSwitch && button == 0) { - booleanSetting.toggle(); - } - - toggleAnimation.setDirection(booleanSetting.get() ? Direction.FORWARDS : Direction.BACKWARDS); - DrRenderUtils.resetColor(); - Color accentCircle = accent ? DrRenderUtils.applyOpacity(accentedColor, .8f) : DrRenderUtils.darker(textColor, .8f); - RoundedUtil.drawRound(x + width - (switchWidth + 5.5f), settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) + 2, switchWidth, 4.5f, - 2, DrRenderUtils.interpolateColorC(DrRenderUtils.applyOpacity(darkRectHover, .5f), accentCircle, (float) toggleAnimation.getOutput())); - - DrRenderUtils.fakeCircleGlow((float) ((x + width - (switchWidth + 3)) + ((switchWidth - 5) * toggleAnimation.getOutput())), - settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) + 4, 6, Color.BLACK, .3f); - - DrRenderUtils.resetColor(); - - RoundedUtil.drawRound((float) (x + width - (switchWidth + 6) + ((switchWidth - 5) * toggleAnimation.getOutput())), - settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) + 1, 6.5f, - 6.5f, 3, textColor); - - - } - if (setting instanceof ListValue) { - ListValue modeSetting = (ListValue) setting; - Animation hoverAnimation = modeSettingAnimMap.get(modeSetting)[0]; - Animation openAnimation = modeSettingAnimMap.get(modeSetting)[1]; - - boolean hoveringModeSettingRect = isClickable(settingY + 5) && - DrRenderUtils.isHovering(x + 5, settingY + 5, width - 10, rectHeight + 7, mouseX, mouseY); - - if (type == GuiEvents.CLICK && hoveringModeSettingRect && button == 1) { - modeSettingClick.put(modeSetting, !modeSettingClick.get(modeSetting)); - } - - hoverAnimation.setDirection(hoveringModeSettingRect ? Direction.FORWARDS : Direction.BACKWARDS); - openAnimation.setDirection(modeSettingClick.get(modeSetting) ? Direction.FORWARDS : Direction.BACKWARDS); - - float math = (modeSetting.getValues().length - 1) * rectHeight; - RoundedUtil.drawRound(x + 5, (float) (settingY + rectHeight + 2 + (12 * openAnimation.getOutput())), - width - 10, (float) (math * openAnimation.getOutput()), 3, DrRenderUtils.applyOpacity(darkRectHover, (float) (.35f * openAnimation.getOutput()))); - - if (!openAnimation.isDone() && type == GuiEvents.DRAW) { - GL11.glEnable(GL11.GL_SCISSOR_TEST); - DrRenderUtils.scissor(x + 5, (float) (settingY + 7 + rectHeight + (3 * openAnimation.getOutput())), - width - 10, (float) (math * openAnimation.getOutput())); - } - float modeCount = 0; - for (String mode : modeSetting.getValues()) { - if (mode.equalsIgnoreCase(modeSetting.get())) continue; - float modeY = (float) (settingY + rectHeight + 11 + ((8 + (modeCount * rectHeight)) * openAnimation.getOutput())); - DrRenderUtils.resetColor(); - - //指针所指的String - boolean hoveringMode = isClickable(modeY - 5) && openAnimation.getDirection().equals(Direction.FORWARDS) && - DrRenderUtils.isHovering(x + 5, modeY - 5, width - 10, rectHeight, mouseX, mouseY); - Animation modeHoverAnimation = modesHoverAnimation.get(modeSetting).get(mode); - - - - - modeHoverAnimation.setDirection(hoveringMode ? Direction.FORWARDS : Direction.BACKWARDS); - - - if (modeHoverAnimation.finished(Direction.FORWARDS) || !modeHoverAnimation.isDone()) { - RoundedUtil.drawRound(x + 5, modeY - 5, width - 10, rectHeight, 3, - DrRenderUtils.applyOpacity(textColor, (float) (.2f * modeHoverAnimation.getOutput()))); - } - if (type == GuiEvents.CLICK && button == 0 && hoveringMode) { - modeSettingClick.put(modeSetting, !modeSettingClick.get(modeSetting)); - modeSetting.set(mode); - } - if (openAnimation.isDone() && openAnimation.getDirection().equals(Direction.FORWARDS) || !openAnimation.isDone()) { - // RoundedUtil.drawRound(x + 5 + ((width - 10) / 2f - selectRectWidth / 2f), settingY + rectHeight + 10.5f, - // Math.max(2, selectRectWidth), 1.5f, .5f, accent ? accentedColor2 : textColor); - Fonts.SF.SF_18.SF_18.drawString(mode, x + 13, modeY,DrRenderUtils.applyOpacity(textColor, (float) openAnimation.getOutput()).getRGB()); - } - // Fonts.SF.SF_18.SF_18.drawString(mode, x + 13, modeY,DrRenderUtils.applyOpacity(textColor, (float) openAnimation.getOutput()).getRGB()); - modeCount++; - } - if (!openAnimation.isDone() && type == GuiEvents.DRAW) { - GL11.glDisable(GL11.GL_SCISSOR_TEST); - } - if (settingHeightScissor.isDone() && openAnimation.isDone() && GL11.glIsEnabled(GL11.GL_SCISSOR_TEST)) { - GL11.glDisable(GL11.GL_SCISSOR_TEST); - } - - RoundedUtil.drawRound(x + 5, settingY + 5, width - 10, rectHeight + 7, 3, DrRenderUtils.applyOpacity(darkRectHover, .45f)); - - if(!hoverAnimation.isDone() || hoverAnimation.finished(Direction.FORWARDS)) { - RoundedUtil.drawRound(x + 5, settingY + 5, width - 10, rectHeight + 7, 3, DrRenderUtils.applyOpacity(textColor, (float) (.2f * hoverAnimation.getOutput()))); - } - - - float selectRectWidth = (float) ((width - 10) * openAnimation.getOutput()); - // DrRenderUtils.renderRoundedRect(x + 5, settingY + rectHeight + 7, width - 10, 2, .5f, disabledTextColor.getRGB()); - if (openAnimation.isDone() && openAnimation.getDirection().equals(Direction.FORWARDS) || !openAnimation.isDone()) { - RoundedUtil.drawRound(x + 5 + ((width - 10) / 2f - selectRectWidth / 2f), settingY + rectHeight + 10.5f, - Math.max(2, selectRectWidth), 1.5f, .5f, accent ? accentedColor2 : textColor); - // Fonts.SF.SF_18.SF_18.drawString(mode, x + 13, modeY,DrRenderUtils.applyOpacity(textColor, (float) openAnimation.getOutput()).getRGB()); - } - - - Fonts.SF.SF_14.SF_14.drawString(modeSetting.getName(), x + 13, settingY + 9, textColor.getRGB()); - - DrRenderUtils.resetColor(); - - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.drawString(modeSetting.get(), x + 13, (float) (settingY + 17.5), textColor.getRGB()); - - DrRenderUtils.resetColor(); - DrRenderUtils.drawClickGuiArrow(x + width - 15, settingY + 17, 5, openAnimation, textColor.getRGB()); - - - count += 1 + ((math / rectHeight) * openAnimation.getOutput()); - } - if (setting instanceof TextValue) { - TextValue stringSetting = (TextValue) setting; - - DrRenderUtils.resetColor(); - Fonts.SF.SF_16.SF_16.drawString(stringSetting.getName(), x + 5, settingY + 2, textColor.getRGB()); - - PasswordField stringSettingField = new PasswordField("Type Here...", 0, - (int) (x + 5), (int) (settingY + 15), (int) (width - 10), 10, Fonts.SF.SF_18.SF_18); - - stringSettingField.setText(stringSetting.get()); - stringSettingField.setFocused(selectedStringSetting == stringSetting); - stringSettingField.bottomBarColor = textColor.getRGB(); - stringSettingField.textColor = textColor.getRGB(); - stringSettingField.placeHolderTextX = x + 30; - if (type == GuiEvents.CLICK) stringSettingField.mouseClicked(mouseX, mouseY, button); - if (stringSettingField.isFocused()) { - selectedField = stringSettingField; - selectedStringSetting = stringSetting; - - } else if (selectedStringSetting == stringSetting) { - selectedStringSetting = null; - selectedField = null; - } - - stringSettingField.drawTextBox(); - //Writes to StringSetting - stringSetting.set(stringSettingField.getText()); - - count++; - } - /* - String bind = Keyboard.getKeyName(module.getKeyBind()); - - boolean hoveringBindRect = isClickable(settingY + Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.getMiddleOfBox(rectHeight) - 1) - && DrRenderUtils.isHovering((float) (x + width - (Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.stringWidth(bind) + 7)), - settingY + Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.getMiddleOfBox(rectHeight) - 1, (float) (Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.stringWidth(bind) + 4), - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.getHeight() + 4, mouseX, mouseY); - - if (type == GuiEvents.CLICK && hoveringBindRect && button == 0) { - binding = module; - return; - } - Animation[] animations = keySettingAnimMap.get(module); - - animations[1].setDirection(binding == module ? Direction.FORWARDS : Direction.BACKWARDS); - - Fonts.SF.SF_18.SF_18.drawString("Bind", x + 5, - settingY + Fonts.SF.SF_18.SF_18.getMiddleOfBox(rectHeight) + 1, - textColor.getRGB()); - - - animations[0].setDirection(hoveringBindRect ? Direction.FORWARDS : Direction.BACKWARDS); - - - RoundedUtil.drawRound((float) (x + width - (Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.stringWidth(bind) + 9)), - settingY + Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.getMiddleOfBox(rectHeight) - 1, (float) (Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.stringWidth(bind) + 5), - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.getHeight() + 3.5f, 5, DrRenderUtils.applyOpacity(darkRectHover, (float) (.4 + (.2 * animations[0].getOutput())))); - - Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.drawString(bind, x + width - (Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.stringWidth(bind) + 6), - settingY + Fonts.SFBOLD.SFBOLD_18.SFBOLD_18.getMiddleOfBox(rectHeight) + 1, - DrRenderUtils.interpolateColor(textColor.getRGB(), accentedColor2.getRGB(), (float) animations[1].getOutput())); - - - */ - count++; - } - settingSize = count; - // settingSize = count; - } - - - @Override - public void drawScreen(int mouseX, int mouseY) { - handle(mouseX, mouseY, -1, GuiEvents.DRAW); - } - - @Override - public void mouseClicked(int mouseX, int mouseY, int button) { - handle(mouseX, mouseY, button, GuiEvents.CLICK); - } - - @Override - public void mouseReleased(int mouseX, int mouseY, int state) { - handle(mouseX, mouseY, state, GuiEvents.RELEASE); - } - - - public boolean isClickable(float y) { - return y > panelLimitY && y < panelLimitY + 17 + Main.allowedClickGuiHeight; - } -}