From fd74dc3796a01cd6a492f18705bd741aa2d4f1d3 Mon Sep 17 00:00:00 2001 From: opZywl Date: Sun, 19 Nov 2023 00:03:17 +0000 Subject: [PATCH] Remove Subscriptions Script --- .../net/ccbluex/liquidbounce/FDPClient.kt | 17 - .../module/modules/client/ScriptGUI.kt | 18 - .../net/ccbluex/liquidbounce/script/Script.kt | 5 - .../ui/client/GuiImportConfig.java | 177 ------- .../gui/modernui/GuiScriptLoadMenu.java | 489 ------------------ .../client/gui/modernui/ScriptMenuType.java | 8 - .../gui/scriptOnline/OnlineScriptLoader.java | 20 - .../gui/scriptOnline/OnlineScriptManager.java | 9 - .../gui/scriptOnline/ScriptSubscribe.java | 29 -- .../gui/scriptOnline/Subscriptions.java | 17 - .../translations/es-ES/source.properties | 3 - 11 files changed, 792 deletions(-) delete mode 100644 src/main/java/net/ccbluex/liquidbounce/features/module/modules/client/ScriptGUI.kt delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/GuiImportConfig.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/modernui/GuiScriptLoadMenu.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/modernui/ScriptMenuType.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/scriptOnline/OnlineScriptLoader.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/scriptOnline/OnlineScriptManager.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/scriptOnline/ScriptSubscribe.java delete mode 100644 src/main/java/net/ccbluex/liquidbounce/ui/client/gui/scriptOnline/Subscriptions.java diff --git a/src/main/java/net/ccbluex/liquidbounce/FDPClient.kt b/src/main/java/net/ccbluex/liquidbounce/FDPClient.kt index 2ad841469f..a1f39696fd 100644 --- a/src/main/java/net/ccbluex/liquidbounce/FDPClient.kt +++ b/src/main/java/net/ccbluex/liquidbounce/FDPClient.kt @@ -18,8 +18,6 @@ import net.ccbluex.liquidbounce.ui.client.gui.EnumLaunchFilter import net.ccbluex.liquidbounce.ui.client.gui.LaunchFilterInfo import net.ccbluex.liquidbounce.ui.client.gui.LaunchOption import net.ccbluex.liquidbounce.ui.client.gui.GuiLaunchOptionSelectMenu -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.ScriptSubscribe -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.Subscriptions import net.ccbluex.liquidbounce.script.ScriptManager import net.ccbluex.liquidbounce.ui.cape.GuiCapeManager import net.ccbluex.liquidbounce.ui.client.hud.HUD @@ -68,7 +66,6 @@ object FDPClient { lateinit var moduleManager: ModuleManager lateinit var commandManager: CommandManager lateinit var eventManager: EventManager - private lateinit var subscriptions: Subscriptions lateinit var fileManager: FileManager lateinit var scriptManager: ScriptManager lateinit var tipSoundManager: TipSoundManager @@ -116,7 +113,6 @@ object FDPClient { // Initialize managers fileManager = FileManager() configManager = ConfigManager() - subscriptions = Subscriptions() eventManager = EventManager() commandManager = CommandManager() macroManager = MacroManager() @@ -179,19 +175,6 @@ object FDPClient { thread(block = this::checkUpdate) } - // Load script subscripts - ClientUtils.logInfo("Loading Script Subscripts...") - fileManager.subscriptsConfig.subscripts.forEach { subscript -> - Subscriptions.addSubscribes(ScriptSubscribe(subscript.url, subscript.name)) - } - scriptManager.disableScripts() - scriptManager.unloadScripts() - Subscriptions.subscribes.forEach { scriptSubscribe -> - scriptSubscribe.load() - } - scriptManager.loadScripts() - scriptManager.enableScripts() - // Set title ClientUtils.setTitle() diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/client/ScriptGUI.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/client/ScriptGUI.kt deleted file mode 100644 index c05678b6af..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/client/ScriptGUI.kt +++ /dev/null @@ -1,18 +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.features.module.modules.client - -import net.ccbluex.liquidbounce.features.module.Module -import net.ccbluex.liquidbounce.features.module.ModuleCategory -import net.ccbluex.liquidbounce.features.module.ModuleInfo -import net.ccbluex.liquidbounce.ui.client.gui.modernui.GuiScriptLoadMenu - -@ModuleInfo(name = "ScriptGUI", category = ModuleCategory.CLIENT, canEnable = false) -object ScriptGUI : Module() { - override fun onEnable() { - mc.displayGuiScreen(GuiScriptLoadMenu()) - } -} diff --git a/src/main/java/net/ccbluex/liquidbounce/script/Script.kt b/src/main/java/net/ccbluex/liquidbounce/script/Script.kt index c8640f3e96..b3e0a3beaa 100644 --- a/src/main/java/net/ccbluex/liquidbounce/script/Script.kt +++ b/src/main/java/net/ccbluex/liquidbounce/script/Script.kt @@ -7,7 +7,6 @@ import jdk.nashorn.api.scripting.ScriptUtils import net.ccbluex.liquidbounce.FDPClient import net.ccbluex.liquidbounce.features.command.Command import net.ccbluex.liquidbounce.features.module.Module -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.Subscriptions import net.ccbluex.liquidbounce.script.api.* import net.ccbluex.liquidbounce.script.api.global.Chat import net.ccbluex.liquidbounce.script.api.global.Notifications @@ -65,10 +64,6 @@ class Script(private val scriptFile: File) : MinecraftInstance() { // Global functions scriptEngine.put("registerScript", RegisterScript()) - if (Subscriptions.loadingCloud) { - scriptText = Subscriptions.tempJs - isOnline = true - } supportLegacyScripts() scriptEngine.eval(scriptText) diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiImportConfig.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiImportConfig.java deleted file mode 100644 index c5fef124fa..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/GuiImportConfig.java +++ /dev/null @@ -1,177 +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; - -import net.ccbluex.liquidbounce.FDPClient; -import net.ccbluex.liquidbounce.features.module.modules.client.button.FlatButtonRenderer; -import net.ccbluex.liquidbounce.font.FontLoaders; -import net.ccbluex.liquidbounce.ui.client.gui.modernui.GuiScriptLoadMenu; -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.ScriptSubscribe; -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.Subscriptions; -import net.ccbluex.liquidbounce.ui.client.hud.element.elements.Notification; -import net.ccbluex.liquidbounce.ui.client.hud.element.elements.NotifyType; -import net.ccbluex.liquidbounce.utils.ClientUtils; -import net.ccbluex.liquidbounce.utils.render.ColorManager; -import net.ccbluex.liquidbounce.utils.render.RenderUtils; -import net.minecraft.client.gui.*; - -import org.lwjgl.input.*; - -import java.awt.*; -import java.awt.datatransfer.Clipboard; -import java.awt.datatransfer.StringSelection; -import java.io.*; - -public class GuiImportConfig extends GuiScreen -{ - public static GuiTextField username; - public GuiButton loginButton; - public GuiButton freeButton; - public static boolean logined; - public static final boolean Passed; - public static String message; - public final double[] aaa={0,0,0,0,0,0}; - public GuiImportConfig() { - super(); - message = "Waitting..."; - } - - @Override - protected void actionPerformed(final GuiButton button) { - switch (button.id) { - case 1: - if (!username.getText().isEmpty()) { - try { - String url = username.getText(); - String name = username.getText().startsWith("https://") ? username.getText().substring(8,username.getText().replaceAll("https://","").indexOf("/")+8) : username.getText().startsWith("http://") ? username.getText().substring(7,username.getText().replaceAll("http://","").indexOf("/")+7) : "No name config"; - try { - Subscriptions.addSubscribes(new ScriptSubscribe(url, name)); - long startTime = System.currentTimeMillis(); - FDPClient.hud.addNotification(new Notification("Script Manager", "Reloading Scripts...", NotifyType.INFO, 1500, 500)); - FDPClient.scriptManager.disableScripts(); - FDPClient.scriptManager.unloadScripts(); - for (ScriptSubscribe scriptSubscribe : Subscriptions.subscribes) { - scriptSubscribe.load(); - } - FDPClient.scriptManager.loadScripts(); - FDPClient.scriptManager.enableScripts(); - FDPClient.hud.addNotification(new Notification("Script Manager", "Added Subscribe: " + name + " | " + url + " (" + (System.currentTimeMillis() - startTime) + "ms)", NotifyType.SUCCESS, 1500, 500)); - message = "Done!"; - ClientUtils.INSTANCE.setTitle(); - mc.displayGuiScreen(new GuiScriptLoadMenu()); - }catch (Exception e){ - e.printStackTrace(); - Subscriptions.subscribes.clear(); - message = "Subscribe Error."; - } - } catch (Exception e) { - e.printStackTrace(); - Subscriptions.subscribes.clear(); - message = "Error."; - } - }else { - message = "username is empty."; - mc.displayGuiScreen(this); - } - - break; - case 3: - try { - copyText(""); - }catch (Exception ignored){ - - } - break; - } - } - - @Override - public void drawScreen(int mouseX, int mouseY, float delta) { - aaa[0]=Math.pow(aaa[0]+1,0.96)-1; - FontLoaders.F18.drawString(FDPClient.CLIENT_NAME,10,10,new Color(255,255,255).getRGB()); - final int h; - final int Height = h = new ScaledResolution(this.mc).getScaledHeight(); - final int w; - final int Width = w = new ScaledResolution(this.mc).getScaledWidth(); - final FontRenderer var4 = this.mc.fontRendererObj; - final ScaledResolution s1 = new ScaledResolution(this.mc); - final ScaledResolution res = new ScaledResolution(this.mc); - drawBackground(0); - drawRect(0,0, (int) ((1-aaa[0])*(w/3 + 132)),h,new Color(31, 31, 31, 255).getRGB()); - RenderUtils.drawRect((float) ((1-aaa[0])*(w/3 + 130)), (float) 0, (float) ((1-aaa[0])*(w/3 + 132)),h, ColorManager.astolfoRainbow(1,50,1)); - username.drawTextBox(); - FontLoaders.F18.drawString(message, (float) ((1-aaa[0])*(15)), 15, new Color(200,200,200,150).getRGB()); - FontLoaders.F14.drawString("Tips: FDPCLIENT", (float) ((1-aaa[0])*(18))+4, this.height / 2 + 50, new Color(189, 189, 189).getRGB()); - FontLoaders.F14.drawString("You need to upload full body unlock link used by each developer", (float) ((1-aaa[0])*(18))+4, this.height / 2 + 58, new Color(189, 189, 189).getRGB()); - FontLoaders.F18.drawString(" URL:", (float) ((1-aaa[0])*(18)), this.height / 2 + 8, new Color(189, 189, 189).getRGB()); - FontLoaders.F40.drawString("LIFrame", (float) ((1-aaa[0])*(18)), this.height / 2 - 20, new Color(255, 255, 255).getRGB()); - super.drawScreen(mouseX, mouseY, delta); - } - public static void copyText(String v) { - StringSelection stringSelection = new StringSelection(v); - Clipboard clapboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - clapboard.setContents(stringSelection, null); - } - @Override - public void initGui() { - ClientUtils.INSTANCE.setTitle("Import Config"); - aaa[0]=5; - logined = false; - final FontRenderer var1 = this.mc.fontRendererObj; - final int var2 = this.height / 2; - super.initGui(); - this.loginButton = new FlatButtonRenderer(1, this.width/3 + 90, this.height / 2 + 20, 20, 20, "→", new Color(50,109,224).getRGB()); - this.freeButton = new FlatButtonRenderer(3, 20, this.height - 50, this.width/3 + 90, 20, "Copy Token", new Color(66,67,70).getRGB()); - this.buttonList.add(this.loginButton); //Designed By XiGua - this.buttonList.add(this.freeButton); - username = new GuiTextField(var2, var1, 20, this.height / 2 + 20, this.width/3 + 60, 20); - username.setMaxStringLength(114514); - username.setFocused(true); - Keyboard.enableRepeatEvents(true); - } - - @Override - protected void keyTyped(final char var1, final int var2) { - if (var1 == '\t') { - if (!username.isFocused()) { - username.setFocused(true); - } - else { - username.setFocused(username.isFocused()); - } - } - if (var1 == '\r') { - this.actionPerformed(this.buttonList.get(0)); - } - username.textboxKeyTyped(var1, var2); - } - - @Override - protected void mouseClicked(final int var1, final int var2, final int var3) { - try { - super.mouseClicked(var1, var2, var3); - } - catch (IOException var4) { - var4.printStackTrace(); - } - username.mouseClicked(var1, var2, var3); - } - - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - - @Override - public void updateScreen() { - username.updateCursorCounter(); - } - - static { - logined = false; - Passed = false; - } -} diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/modernui/GuiScriptLoadMenu.java b/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/modernui/GuiScriptLoadMenu.java deleted file mode 100644 index 00256ccad9..0000000000 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/gui/modernui/GuiScriptLoadMenu.java +++ /dev/null @@ -1,489 +0,0 @@ -package net.ccbluex.liquidbounce.ui.client.gui.modernui; - -import net.ccbluex.liquidbounce.FDPClient; -import net.ccbluex.liquidbounce.features.module.Module; -import net.ccbluex.liquidbounce.font.CFontRenderer; -import net.ccbluex.liquidbounce.font.FontLoaders; -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.ScriptSubscribe; -import net.ccbluex.liquidbounce.ui.client.gui.scriptOnline.Subscriptions; -import net.ccbluex.liquidbounce.script.Script; -import net.ccbluex.liquidbounce.ui.client.hud.element.elements.Notification; -import net.ccbluex.liquidbounce.ui.client.hud.element.elements.NotifyType; -import net.ccbluex.liquidbounce.utils.render.BlurUtils; -import net.ccbluex.liquidbounce.utils.render.EaseUtils; -import net.ccbluex.liquidbounce.utils.render.RenderUtils; -import net.ccbluex.liquidbounce.utils.render.SmoothRenderUtils; -import net.ccbluex.liquidbounce.utils.timer.MSTimer; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import javax.swing.*; -import java.awt.*; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - - -public class GuiScriptLoadMenu extends GuiScreen { - public final MSTimer timer1 = new MSTimer(); - public final MSTimer timer2 = new MSTimer(); - public int x = 20; - public int y = 20; - public int dragX; - public ScriptMenuType menuType = ScriptMenuType.Main; - public boolean drag; - public int dragY; - - public int scroll; - public int scrollTo; - public int scrollVelocity; - - @Override - public void initGui() { - ScaledResolution scaledResolution = new ScaledResolution(mc); - x = scaledResolution.getScaledWidth() / 2 - 250; - y = scaledResolution.getScaledHeight() / 2 - 150; - guiOpenTime = System.currentTimeMillis(); - - } - - public static boolean isClickSub = false; - - @Override - protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - if (mouseX > x - 2 && mouseX < x + 450 && mouseY > y - 2 && mouseY < y + 20) { - if (mouseButton == 0) { - drag = true; - dragX = mouseX - x; - dragY = mouseY - y; - } - } - if (mouseX > x + 8 && mouseX < x + 112 && mouseY > y + 108 && mouseY < y + 128) { - // Online - menuType = ScriptMenuType.Online; - } - if (mouseX > x + 8 && mouseX < x + 112 && mouseY > y + 137 && mouseY < y + 157) { - // Subscribes - menuType = ScriptMenuType.Subscribes; - } - if (mouseX > x + 8 && mouseX < x + 108 && mouseY > y + 79 && mouseY < y + 99) { - // Local - menuType = ScriptMenuType.Local; - } - if (mouseX > x + 8 && mouseX < x + 108 && mouseY > y + 50 && mouseY < y + 70) { - // Main - menuType = ScriptMenuType.Main; - } - if (menuType == ScriptMenuType.Local) { - if (mouseX > x + 450 && mouseX < x + 490 && mouseY > y + 280 && mouseY < y + 295) { - long startTime = System.currentTimeMillis(); - FDPClient.hud.addNotification(new Notification("Script Manager", "Reloading Scripts..", NotifyType.INFO, 1500, 500)); - - FDPClient.scriptManager.disableScripts(); - FDPClient.scriptManager.unloadScripts(); - for (ScriptSubscribe scriptSubscribe : Subscriptions.subscribes) { - scriptSubscribe.load(); - } - FDPClient.scriptManager.loadScripts(); - FDPClient.scriptManager.enableScripts(); - FDPClient.hud.addNotification(new Notification("Script Manager", "Reload Successful (" + (System.currentTimeMillis() - startTime) + "ms)", NotifyType.SUCCESS, 1500, 500)); - } - if (mouseX > x + 405 && mouseX < x + 445 && mouseY > y + 280 && mouseY < y + 295) { - FDPClient.scriptManager.disableScripts(); - FDPClient.scriptManager.unloadScripts(); - } - int i = 0; - try { - List