From 908cebed24cd34e23477f640cd34051937dba352 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sat, 8 Jul 2023 12:54:11 +0600 Subject: [PATCH] Lite Edition --- .../java/net/silentclient/client/Client.java | 56 ++++++++++++++++++- .../client/admin/AdminRender.java | 6 +- .../client/config/AddConfigModal.java | 4 +- .../client/config/ConfigManager.java | 49 ++-------------- .../client/cosmetics/gui/CosmeticsGui.java | 4 +- .../silentclient/client/gui/ModalBase.java | 4 +- .../client/gui/elements/Checkbox.java | 2 +- .../client/gui/elements/ColorPicker.java | 2 +- .../client/gui/elements/Input.java | 3 +- .../client/gui/elements/Select.java | 2 +- .../client/gui/elements/Slider.java | 4 +- .../client/gui/elements/StaticButton.java | 2 +- .../client/gui/elements/Switch.java | 2 +- .../client/gui/friends/AddFriendModal.java | 2 +- .../gui/friends/FriendsListOverlay.java | 4 +- .../client/gui/hud/HUDConfigScreen.java | 7 +-- .../client/gui/{ => lite}/GuiNews.java | 7 +-- .../LiteMainMenu.java} | 15 ++--- .../gui/{ => lite}/clickgui/ClickGUI.java | 6 +- .../{ => lite}/clickgui/GuiColorPicker.java | 8 +-- .../gui/{ => lite}/clickgui/ModSettings.java | 8 +-- .../{ => lite}/clickgui/utils/GlUtils.java | 2 +- .../{ => lite}/clickgui/utils/MouseUtils.java | 2 +- .../clickgui/utils/RenderUtils.java | 2 +- .../client/gui/minecraft/GuiIngameMenu.java | 8 +-- .../client/gui/modmenu/ModMenu.java | 6 ++ .../gui/silentmainmenu/SilentMainMenu.java | 25 ++++----- .../silentclient/client/gui/theme/Theme.java | 7 ++- .../client/mixin/mixins/GuiChatMixin.java | 2 +- .../client/mixin/mixins/GuiInGameMixin.java | 2 +- .../client/mixin/mixins/MinecraftMixin.java | 13 ++++- .../net/silentclient/client/mods/HudMod.java | 2 +- .../client/mods/ModDraggable.java | 3 +- .../client/mods/hud/ArmorStatusMod.java | 2 +- .../client/mods/hud/BlockInfoMod.java | 4 +- .../client/mods/hud/CoordinatesMod.java | 2 +- .../client/mods/hud/KeystrokesMod.java | 4 +- .../client/mods/hud/MouseStrokesMod.java | 2 +- .../client/mods/player/AutoTextMod.java | 6 +- .../mods/player/DonationsAlertsMod.java | 2 +- .../client/mods/render/CrosshairMod.java | 6 +- .../client/mods/settings/GeneralMod.java | 5 +- .../client/premium/PremiumCosmeticsGui.java | 3 +- .../client/premium/PremiumGui.java | 8 +-- .../silentclient/client/utils/HUDCaching.java | 2 +- .../client/utils/types/GlobalSettings.java | 43 ++++++++++++++ 46 files changed, 208 insertions(+), 152 deletions(-) rename src/main/java/net/silentclient/client/gui/{ => lite}/GuiNews.java (95%) rename src/main/java/net/silentclient/client/gui/{minecraft/GuiMainMenu.java => lite/LiteMainMenu.java} (97%) rename src/main/java/net/silentclient/client/gui/{ => lite}/clickgui/ClickGUI.java (99%) rename src/main/java/net/silentclient/client/gui/{ => lite}/clickgui/GuiColorPicker.java (96%) rename src/main/java/net/silentclient/client/gui/{ => lite}/clickgui/ModSettings.java (98%) rename src/main/java/net/silentclient/client/gui/{ => lite}/clickgui/utils/GlUtils.java (97%) rename src/main/java/net/silentclient/client/gui/{ => lite}/clickgui/utils/MouseUtils.java (90%) rename src/main/java/net/silentclient/client/gui/{ => lite}/clickgui/utils/RenderUtils.java (98%) create mode 100644 src/main/java/net/silentclient/client/gui/modmenu/ModMenu.java create mode 100644 src/main/java/net/silentclient/client/utils/types/GlobalSettings.java diff --git a/src/main/java/net/silentclient/client/Client.java b/src/main/java/net/silentclient/client/Client.java index 2c523da..5bb6efe 100644 --- a/src/main/java/net/silentclient/client/Client.java +++ b/src/main/java/net/silentclient/client/Client.java @@ -3,6 +3,7 @@ package net.silentclient.client; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.resources.data.IMetadataSerializer; import net.minecraft.util.ResourceLocation; @@ -15,9 +16,11 @@ import net.silentclient.client.event.impl.ConnectToServerEvent; import net.silentclient.client.event.impl.ServerLeaveEvent; import net.silentclient.client.event.impl.SingleplayerJoinEvent; import net.silentclient.client.gui.GuiError; -import net.silentclient.client.gui.GuiNews; -import net.silentclient.client.gui.clickgui.ClickGUI; +import net.silentclient.client.gui.lite.GuiNews; +import net.silentclient.client.gui.lite.clickgui.ClickGUI; import net.silentclient.client.gui.font.SilentFontRenderer; +import net.silentclient.client.gui.lite.LiteMainMenu; +import net.silentclient.client.gui.silentmainmenu.SilentMainMenu; import net.silentclient.client.gui.util.BackgroundPanorama; import net.silentclient.client.keybinds.KeyBindManager; import net.silentclient.client.mods.ModInstances; @@ -82,6 +85,8 @@ public class Client { private KeyBindManager keyBindManager; private IMetadataSerializer iMetadataSerializer; private MouseCursorHandler mouseCursorHandler; + private GlobalSettings globalSettings; + private File globalSettingsFile; public static void memoryDebug(String paramString) { LogManager.getLogger().info("-- Start Memory Debug -- " + paramString); @@ -94,7 +99,7 @@ public class Client { LogManager.getLogger().info("-- End Memory Debug -- " + paramString); } - public void init() { + public void init() throws IOException { try { InputStream in = getClass().getResourceAsStream("/build_data.json"); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); @@ -156,6 +161,10 @@ public class Client { if (!dir.exists()) { dir.mkdirs(); } + globalSettingsFile = new File(Minecraft.getMinecraft().mcDataDir, "silent_settings.json"); + if(!globalSettingsFile.exists()) { + globalSettingsFile.createNewFile(); + } logger.info("INITIALISING > event-manager"); EventManager.register(this); logger.info("INITIALISING > silent-socket"); @@ -187,6 +196,25 @@ public class Client { settingsManager = new SettingsManager(); logger.info("STARTING > mod-instances"); modInstances = new ModInstances(); + logger.info("STARTING > global-settings"); + globalSettings = new GlobalSettings(); + try { + InputStream in = new FileInputStream(getGlobalSettingsFile()); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + StringBuffer content = new StringBuffer(); + String inputLine; + while ((inputLine = reader.readLine()) != null) { + content.append(inputLine); + } + + globalSettings.setConfig(new JSONObject(content.toString()).getString("config")); + globalSettings.setLite(new JSONObject(content.toString()).getBoolean("lite")); + in.close(); + } catch (Exception err) { + Client.logger.catching(err); + } + + globalSettings.save(); logger.info("STARTING > config-manager"); configManager = new ConfigManager(); logger.info("STARTING > texture-manager"); @@ -274,7 +302,14 @@ public class Client { logger.info("STARTING > mouse-cursor-handler"); this.mouseCursorHandler = new MouseCursorHandler(); + + if(globalSettings.lite) { + Minecraft.getMinecraft().displayGuiScreen(new GuiNews()); + } else { + Minecraft.getMinecraft().displayGuiScreen(new SilentMainMenu()); + } } catch(Exception err) { + Client.logger.catching(err); logger.info("STARTING > ERROR: " + err.getMessage()); throw err; } @@ -573,4 +608,19 @@ public class Client { public MouseCursorHandler getMouseCursorHandler() { return mouseCursorHandler; } + + public GlobalSettings getGlobalSettings() { + return globalSettings; + } + + public File getGlobalSettingsFile() { + return globalSettingsFile; + } + + public GuiScreen getMainMenu() { + if(Client.getInstance().getGlobalSettings() == null) { + return new SilentMainMenu(); + } + return Client.getInstance().getGlobalSettings().isLite() ? new LiteMainMenu() : new SilentMainMenu(); + } } diff --git a/src/main/java/net/silentclient/client/admin/AdminRender.java b/src/main/java/net/silentclient/client/admin/AdminRender.java index 04eb1e4..7b39443 100644 --- a/src/main/java/net/silentclient/client/admin/AdminRender.java +++ b/src/main/java/net/silentclient/client/admin/AdminRender.java @@ -21,9 +21,9 @@ import net.silentclient.client.Client; import net.silentclient.client.cosmetics.AnimatedResourceLocation; import net.silentclient.client.cosmetics.ShieldData; import net.silentclient.client.cosmetics.gui.CosmeticsGui; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.StaticButton; import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.CustomFontRenderer.RenderMode; diff --git a/src/main/java/net/silentclient/client/config/AddConfigModal.java b/src/main/java/net/silentclient/client/config/AddConfigModal.java index f497407..0b08076 100644 --- a/src/main/java/net/silentclient/client/config/AddConfigModal.java +++ b/src/main/java/net/silentclient/client/config/AddConfigModal.java @@ -1,6 +1,5 @@ package net.silentclient.client.config; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; @@ -9,13 +8,12 @@ import net.silentclient.client.Client; import net.silentclient.client.gui.SilentScreen; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.IconButton; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.Checkbox; import net.silentclient.client.gui.elements.Input; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.notification.NotificationManager; import net.silentclient.client.gui.theme.Theme; -import net.silentclient.client.mods.settings.GeneralMod; import net.silentclient.client.utils.MenuBlurUtils; import net.silentclient.client.utils.NotificationUtils; import org.lwjgl.input.Keyboard; diff --git a/src/main/java/net/silentclient/client/config/ConfigManager.java b/src/main/java/net/silentclient/client/config/ConfigManager.java index dcc35b9..e591874 100644 --- a/src/main/java/net/silentclient/client/config/ConfigManager.java +++ b/src/main/java/net/silentclient/client/config/ConfigManager.java @@ -25,44 +25,12 @@ import net.silentclient.client.utils.MenuBlurUtils; public final class ConfigManager { public File configFile; - private final File settingsFile; private Set configs; public ConfigManager() { updateConfigs(); - settingsFile = new File(Minecraft.getMinecraft().mcDataDir, "silent_settings.txt"); - if(!settingsFile.exists()) { - try { - settingsFile.createNewFile(); - try(PrintWriter writer = new PrintWriter(this.settingsFile)) { - writer.println("config:config.txt"); - } catch (Exception err) { - err.printStackTrace(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - String config = "config.txt"; - - try (BufferedReader reader = new BufferedReader(new FileReader(this.settingsFile))) { - String s; - while ((s = reader.readLine()) != null) { - String[] args = s.split(":"); - if(s.toLowerCase().startsWith("config:")) { - try { - if(!args[1].equals(settingsFile.getName())) { - config = args[1]; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } catch (Exception err) { - err.printStackTrace(); - } + String config = Client.getInstance().getGlobalSettings().getConfig(); configFile = new File(Client.getInstance().dir, config); @@ -100,11 +68,7 @@ public final class ConfigManager { public void loadConfig(String name) { Client.logger.info("Loading Config: " + name); - try(PrintWriter writer = new PrintWriter(this.settingsFile)) { - writer.println("config:" + name); - } catch (Exception err) { - err.printStackTrace(); - } + Client.getInstance().getGlobalSettings().setConfig(name); configFile = new File(Client.getInstance().dir, name); if(!configFile.exists()) { try { @@ -122,6 +86,7 @@ public final class ConfigManager { } } NotificationManager.clear(); + Client.getInstance().getGlobalSettings().save(); } public String newConfig(String name, boolean clone) { @@ -138,12 +103,8 @@ public final class ConfigManager { return "Error: " + e.getMessage(); } } - try(PrintWriter writer = new PrintWriter(this.settingsFile)) { - writer.println("config:" + name); - } catch (Exception err) { - Client.logger.catching(err); - return "Error: " + err.getMessage(); - } + Client.getInstance().getGlobalSettings().setConfig(name); + Client.getInstance().getGlobalSettings().save(); configFile = testConfig; if(!clone) { Client.getInstance().getModInstances().getMods().forEach(mod -> mod.reset(true)); diff --git a/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java b/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java index f50b773..60b50a9 100644 --- a/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java +++ b/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java @@ -12,8 +12,8 @@ import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.gui.SilentScreen; import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils.Scroll; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils.Scroll; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.Input; import net.silentclient.client.gui.font.SilentFontRenderer; diff --git a/src/main/java/net/silentclient/client/gui/ModalBase.java b/src/main/java/net/silentclient/client/gui/ModalBase.java index a071620..875f925 100644 --- a/src/main/java/net/silentclient/client/gui/ModalBase.java +++ b/src/main/java/net/silentclient/client/gui/ModalBase.java @@ -5,17 +5,15 @@ import java.io.IOException; import net.silentclient.client.utils.MenuBlurUtils; import org.lwjgl.input.Keyboard; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.notification.NotificationManager; import net.silentclient.client.gui.theme.Theme; -import net.silentclient.client.mods.settings.GeneralMod; public class ModalBase extends GuiScreen { private final GuiScreen parentScreen; diff --git a/src/main/java/net/silentclient/client/gui/elements/Checkbox.java b/src/main/java/net/silentclient/client/gui/elements/Checkbox.java index 43d90e0..157e8c7 100644 --- a/src/main/java/net/silentclient/client/gui/elements/Checkbox.java +++ b/src/main/java/net/silentclient/client/gui/elements/Checkbox.java @@ -1,7 +1,7 @@ package net.silentclient.client.gui.elements; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.theme.checkbox.DefaultCheckboxTheme; import net.silentclient.client.gui.theme.checkbox.ICheckboxTheme; diff --git a/src/main/java/net/silentclient/client/gui/elements/ColorPicker.java b/src/main/java/net/silentclient/client/gui/elements/ColorPicker.java index ca35be3..ca1f147 100644 --- a/src/main/java/net/silentclient/client/gui/elements/ColorPicker.java +++ b/src/main/java/net/silentclient/client/gui/elements/ColorPicker.java @@ -1,7 +1,7 @@ package net.silentclient.client.gui.elements; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.util.RenderUtil; diff --git a/src/main/java/net/silentclient/client/gui/elements/Input.java b/src/main/java/net/silentclient/client/gui/elements/Input.java index 43f7151..7708609 100644 --- a/src/main/java/net/silentclient/client/gui/elements/Input.java +++ b/src/main/java/net/silentclient/client/gui/elements/Input.java @@ -4,7 +4,7 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ChatAllowedCharacters; import net.minecraft.util.EnumChatFormatting; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.theme.input.DefaultInputTheme; import net.silentclient.client.gui.theme.input.IInputTheme; @@ -14,7 +14,6 @@ import net.silentclient.client.utils.NotificationUtils; import org.apache.commons.lang3.StringUtils; import org.lwjgl.input.Keyboard; -import java.awt.*; import java.util.regex.Pattern; public class Input { diff --git a/src/main/java/net/silentclient/client/gui/elements/Select.java b/src/main/java/net/silentclient/client/gui/elements/Select.java index b20ff7b..72e85ff 100644 --- a/src/main/java/net/silentclient/client/gui/elements/Select.java +++ b/src/main/java/net/silentclient/client/gui/elements/Select.java @@ -1,7 +1,7 @@ package net.silentclient.client.gui.elements; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.utils.ColorUtils; diff --git a/src/main/java/net/silentclient/client/gui/elements/Slider.java b/src/main/java/net/silentclient/client/gui/elements/Slider.java index 66a1c01..c704feb 100644 --- a/src/main/java/net/silentclient/client/gui/elements/Slider.java +++ b/src/main/java/net/silentclient/client/gui/elements/Slider.java @@ -1,8 +1,8 @@ package net.silentclient.client.gui.elements; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import org.lwjgl.input.Mouse; diff --git a/src/main/java/net/silentclient/client/gui/elements/StaticButton.java b/src/main/java/net/silentclient/client/gui/elements/StaticButton.java index 6350e64..7c401ef 100644 --- a/src/main/java/net/silentclient/client/gui/elements/StaticButton.java +++ b/src/main/java/net/silentclient/client/gui/elements/StaticButton.java @@ -2,7 +2,7 @@ package net.silentclient.client.gui.elements; import net.minecraft.client.renderer.GlStateManager; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.gui.theme.button.DefaultButtonTheme; diff --git a/src/main/java/net/silentclient/client/gui/elements/Switch.java b/src/main/java/net/silentclient/client/gui/elements/Switch.java index fc82a84..fdfd40b 100644 --- a/src/main/java/net/silentclient/client/gui/elements/Switch.java +++ b/src/main/java/net/silentclient/client/gui/elements/Switch.java @@ -1,7 +1,7 @@ package net.silentclient.client.gui.elements; import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.theme.switches.DefaultSwitchTheme; import net.silentclient.client.gui.theme.switches.ISwitchSchema; import net.silentclient.client.gui.util.RenderUtil; diff --git a/src/main/java/net/silentclient/client/gui/friends/AddFriendModal.java b/src/main/java/net/silentclient/client/gui/friends/AddFriendModal.java index 0bf8fdc..5c28058 100644 --- a/src/main/java/net/silentclient/client/gui/friends/AddFriendModal.java +++ b/src/main/java/net/silentclient/client/gui/friends/AddFriendModal.java @@ -6,7 +6,7 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.gui.SilentScreen; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.elements.Input; diff --git a/src/main/java/net/silentclient/client/gui/friends/FriendsListOverlay.java b/src/main/java/net/silentclient/client/gui/friends/FriendsListOverlay.java index c0a1192..c9aabbf 100644 --- a/src/main/java/net/silentclient/client/gui/friends/FriendsListOverlay.java +++ b/src/main/java/net/silentclient/client/gui/friends/FriendsListOverlay.java @@ -7,8 +7,8 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.font.SilentFontRenderer; diff --git a/src/main/java/net/silentclient/client/gui/hud/HUDConfigScreen.java b/src/main/java/net/silentclient/client/gui/hud/HUDConfigScreen.java index ff7aeea..db26ed6 100644 --- a/src/main/java/net/silentclient/client/gui/hud/HUDConfigScreen.java +++ b/src/main/java/net/silentclient/client/gui/hud/HUDConfigScreen.java @@ -16,11 +16,10 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.ModSettings; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.ModSettings; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.font.SilentFontRenderer.FontType; import net.silentclient.client.mods.CustomFontRenderer; diff --git a/src/main/java/net/silentclient/client/gui/GuiNews.java b/src/main/java/net/silentclient/client/gui/lite/GuiNews.java similarity index 95% rename from src/main/java/net/silentclient/client/gui/GuiNews.java rename to src/main/java/net/silentclient/client/gui/lite/GuiNews.java index 424c743..548ac91 100644 --- a/src/main/java/net/silentclient/client/gui/GuiNews.java +++ b/src/main/java/net/silentclient/client/gui/lite/GuiNews.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui; +package net.silentclient.client.gui.lite; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -9,9 +9,8 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.elements.Button; -import net.silentclient.client.gui.minecraft.GuiMainMenu; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.utils.SCTextureManager; import net.silentclient.client.utils.TimerUtils; @@ -89,7 +88,7 @@ public class GuiNews extends GuiScreen { @Override protected void actionPerformed(GuiButton button) throws IOException { if(button.id == 1) { - mc.displayGuiScreen(new GuiMainMenu()); + mc.displayGuiScreen(new LiteMainMenu()); } } diff --git a/src/main/java/net/silentclient/client/gui/minecraft/GuiMainMenu.java b/src/main/java/net/silentclient/client/gui/lite/LiteMainMenu.java similarity index 97% rename from src/main/java/net/silentclient/client/gui/minecraft/GuiMainMenu.java rename to src/main/java/net/silentclient/client/gui/lite/LiteMainMenu.java index 37be777..2a2726e 100644 --- a/src/main/java/net/silentclient/client/gui/minecraft/GuiMainMenu.java +++ b/src/main/java/net/silentclient/client/gui/lite/LiteMainMenu.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.minecraft; +package net.silentclient.client.gui.lite; import java.io.IOException; import java.net.URI; @@ -24,14 +24,13 @@ import net.minecraft.world.storage.ISaveFormat; import net.minecraft.world.storage.WorldInfo; import net.silentclient.client.Client; import net.silentclient.client.cosmetics.gui.CosmeticsGui; -import net.silentclient.client.gui.GuiNews; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.util.RenderUtil; -public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback +public class LiteMainMenu extends GuiScreen implements GuiYesNoCallback { private static final Logger logger = LogManager.getLogger(); private static final Random RANDOM = new Random(); @@ -80,7 +79,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback /** Minecraft Realms button. */ private GuiButton realmsButton; - public GuiMainMenu() { + public LiteMainMenu() { this.openGLWarning2 = field_96138_a; this.splashText = ""; this.setUpdateCounter(RANDOM.nextFloat()); @@ -94,7 +93,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback } } - public GuiMainMenu(boolean firstTime) + public LiteMainMenu(boolean firstTime) { this.openGLWarning2 = field_96138_a; this.splashText = ""; @@ -222,6 +221,8 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback } if(button.id == 89) { + Client.getInstance().getGlobalSettings().setLite(false); + Client.getInstance().getGlobalSettings().save(); mc.displayGuiScreen(new SilentMainMenu()); } @@ -328,7 +329,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback f = f * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32); GlStateManager.scale(f, f, f); GlStateManager.popMatrix(); - String s = "Silent Client 1.8.9"; + String s = "SC Lite 1.8.9"; if (this.mc.isDemo()) { diff --git a/src/main/java/net/silentclient/client/gui/clickgui/ClickGUI.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/ClickGUI.java similarity index 99% rename from src/main/java/net/silentclient/client/gui/clickgui/ClickGUI.java rename to src/main/java/net/silentclient/client/gui/lite/clickgui/ClickGUI.java index 9b9a399..53ca412 100644 --- a/src/main/java/net/silentclient/client/gui/clickgui/ClickGUI.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/ClickGUI.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.clickgui; +package net.silentclient.client.gui.lite.clickgui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.ScaledResolution; @@ -12,8 +12,8 @@ import net.silentclient.client.gui.animation.SimpleAnimation; import net.silentclient.client.gui.animation.normal.Animation; import net.silentclient.client.gui.animation.normal.Direction; import net.silentclient.client.gui.animation.normal.impl.EaseBackIn; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.Input; import net.silentclient.client.gui.elements.Switch; diff --git a/src/main/java/net/silentclient/client/gui/clickgui/GuiColorPicker.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java similarity index 96% rename from src/main/java/net/silentclient/client/gui/clickgui/GuiColorPicker.java rename to src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java index f27aef0..d8bbd77 100644 --- a/src/main/java/net/silentclient/client/gui/clickgui/GuiColorPicker.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.clickgui; +package net.silentclient.client.gui.lite.clickgui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -7,9 +7,9 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.gui.animation.normal.Direction; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.Checkbox; import net.silentclient.client.gui.elements.Slider; diff --git a/src/main/java/net/silentclient/client/gui/clickgui/ModSettings.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java similarity index 98% rename from src/main/java/net/silentclient/client/gui/clickgui/ModSettings.java rename to src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java index dcb6414..03b5c95 100644 --- a/src/main/java/net/silentclient/client/gui/clickgui/ModSettings.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/ModSettings.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.clickgui; +package net.silentclient.client.gui.lite.clickgui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -10,9 +10,9 @@ import net.silentclient.client.Client; import net.silentclient.client.gui.SilentScreen; import net.silentclient.client.gui.animation.SimpleAnimation; import net.silentclient.client.gui.animation.normal.Direction; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils.Scroll; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils.Scroll; import net.silentclient.client.gui.elements.*; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.hud.HUDConfigScreen; diff --git a/src/main/java/net/silentclient/client/gui/clickgui/utils/GlUtils.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/utils/GlUtils.java similarity index 97% rename from src/main/java/net/silentclient/client/gui/clickgui/utils/GlUtils.java rename to src/main/java/net/silentclient/client/gui/lite/clickgui/utils/GlUtils.java index 0ab5f7e..4328b37 100644 --- a/src/main/java/net/silentclient/client/gui/clickgui/utils/GlUtils.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/utils/GlUtils.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.clickgui.utils; +package net.silentclient.client.gui.lite.clickgui.utils; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/net/silentclient/client/gui/clickgui/utils/MouseUtils.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/utils/MouseUtils.java similarity index 90% rename from src/main/java/net/silentclient/client/gui/clickgui/utils/MouseUtils.java rename to src/main/java/net/silentclient/client/gui/lite/clickgui/utils/MouseUtils.java index d2a3904..b9a04ba 100644 --- a/src/main/java/net/silentclient/client/gui/clickgui/utils/MouseUtils.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/utils/MouseUtils.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.clickgui.utils; +package net.silentclient.client.gui.lite.clickgui.utils; import org.lwjgl.input.Mouse; diff --git a/src/main/java/net/silentclient/client/gui/clickgui/utils/RenderUtils.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/utils/RenderUtils.java similarity index 98% rename from src/main/java/net/silentclient/client/gui/clickgui/utils/RenderUtils.java rename to src/main/java/net/silentclient/client/gui/lite/clickgui/utils/RenderUtils.java index a7309eb..bbfc79a 100644 --- a/src/main/java/net/silentclient/client/gui/clickgui/utils/RenderUtils.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/utils/RenderUtils.java @@ -1,4 +1,4 @@ -package net.silentclient.client.gui.clickgui.utils; +package net.silentclient.client.gui.lite.clickgui.utils; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/net/silentclient/client/gui/minecraft/GuiIngameMenu.java b/src/main/java/net/silentclient/client/gui/minecraft/GuiIngameMenu.java index 700dc7e..5a44c09 100644 --- a/src/main/java/net/silentclient/client/gui/minecraft/GuiIngameMenu.java +++ b/src/main/java/net/silentclient/client/gui/minecraft/GuiIngameMenu.java @@ -18,7 +18,7 @@ import net.silentclient.client.event.impl.ServerLeaveEvent; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.GuiMultiplayerInGame; -import net.silentclient.client.gui.clickgui.ClickGUI; +import net.silentclient.client.gui.lite.clickgui.ClickGUI; import net.silentclient.client.gui.friends.FriendsListOverlay; import net.silentclient.client.gui.hud.Watermark; import net.silentclient.client.mods.ModCategory; @@ -87,16 +87,16 @@ public class GuiIngameMenu extends GuiScreen if (flag) { - this.mc.displayGuiScreen(new GuiMainMenu()); + this.mc.displayGuiScreen(Client.getInstance().getMainMenu()); } else if (flag1) { RealmsBridge realmsbridge = new RealmsBridge(); - realmsbridge.switchToRealms(new GuiMainMenu()); + realmsbridge.switchToRealms(Client.getInstance().getMainMenu()); } else { - this.mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu())); + this.mc.displayGuiScreen(new GuiMultiplayer(Client.getInstance().getMainMenu())); } new ServerLeaveEvent().call(); diff --git a/src/main/java/net/silentclient/client/gui/modmenu/ModMenu.java b/src/main/java/net/silentclient/client/gui/modmenu/ModMenu.java new file mode 100644 index 0000000..775eee2 --- /dev/null +++ b/src/main/java/net/silentclient/client/gui/modmenu/ModMenu.java @@ -0,0 +1,6 @@ +package net.silentclient.client.gui.modmenu; + +import net.silentclient.client.gui.SilentScreen; + +public class ModMenu extends SilentScreen { +} diff --git a/src/main/java/net/silentclient/client/gui/silentmainmenu/SilentMainMenu.java b/src/main/java/net/silentclient/client/gui/silentmainmenu/SilentMainMenu.java index e45a472..09f70c3 100644 --- a/src/main/java/net/silentclient/client/gui/silentmainmenu/SilentMainMenu.java +++ b/src/main/java/net/silentclient/client/gui/silentmainmenu/SilentMainMenu.java @@ -6,14 +6,13 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; -import net.silentclient.client.admin.AdminRender; import net.silentclient.client.cosmetics.gui.CosmeticsGui; -import net.silentclient.client.gui.GuiNews; +import net.silentclient.client.gui.lite.GuiNews; import net.silentclient.client.gui.SilentScreen; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.font.SilentFontRenderer; -import net.silentclient.client.gui.minecraft.GuiMainMenu; +import net.silentclient.client.gui.lite.LiteMainMenu; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.utils.SCTextureManager; @@ -29,19 +28,15 @@ public class SilentMainMenu extends SilentScreen { public static boolean loading = false; public static boolean initPanel = false; - private MenuButton singleplayerButton; - private MenuButton multiplayerButton; - private MenuButton quitGameButton; - @Override public void initGui() { super.initGui(); this.buttonList.clear(); Client.backgroundPanorama.updateWidthHeight(this.width, this.height); - this.buttonList.add(this.singleplayerButton = new MenuButton(1, this.width / 2 - 130, 40, "Singleplayer")); - this.buttonList.add(this.multiplayerButton = new MenuButton(2, this.width / 2 - 40, 40, "Multiplayer")); - this.buttonList.add(this.quitGameButton = new MenuButton(3, this.width / 2 + 50, 40, "Quit Game")); + this.buttonList.add(new MenuButton(1, this.width / 2 - 130, 40, "Singleplayer")); + this.buttonList.add(new MenuButton(2, this.width / 2 - 40, 40, "Multiplayer")); + this.buttonList.add(new MenuButton(3, this.width / 2 + 50, 40, "Quit Game")); } @Override @@ -79,7 +74,7 @@ public class SilentMainMenu extends SilentScreen { optionY += 15; this.drawOptionButton(mouseX, mouseY, blockX + 5, optionY, new ResourceLocation("silentclient/icons/language.png"), "Language"); optionY += 15; - this.drawOptionButton(mouseX, mouseY, blockX + 5, optionY, new ResourceLocation("silentclient/icons/back.png"), "Vanilla Menu"); + this.drawOptionButton(mouseX, mouseY, blockX + 5, optionY, new ResourceLocation("silentclient/icons/back.png"), "Lite Edition"); } private void drawOptionButton(int mouseX, int mouseY, int x, int y, ResourceLocation icon, String text) { @@ -181,7 +176,9 @@ public class SilentMainMenu extends SilentScreen { } optionY += 15; if(this.optionHovered(mouseX, mouseY, blockX, optionY)) { - mc.displayGuiScreen(new GuiMainMenu()); + Client.getInstance().getGlobalSettings().setLite(true); + Client.getInstance().getGlobalSettings().save(); + mc.displayGuiScreen(new LiteMainMenu()); } } diff --git a/src/main/java/net/silentclient/client/gui/theme/Theme.java b/src/main/java/net/silentclient/client/gui/theme/Theme.java index 61b5fc7..a2bdd23 100644 --- a/src/main/java/net/silentclient/client/gui/theme/Theme.java +++ b/src/main/java/net/silentclient/client/gui/theme/Theme.java @@ -1,10 +1,15 @@ package net.silentclient.client.gui.theme; +import net.silentclient.client.Client; + import java.awt.*; public class Theme { public static Color backgroundColor() { - return new Color(0, 0, 0, 127); + if(Client.getInstance().getGlobalSettings() != null && Client.getInstance().getGlobalSettings().isLite()) { + return new Color(0, 0, 0, 127); + } + return new Color(20, 20, 20); } public static Color borderColor() { diff --git a/src/main/java/net/silentclient/client/mixin/mixins/GuiChatMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/GuiChatMixin.java index a6a447c..c029383 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/GuiChatMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/GuiChatMixin.java @@ -4,7 +4,7 @@ import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.GuiTextField; import net.silentclient.client.Client; import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; import net.silentclient.client.mods.render.ChatMod; import net.silentclient.client.utils.calculator.ChatCalculator; import org.lwjgl.input.Keyboard; diff --git a/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java index df13e0a..2edf02b 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java @@ -11,7 +11,7 @@ import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.event.impl.EventRenderDamageTint; import net.silentclient.client.event.impl.RenderEvent; -import net.silentclient.client.gui.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; import net.silentclient.client.gui.notification.NotificationManager; import net.silentclient.client.mods.hud.BossBarMod; import net.silentclient.client.mods.hud.ScoreboardMod; diff --git a/src/main/java/net/silentclient/client/mixin/mixins/MinecraftMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/MinecraftMixin.java index 760a5a7..ac0ae9c 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/MinecraftMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/MinecraftMixin.java @@ -18,6 +18,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.WorldSettings; import net.silentclient.client.Client; import net.silentclient.client.event.impl.*; +import net.silentclient.client.gui.lite.GuiNews; +import net.silentclient.client.gui.lite.LiteMainMenu; import net.silentclient.client.gui.silentmainmenu.SilentMainMenu; import net.silentclient.client.gui.util.BackgroundPanorama; import net.silentclient.client.hooks.MinecraftHook; @@ -40,11 +42,12 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.io.File; +import java.io.IOException; @Mixin(Minecraft.class) public abstract class MinecraftMixin { @Inject(method = "startGame", at = @At("HEAD")) - public void initClient(CallbackInfo callbackInfo) { + public void initClient(CallbackInfo callbackInfo) throws IOException { Client.getInstance().init(); } @@ -59,7 +62,9 @@ public abstract class MinecraftMixin { if(Client.backgroundPanorama == null) { Client.backgroundPanorama = new BackgroundPanorama(Minecraft.getMinecraft()); } - displayGuiScreen(new SilentMainMenu()); + if(Client.getInstance().getGlobalSettings() != null) { + displayGuiScreen(Client.getInstance().getGlobalSettings().isLite() ? new GuiNews() : new SilentMainMenu()); + } } @Inject(method = "shutdownMinecraftApplet", at = @At("HEAD")) @@ -122,7 +127,9 @@ public abstract class MinecraftMixin { Client.backgroundPanorama = new BackgroundPanorama(Minecraft.getMinecraft()); } if(guiScreenIn instanceof GuiMainMenu) { - displayGuiScreen(new SilentMainMenu()); + if(Client.getInstance().getGlobalSettings() != null) { + displayGuiScreen(Client.getInstance().getGlobalSettings().isLite() ? new LiteMainMenu() : new SilentMainMenu()); + } return; } if(guiScreenIn instanceof GuiIngameMenu) { diff --git a/src/main/java/net/silentclient/client/mods/HudMod.java b/src/main/java/net/silentclient/client/mods/HudMod.java index 19c78a7..daaeed3 100644 --- a/src/main/java/net/silentclient/client/mods/HudMod.java +++ b/src/main/java/net/silentclient/client/mods/HudMod.java @@ -3,7 +3,7 @@ package net.silentclient.client.mods; import java.awt.Color; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.hud.ScreenPosition; public class HudMod extends ModDraggable { diff --git a/src/main/java/net/silentclient/client/mods/ModDraggable.java b/src/main/java/net/silentclient/client/mods/ModDraggable.java index 422ae33..22d3fe6 100644 --- a/src/main/java/net/silentclient/client/mods/ModDraggable.java +++ b/src/main/java/net/silentclient/client/mods/ModDraggable.java @@ -14,8 +14,7 @@ import net.minecraft.client.renderer.GlStateManager; import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.RenderEvent; -import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.hud.HUDConfigScreen; import net.silentclient.client.gui.hud.IRenderer; diff --git a/src/main/java/net/silentclient/client/mods/hud/ArmorStatusMod.java b/src/main/java/net/silentclient/client/mods/hud/ArmorStatusMod.java index 41aabd3..b335d30 100644 --- a/src/main/java/net/silentclient/client/mods/hud/ArmorStatusMod.java +++ b/src/main/java/net/silentclient/client/mods/hud/ArmorStatusMod.java @@ -8,7 +8,7 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; import net.silentclient.client.gui.hud.ScreenPosition; import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.ModCategory; diff --git a/src/main/java/net/silentclient/client/mods/hud/BlockInfoMod.java b/src/main/java/net/silentclient/client/mods/hud/BlockInfoMod.java index 6993d7c..36c57e7 100644 --- a/src/main/java/net/silentclient/client/mods/hud/BlockInfoMod.java +++ b/src/main/java/net/silentclient/client/mods/hud/BlockInfoMod.java @@ -15,8 +15,8 @@ import net.minecraft.potion.Potion; import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.hud.ScreenPosition; import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.ModCategory; diff --git a/src/main/java/net/silentclient/client/mods/hud/CoordinatesMod.java b/src/main/java/net/silentclient/client/mods/hud/CoordinatesMod.java index 27a1e42..f893f58 100644 --- a/src/main/java/net/silentclient/client/mods/hud/CoordinatesMod.java +++ b/src/main/java/net/silentclient/client/mods/hud/CoordinatesMod.java @@ -5,7 +5,7 @@ import java.awt.Color; import net.minecraft.util.BlockPos; import net.minecraft.world.chunk.Chunk; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.hud.ScreenPosition; import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.ModCategory; diff --git a/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java b/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java index 7b55c58..45fa065 100644 --- a/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java +++ b/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java @@ -11,8 +11,8 @@ import net.minecraft.client.settings.KeyBinding; import net.minecraft.util.EnumChatFormatting; import net.silentclient.client.Client; import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.hud.ScreenPosition; import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.ModCategory; diff --git a/src/main/java/net/silentclient/client/mods/hud/MouseStrokesMod.java b/src/main/java/net/silentclient/client/mods/hud/MouseStrokesMod.java index 13f8c18..2c89c44 100644 --- a/src/main/java/net/silentclient/client/mods/hud/MouseStrokesMod.java +++ b/src/main/java/net/silentclient/client/mods/hud/MouseStrokesMod.java @@ -9,7 +9,7 @@ import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.ClientTickEvent; import net.silentclient.client.gui.animation.SimpleAnimation; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.hud.ScreenPosition; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.mods.ModCategory; diff --git a/src/main/java/net/silentclient/client/mods/player/AutoTextMod.java b/src/main/java/net/silentclient/client/mods/player/AutoTextMod.java index 0094177..ee353ab 100644 --- a/src/main/java/net/silentclient/client/mods/player/AutoTextMod.java +++ b/src/main/java/net/silentclient/client/mods/player/AutoTextMod.java @@ -9,7 +9,6 @@ import net.silentclient.client.gui.SilentScreen; import net.silentclient.client.utils.MenuBlurUtils; import org.lwjgl.input.Keyboard; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; @@ -17,8 +16,8 @@ import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.KeyEvent; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.elements.Input; @@ -28,7 +27,6 @@ import net.silentclient.client.gui.theme.Theme; import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.ModCategory; -import net.silentclient.client.mods.settings.GeneralMod; import net.silentclient.client.utils.NotificationUtils; public class AutoTextMod extends Mod { diff --git a/src/main/java/net/silentclient/client/mods/player/DonationsAlertsMod.java b/src/main/java/net/silentclient/client/mods/player/DonationsAlertsMod.java index 6c5bb0f..67ca7df 100644 --- a/src/main/java/net/silentclient/client/mods/player/DonationsAlertsMod.java +++ b/src/main/java/net/silentclient/client/mods/player/DonationsAlertsMod.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import net.minecraft.client.Minecraft; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; import net.silentclient.client.gui.hud.ScreenPosition; import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.ModDraggable; diff --git a/src/main/java/net/silentclient/client/mods/render/CrosshairMod.java b/src/main/java/net/silentclient/client/mods/render/CrosshairMod.java index ab34969..945ba32 100644 --- a/src/main/java/net/silentclient/client/mods/render/CrosshairMod.java +++ b/src/main/java/net/silentclient/client/mods/render/CrosshairMod.java @@ -26,9 +26,9 @@ import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.RenderEvent; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.mods.CustomFontRenderer; diff --git a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java index f647cdb..93861d3 100644 --- a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java +++ b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java @@ -2,15 +2,12 @@ package net.silentclient.client.mods.settings; import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; -import net.silentclient.client.gui.clickgui.ClickGUI; +import net.silentclient.client.gui.lite.clickgui.ClickGUI; import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.Setting; import net.silentclient.client.utils.MenuBlurUtils; -import net.silentclient.client.utils.NotificationUtils; import net.silentclient.client.utils.OSUtil; import net.silentclient.client.utils.RawInputHandler; diff --git a/src/main/java/net/silentclient/client/premium/PremiumCosmeticsGui.java b/src/main/java/net/silentclient/client/premium/PremiumCosmeticsGui.java index 934e2c9..b3a25c4 100644 --- a/src/main/java/net/silentclient/client/premium/PremiumCosmeticsGui.java +++ b/src/main/java/net/silentclient/client/premium/PremiumCosmeticsGui.java @@ -4,14 +4,13 @@ import java.io.IOException; import java.time.LocalDate; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; -import net.silentclient.client.gui.GuiNews; +import net.silentclient.client.gui.lite.GuiNews; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.font.SilentFontRenderer.FontType; import net.silentclient.client.gui.util.RenderUtil; diff --git a/src/main/java/net/silentclient/client/premium/PremiumGui.java b/src/main/java/net/silentclient/client/premium/PremiumGui.java index dc52057..e9ae7f0 100644 --- a/src/main/java/net/silentclient/client/premium/PremiumGui.java +++ b/src/main/java/net/silentclient/client/premium/PremiumGui.java @@ -7,10 +7,10 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.gui.animation.normal.Direction; -import net.silentclient.client.gui.clickgui.ClickGUI; -import net.silentclient.client.gui.clickgui.utils.GlUtils; -import net.silentclient.client.gui.clickgui.utils.MouseUtils; -import net.silentclient.client.gui.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.lite.clickgui.ClickGUI; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; +import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.elements.Button; import net.silentclient.client.gui.elements.Checkbox; import net.silentclient.client.gui.elements.*; diff --git a/src/main/java/net/silentclient/client/utils/HUDCaching.java b/src/main/java/net/silentclient/client/utils/HUDCaching.java index 31f9d30..0b5bc92 100644 --- a/src/main/java/net/silentclient/client/utils/HUDCaching.java +++ b/src/main/java/net/silentclient/client/utils/HUDCaching.java @@ -18,7 +18,7 @@ import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.ClientTickEvent; -import net.silentclient.client.gui.clickgui.utils.GlUtils; +import net.silentclient.client.gui.lite.clickgui.utils.GlUtils; import net.silentclient.client.mods.render.CrosshairMod; import net.silentclient.client.mods.settings.FPSBoostMod; import net.silentclient.client.mods.settings.RenderMod; diff --git a/src/main/java/net/silentclient/client/utils/types/GlobalSettings.java b/src/main/java/net/silentclient/client/utils/types/GlobalSettings.java new file mode 100644 index 0000000..819aa26 --- /dev/null +++ b/src/main/java/net/silentclient/client/utils/types/GlobalSettings.java @@ -0,0 +1,43 @@ +package net.silentclient.client.utils.types; + +import net.silentclient.client.Client; + +import java.io.FileOutputStream; + +public class GlobalSettings { + public String config; + public boolean lite; + + public GlobalSettings() { + this.config = "config.txt"; + this.lite = false; + } + + public String getConfig() { + return config; + } + + public void setConfig(String config) { + this.config = config; + } + + public boolean isLite() { + return lite; + } + + public void setLite(boolean lite) { + this.lite = lite; + } + + public void save() { + try { + FileOutputStream outputStream = new FileOutputStream(Client.getInstance().getGlobalSettingsFile()); + byte[] strToBytes = Client.getInstance().getGson().toJson(this).toString().getBytes(); + outputStream.write(strToBytes); + + outputStream.close(); + } catch (Exception err) { + Client.logger.catching(err); + } + } +}