The title screen, the menus and the HUD menus (emote wheel, shift menu) each get a scale slider, relative to Minecraft's GUI scale. The HUD editor stays in GUI pixels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
66 lines
2.4 KiB
Java
66 lines
2.4 KiB
Java
package org.saturnclient.ui.screens;
|
|
|
|
import org.saturnclient.common.provider.Providers;
|
|
import org.saturnclient.config.AnimationConfig;
|
|
import org.saturnclient.config.Config;
|
|
import org.saturnclient.config.property.FloatProperty;
|
|
import org.saturnclient.ui.SaturnScreen;
|
|
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.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
|
|
protected FloatProperty getScaleSetting() {
|
|
return Config.hudMenuScale;
|
|
}
|
|
|
|
@Override
|
|
public void ui() {
|
|
draw(new ImageTexture(Textures.LOGO_TEXT)
|
|
.dimensions(98, 10)
|
|
.center(width, height, 0, -36)
|
|
.animation(new Fade(AnimationConfig.logo.duration.value)));
|
|
|
|
draw(new ImageTexture(Config.getLogo())
|
|
.dimensions(98, 98)
|
|
.center(width, height, 0, -80)
|
|
.animation(new SlideY(AnimationConfig.logo, -20)));
|
|
|
|
AnimationStagger stagger = new AnimationStagger(AnimationConfig.shiftMenu.stagger.value);
|
|
int x = 0;
|
|
|
|
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("Mods", () -> 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 IconButton(Textures.ICON_COSMETICS,
|
|
() -> Providers.saturn.getClient().setScreen(new CosmeticsMenu()))
|
|
.position(x, 0).animation(new Fade(AnimationConfig.shiftMenu)));
|
|
x += Button.HEIGHT;
|
|
|
|
draw(stagger.position((width - x) / 2, (height - Button.HEIGHT) / 2));
|
|
}
|
|
}
|