Restyle buttons, the Shift menu and the title screen
Button is now primary (accent fill) or secondary (a translucent outlined surface), and IconButton is a square secondary button with a Lucide icon, replacing the PNG TextureButtons. Neither is scaled with Element.scale any more, which multiplied click positions instead of dividing them. The Shift menu is the HUD editor, the mod menu (its button was labelled "Settings") and cosmetics. The title screen centers the logo over a compact stack of the game's menus, with the player, a dock of Saturn's screens and the version along the bottom. The player chip shows the player's face from their skin and whether they're connected to Saturn. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -8,18 +8,24 @@ import org.saturnclient.ui.anim.Fade;
|
||||
import org.saturnclient.ui.anim.SlideY;
|
||||
import org.saturnclient.ui.elements.AnimationStagger;
|
||||
import org.saturnclient.ui.elements.Button;
|
||||
import org.saturnclient.ui.elements.IconButton;
|
||||
import org.saturnclient.ui.elements.ImageTexture;
|
||||
import org.saturnclient.ui.elements.TextureButton;
|
||||
import org.saturnclient.ui.resources.Textures;
|
||||
|
||||
/**
|
||||
* The in-game quick menu: the logo over the HUD editor, mod menu and
|
||||
* cosmetics.
|
||||
*/
|
||||
public class ShiftMenu extends SaturnScreen {
|
||||
private static final int MODS_WIDTH = 120;
|
||||
private static final int GAP = 6;
|
||||
|
||||
public ShiftMenu() {
|
||||
super("Shift Menu");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ui() {
|
||||
// Logo animations (unchanged)
|
||||
draw(new ImageTexture(Textures.LOGO_TEXT)
|
||||
.dimensions(98, 10)
|
||||
.center(width, height, 0, -36)
|
||||
@@ -30,32 +36,24 @@ public class ShiftMenu extends SaturnScreen {
|
||||
.center(width, height, 0, -80)
|
||||
.animation(new SlideY(AnimationConfig.logo, -20)));
|
||||
|
||||
// Spacing and sizes
|
||||
int btnWidth = 120;
|
||||
int btnHeight = 40;
|
||||
int spacing = 4;
|
||||
|
||||
// Create stagger
|
||||
|
||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.shiftMenu.stagger.value);
|
||||
int x = 0;
|
||||
|
||||
stagger.draw(new TextureButton(Textures.HUD_ICON, () -> {
|
||||
Providers.saturn.getClient().setScreen(new HudEditor());
|
||||
}).dimensions(btnHeight, btnHeight).position(0, 0)
|
||||
.animation(new Fade(AnimationConfig.shiftMenu)));
|
||||
stagger.draw(new IconButton(Textures.ICON_HUD_EDITOR,
|
||||
() -> Providers.saturn.getClient().setScreen(new HudEditor()))
|
||||
.position(x, 0).animation(new Fade(AnimationConfig.shiftMenu)));
|
||||
x += Button.HEIGHT + GAP;
|
||||
|
||||
stagger.draw(new Button("Settings", () -> {
|
||||
Providers.saturn.getClient().setScreen(new ModMenu());
|
||||
}).dimensions(btnWidth, btnHeight).position(btnHeight + spacing, 0)
|
||||
.animation(new Fade(AnimationConfig.shiftMenu)));
|
||||
stagger.draw(new Button("Mods", true, () -> Providers.saturn.getClient().setScreen(new ModMenu()))
|
||||
.dimensions(MODS_WIDTH, Button.HEIGHT)
|
||||
.position(x, 0).animation(new Fade(AnimationConfig.shiftMenu)));
|
||||
x += MODS_WIDTH + GAP;
|
||||
|
||||
stagger.draw(new TextureButton(Textures.COSMETICS, () -> {
|
||||
Providers.saturn.getClient().setScreen(new CosmeticsMenu());
|
||||
}).dimensions(btnHeight, btnHeight).position(btnWidth + btnHeight + (spacing * 2), 0)
|
||||
.animation(new Fade(AnimationConfig.shiftMenu)));
|
||||
stagger.draw(new IconButton(Textures.ICON_COSMETICS,
|
||||
() -> Providers.saturn.getClient().setScreen(new CosmeticsMenu()))
|
||||
.position(x, 0).animation(new Fade(AnimationConfig.shiftMenu)));
|
||||
x += Button.HEIGHT;
|
||||
|
||||
// Draw the stagger at the absolute center of the screen
|
||||
draw(stagger.dimensions(btnWidth + (btnHeight * 2) + (spacing * 2), btnHeight).center(width, height, 0,
|
||||
0));
|
||||
draw(stagger.position((width - x) / 2, (height - Button.HEIGHT) / 2));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user