(feat) promo animation in main menu

This commit is contained in:
refactoring 2024-01-01 23:19:28 -05:00
parent a32b19afe8
commit 1e577ff52a
3 changed files with 24 additions and 3 deletions

4
.gitignore vendored
View File

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

View File

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

View File

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