updated the title screen with the new ui
This commit is contained in:
@@ -34,7 +34,6 @@ public abstract class SaturnScreen extends Screen {
|
|||||||
|
|
||||||
public SaturnScreen(String title) {
|
public SaturnScreen(String title) {
|
||||||
super(Text.literal(title));
|
super(Text.literal(title));
|
||||||
ThemeManager.load();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw(Element element) {
|
public void draw(Element element) {
|
||||||
@@ -45,12 +44,6 @@ public abstract class SaturnScreen extends Screen {
|
|||||||
if (element.animation != null) {
|
if (element.animation != null) {
|
||||||
element.animation.init(element);
|
element.animation.init(element);
|
||||||
|
|
||||||
try {
|
|
||||||
Thread.sleep(25);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Animation.execute((Float progress) -> {
|
Animation.execute((Float progress) -> {
|
||||||
element.animation.tick(progress, element);
|
element.animation.tick(progress, element);
|
||||||
}, element.animation.duration);
|
}, element.animation.duration);
|
||||||
@@ -62,12 +55,7 @@ public abstract class SaturnScreen extends Screen {
|
|||||||
width *= 2;
|
width *= 2;
|
||||||
height *= 2;
|
height *= 2;
|
||||||
ui(); // abstraction to render the saturn ui and also render extra stuff here
|
ui(); // abstraction to render the saturn ui and also render extra stuff here
|
||||||
|
ThemeManager.load();
|
||||||
try {
|
|
||||||
Thread.sleep(25);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Animation.execute((Float progress) -> {
|
Animation.execute((Float progress) -> {
|
||||||
blurProgress = progress;
|
blurProgress = progress;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.saturnclient.ui2.screens;
|
package org.saturnclient.ui2.screens;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
|
import org.saturnclient.saturnclient.SaturnClientConfig;
|
||||||
import org.saturnclient.saturnclient.menus.CloaksMenu;
|
import org.saturnclient.saturnclient.menus.CloaksMenu;
|
||||||
import org.saturnclient.saturnclient.menus.HudEditor;
|
import org.saturnclient.saturnclient.menus.HudEditor;
|
||||||
import org.saturnclient.saturnclient.menus.ModMenu;
|
import org.saturnclient.saturnclient.menus.ModMenu;
|
||||||
@@ -20,8 +21,8 @@ public class ShiftMenu extends SaturnScreen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ui() {
|
public void ui() {
|
||||||
draw(new ImageTexture(Textures.LOGO).dimensions(98, 98).centerOffset(width, height, 0, -80).animation(new SlideY(700, -40)));
|
|
||||||
draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 16).centerOffset(width, height, 0, -36).animation(new Fade(700)));
|
draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 16).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, -40)));
|
||||||
|
|
||||||
Element button = new Button("Settings", () -> {
|
Element button = new Button("Settings", () -> {
|
||||||
SaturnClient.client.setScreen(new ModMenu());
|
SaturnClient.client.setScreen(new ModMenu());
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package org.saturnclient.ui2.screens;
|
||||||
|
|
||||||
|
import org.saturnclient.saturnclient.SaturnClientConfig;
|
||||||
|
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 net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
||||||
|
import net.minecraft.client.gui.screen.world.SelectWorldScreen;
|
||||||
|
|
||||||
|
public class TitleMenu extends SaturnScreen {
|
||||||
|
public TitleMenu() {
|
||||||
|
super("Tile Menu");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ui() {
|
||||||
|
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)));
|
||||||
|
|
||||||
|
draw(new Button("SINGLEPLAYER", () -> {
|
||||||
|
client.setScreen(new SelectWorldScreen(new TitleMenu()));
|
||||||
|
}).scale(0.69f).dimensions(420, 52).centerOffset(width, height, 0, 0));
|
||||||
|
|
||||||
|
draw(new Button("MULTIPLAYER", () -> {
|
||||||
|
client.setScreen(new MultiplayerScreen(new TitleMenu()));
|
||||||
|
}).scale(0.69f).dimensions(420, 52).centerOffset(width, height, 0, 40));
|
||||||
|
|
||||||
|
draw(new Button("OPTIONS", () -> {
|
||||||
|
client.setScreen(new MultiplayerScreen(new TitleMenu()));
|
||||||
|
}).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));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user