slight title menu changes
This commit is contained in:
@@ -36,6 +36,13 @@ public class Element {
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Element centerHorizontal(int w, int h, int offsetX, int offsetY) {
|
||||
this.x = (w - (int) (width * scale)) / 2 + offsetX;
|
||||
this.y = offsetY;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Element center(int w, int h) {
|
||||
this.centerOffset(w, h, 0, 0);
|
||||
return this;
|
||||
|
||||
@@ -22,6 +22,7 @@ public abstract class SaturnScreen extends Screen {
|
||||
protected List<Element> elements = new ArrayList<>();
|
||||
public int blurDuration = 700;
|
||||
public float blurProgress = 0.0f;
|
||||
public int backgroundBlur = 10;
|
||||
|
||||
protected static final CubeMapRenderer PANORAMA_RENDERER = new CubeMapRenderer(
|
||||
Identifier.of("saturnclient", "textures/gui/title/background/panorama"));
|
||||
@@ -78,7 +79,7 @@ public abstract class SaturnScreen extends Screen {
|
||||
Identifier.ofVanilla("blur"),
|
||||
DefaultFramebufferSet.MAIN_ONLY);
|
||||
if (postEffectProcessor != null) {
|
||||
postEffectProcessor.setUniforms("Radius", 10 * blurProgress);
|
||||
postEffectProcessor.setUniforms("Radius", backgroundBlur * blurProgress);
|
||||
postEffectProcessor.render(this.client.getFramebuffer(), this.pool);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
package org.saturnclient.ui2.screens;
|
||||
|
||||
import org.saturnclient.saturnclient.SaturnClient;
|
||||
import org.saturnclient.saturnclient.SaturnClientConfig;
|
||||
import org.saturnclient.saturnclient.menus.CloaksMenu;
|
||||
import org.saturnclient.saturnclient.menus.HudEditor;
|
||||
import org.saturnclient.saturnclient.menus.ModMenu;
|
||||
import org.saturnclient.ui.Textures;
|
||||
import org.saturnclient.ui2.SaturnScreen;
|
||||
import org.saturnclient.ui2.anim.Fade;
|
||||
import org.saturnclient.ui2.anim.SlideY;
|
||||
import org.saturnclient.ui2.elements.Button;
|
||||
import org.saturnclient.ui2.elements.ImageTexture;
|
||||
import org.saturnclient.ui2.elements.TextureButton;
|
||||
import org.saturnclient.ui2.resources.Fonts;
|
||||
|
||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
||||
import net.minecraft.client.gui.screen.option.OptionsScreen;
|
||||
import net.minecraft.client.gui.screen.world.SelectWorldScreen;
|
||||
|
||||
public class TitleMenu extends SaturnScreen {
|
||||
@@ -18,6 +25,8 @@ public class TitleMenu extends SaturnScreen {
|
||||
|
||||
@Override
|
||||
public void ui() {
|
||||
backgroundBlur = 0;
|
||||
|
||||
draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 16).centerOffset(width, height, 0, -40).animation(new Fade(700)));
|
||||
draw(new ImageTexture(SaturnClientConfig.getLogo()).dimensions(98, 98).centerOffset(width, height, 0, -82).animation(new SlideY(700, -40)));
|
||||
|
||||
@@ -30,11 +39,25 @@ public class TitleMenu extends SaturnScreen {
|
||||
}).scale(0.69f).dimensions(420, 52).centerOffset(width, height, 0, 40));
|
||||
|
||||
draw(new Button("OPTIONS", () -> {
|
||||
client.setScreen(new MultiplayerScreen(new TitleMenu()));
|
||||
client.setScreen(new OptionsScreen(new TitleMenu(), SaturnClient.client.options));
|
||||
}).scale(0.69f).dimensions(206, 52).centerOffset(width, height, -73, 80));
|
||||
|
||||
draw(new Button("QUIT", () -> {
|
||||
client.scheduleStop();
|
||||
}).scale(0.69f).dimensions(206, 52).centerOffset(width, height, 73, 80));
|
||||
|
||||
int s = Fonts.getHeight() + 20;
|
||||
|
||||
draw(new TextureButton(Textures.HUD_ICON, () -> {
|
||||
client.setScreen(new HudEditor());
|
||||
}).dimensions(s, s).centerHorizontal(width, height, -(s + 2), 8).animation(new SlideY(700, s + 8)));
|
||||
|
||||
draw(new TextureButton(Textures.SETTINGS, () -> {
|
||||
SaturnClient.client.setScreen(new ModMenu());
|
||||
}).dimensions(s, s).centerHorizontal(width, height, 0, 8).animation(new SlideY(700, s + 8)));
|
||||
|
||||
draw(new TextureButton(Textures.CLOAK, () -> {
|
||||
client.setScreen(new CloaksMenu());
|
||||
}).dimensions(s, s).centerHorizontal(width, height, s + 2, 8).animation(new SlideY(700, s + 8)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user