From 1e577ff52a66ebf2dea362c68556523df4dc5677 Mon Sep 17 00:00:00 2001 From: refactoring Date: Mon, 1 Jan 2024 23:19:28 -0500 Subject: [PATCH 01/37] (feat) promo animation in main menu --- .gitignore | 4 +++- .../gui/silentmainmenu/MainMenuConcept.java | 18 ++++++++++++++++-- .../gui/silentmainmenu/SilentMainMenu.java | 5 +++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a566d9d..678c4a7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,9 @@ autobuilder/temp/ .idea/modules.xml .idea/jarRepositories.xml .idea/compiler.xml -.idea/libraries/ +.idea/libraries +.idea/misc.xml +.idea/gradle.xml *.iws *.iml *.ipr diff --git a/src/main/java/net/silentclient/client/gui/silentmainmenu/MainMenuConcept.java b/src/main/java/net/silentclient/client/gui/silentmainmenu/MainMenuConcept.java index 9111640..2aad41b 100644 --- a/src/main/java/net/silentclient/client/gui/silentmainmenu/MainMenuConcept.java +++ b/src/main/java/net/silentclient/client/gui/silentmainmenu/MainMenuConcept.java @@ -11,6 +11,7 @@ import net.minecraft.util.ResourceLocation; import net.silentclient.client.Client; import net.silentclient.client.cosmetics.gui.CosmeticsGui; import net.silentclient.client.gui.SilentScreen; +import net.silentclient.client.gui.animation.SimpleAnimation; import net.silentclient.client.gui.elements.IconButton; import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.lite.LiteMainMenu; @@ -19,10 +20,12 @@ import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; import net.silentclient.client.gui.silentmainmenu.components.AccountPicker; import net.silentclient.client.gui.silentmainmenu.components.MenuOption; import net.silentclient.client.gui.theme.button.IButtonTheme; +import net.silentclient.client.gui.util.GlUtil; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.utils.MouseCursorHandler; import net.silentclient.client.utils.PromoController; import net.silentclient.client.utils.SCTextureManager; +import org.lwjgl.opengl.GL11; import java.awt.*; import java.awt.image.BufferedImage; @@ -36,6 +39,7 @@ public class MainMenuConcept extends SilentScreen { public static boolean loading = false; public static boolean initSkin = false; private AccountPicker accountPicker; + private final SimpleAnimation scaleAnimation = new SimpleAnimation(0f); @Override public void initGui() { @@ -99,13 +103,23 @@ public class MainMenuConcept extends SilentScreen { if(MouseUtils.isInside(mouseX, mouseY, 10, 10, 109, 63)) { cursorType = MouseCursorHandler.CursorType.POINTER; } - RenderUtils.drawRect(10, 10, 109, 63, -1); - RenderUtil.drawImage(PromoController.getResponse().getCurrentPanel().getImageLocation(), 12, 12, 105, 59, false); + RenderUtils.drawRect(11, 11, 107, 61, -1); + GL11.glEnable(GL11.GL_SCISSOR_TEST); + GlUtil.scissor(12, 12, 12 + 105, 12 + 59); + RenderUtil.drawImage(PromoController.getResponse().getCurrentPanel().getImageLocation(), 12 - scaleAnimation.getValue(), 12 - scaleAnimation.getValue(), 105 + (scaleAnimation.getValue() * 2), 59 + (scaleAnimation.getValue() * 2), false); + GL11.glDisable(GL11.GL_SCISSOR_TEST); + + if(MouseUtils.isInside(mouseX, mouseY, 12, 12, 105, 59)) { + scaleAnimation.setAnimation(10f, 15f); + } else { + scaleAnimation.setAnimation(0f, 15f); + } } else { PromoController.getResponse().getCurrentPanel().loadImage(); } } + Client.getInstance().getSilentFontRenderer().drawString(3, height - 14, "Silent Client 1.8.9", 12, SilentFontRenderer.FontType.TITLE); super.drawScreen(mouseX, mouseY, partialTicks); 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 6661a78..55ce49c 100644 --- a/src/main/java/net/silentclient/client/gui/silentmainmenu/SilentMainMenu.java +++ b/src/main/java/net/silentclient/client/gui/silentmainmenu/SilentMainMenu.java @@ -10,14 +10,17 @@ import net.silentclient.client.gui.font.SilentFontRenderer; import net.silentclient.client.gui.lite.LiteMainMenu; import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils; import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils; +import net.silentclient.client.gui.util.GlUtil; import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.utils.PromoController; +import org.lwjgl.opengl.GL11; import java.awt.*; import java.io.IOException; import java.net.URI; public class SilentMainMenu extends SilentScreen { + @Override public void initGui() { super.initGui(); @@ -51,6 +54,7 @@ public class SilentMainMenu extends SilentScreen { blockY = 70; } RenderUtils.drawRect(blockX, blockY, 320, 150, new Color(20, 20, 20).getRGB()); + if(PromoController.getResponse().getCurrentPanel() != null) { if(PromoController.getResponse().getCurrentPanel().getImageLocation() != null) { RenderUtil.drawImage(PromoController.getResponse().getCurrentPanel().getImageLocation(), blockX + 78, blockY + 10, 231, 130, false); @@ -59,6 +63,7 @@ public class SilentMainMenu extends SilentScreen { } } + int optionY = blockY + 10; this.drawOptionButton(mouseX, mouseY, blockX + 5, optionY, new ResourceLocation("silentclient/icons/settings/cosmetics.png"), "Cosmetics"); optionY += 15; From a87875e565cdf8f3054de9ad37d529f397f68d1b Mon Sep 17 00:00:00 2001 From: refactoring Date: Tue, 2 Jan 2024 01:26:49 -0500 Subject: [PATCH 02/37] (feat) Crosshair editor :3 --- .idea/gradle.xml | 2 +- .idea/misc.xml | 2 +- .../client/gui/lite/clickgui/ModSettings.java | 2 +- .../client/gui/modmenu/CellGrid.java | 38 +++++++++++++ .../client/gui/modmenu/ModSettings.java | 7 ++- .../client/mixin/mixins/GuiInGameMixin.java | 2 +- .../net/silentclient/client/mods/Mod.java | 6 ++- .../client/mods/ModInstances.java | 1 + .../net/silentclient/client/mods/Setting.java | 32 +++++++++++ .../client/mods/SettingsManager.java | 3 +- .../client/mods/render/HitboxesMod.java | 1 + .../mods/render/crosshair/CLayoutManager.java | 42 +++++++++++++++ .../render/{ => crosshair}/CrosshairMod.java | 53 +++++++++++++++++-- .../silentclient/client/utils/HUDCaching.java | 2 +- 14 files changed, 180 insertions(+), 13 deletions(-) create mode 100644 src/main/java/net/silentclient/client/gui/modmenu/CellGrid.java create mode 100644 src/main/java/net/silentclient/client/mods/render/crosshair/CLayoutManager.java rename src/main/java/net/silentclient/client/mods/render/{ => crosshair}/CrosshairMod.java (92%) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index f772f20..be307cf 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,7 +5,7 @@