Lite Edition

This commit is contained in:
kirillsaint 2023-07-08 12:54:11 +06:00
parent 2eb811c8f7
commit 908cebed24
46 changed files with 208 additions and 152 deletions

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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;

View File

@ -25,44 +25,12 @@ import net.silentclient.client.utils.MenuBlurUtils;
public final class ConfigManager {
public File configFile;
private final File settingsFile;
private Set<String> 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));

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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());
}
}

View File

@ -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())
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package net.silentclient.client.gui.clickgui.utils;
package net.silentclient.client.gui.lite.clickgui.utils;
import org.lwjgl.opengl.GL11;

View File

@ -1,4 +1,4 @@
package net.silentclient.client.gui.clickgui.utils;
package net.silentclient.client.gui.lite.clickgui.utils;
import org.lwjgl.input.Mouse;

View File

@ -1,4 +1,4 @@
package net.silentclient.client.gui.clickgui.utils;
package net.silentclient.client.gui.lite.clickgui.utils;
import org.lwjgl.opengl.GL11;

View File

@ -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();

View File

@ -0,0 +1,6 @@
package net.silentclient.client.gui.modmenu;
import net.silentclient.client.gui.SilentScreen;
public class ModMenu extends SilentScreen {
}

View File

@ -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());
}
}

View File

@ -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() {

View File

@ -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;

View File

@ -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;

View File

@ -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) {

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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.*;

View File

@ -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;

View File

@ -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);
}
}
}