From cd5cac7f6923697d1b5a1ba347ba0dac4db145af Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sun, 22 Feb 2026 03:36:39 +0100 Subject: [PATCH] Shift menu animations --- .../saturnclient/ui2/screens/ShiftMenu.java | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/saturnclient/ui2/screens/ShiftMenu.java b/src/main/java/org/saturnclient/ui2/screens/ShiftMenu.java index 5d5448f..350a6a1 100644 --- a/src/main/java/org/saturnclient/ui2/screens/ShiftMenu.java +++ b/src/main/java/org/saturnclient/ui2/screens/ShiftMenu.java @@ -5,8 +5,8 @@ import org.saturnclient.saturnclient.config.SaturnClientConfig; import org.saturnclient.saturnclient.menus.HudEditor; import org.saturnclient.ui2.resources.Textures; import org.saturnclient.ui2.screens.cosmetics.CloakMenu; -import org.saturnclient.ui2.Element; import org.saturnclient.ui2.SaturnScreen; +import org.saturnclient.ui2.elements.AnimationStagger; import org.saturnclient.ui2.elements.Button; import org.saturnclient.ui2.elements.ImageTexture; import org.saturnclient.ui2.elements.TextureButton; @@ -20,21 +20,42 @@ public class ShiftMenu extends SaturnScreen { @Override public void ui() { - draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 10).centerOffset(width, height, 0, -36).animation(new Fade(700))); - draw(new ImageTexture(SaturnClientConfig.getLogo()).dimensions(98, 98).centerOffset(width, height, 0, -80).animation(new SlideY(700, -20))); + // Logo animations (unchanged) + draw(new ImageTexture(Textures.LOGO_TEXT) + .dimensions(98, 10) + .centerOffset(width, height, 0, -36) + .animation(new Fade(700))); - Element button = new Button("Settings", () -> { - SaturnClient.client.setScreen(new ModMenu()); - }).center(width, height); + draw(new ImageTexture(SaturnClientConfig.getLogo()) + .dimensions(98, 98) + .centerOffset(width, height, 0, -80) + .animation(new SlideY(700, -20))); - draw(button); + // Spacing and sizes + int btnWidth = 120; + int btnHeight = 40; + int spacing = 4; - draw(new TextureButton(Textures.COSMETICS, () -> { - client.setScreen(new CloakMenu()); - }).dimensions(button.height, button.height).centerOffset(width, height, (button.width / 2) + (button.height / 2) + 4, 0)); + // Create stagger + AnimationStagger stagger = new AnimationStagger(120); - draw(new TextureButton(Textures.HUD_ICON, () -> { + stagger.draw(new TextureButton(Textures.HUD_ICON, () -> { client.setScreen(new HudEditor()); - }).dimensions(button.height, button.height).centerOffset(width, height, -((button.width / 2) + (button.height / 2) + 4), 0)); + }).dimensions(btnHeight, btnHeight).position(0, 0) + .animation(new Fade(300))); + + stagger.draw(new Button("Settings", () -> { + SaturnClient.client.setScreen(new ModMenu()); + }).dimensions(btnWidth, btnHeight).position(btnHeight + spacing, 0) + .animation(new Fade(300))); + + stagger.draw(new TextureButton(Textures.COSMETICS, () -> { + client.setScreen(new CloakMenu()); + }).dimensions(btnHeight, btnHeight).position(btnWidth + btnHeight + (spacing * 2), 0) + .animation(new Fade(300))); + + // Draw the stagger at the absolute center of the screen + draw(stagger.dimensions(btnWidth + (btnHeight * 2) + (spacing * 2), btnHeight).centerOffset(width, height, 0, + 0)); } }