Merge pull request 'Fix the None cloak and reorder the sidebar and title dock' (#12) from release-fixes into master
Reviewed-on: #12
This commit was merged in pull request #12.
This commit is contained in:
@@ -38,7 +38,14 @@ public class Cloaks {
|
||||
availableCloaks.add(0, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* The cloak's texture, or null for no cloak ("", the "None" choice) and for a cloak this version
|
||||
* has no texture for, which would otherwise draw as the missing texture.
|
||||
*/
|
||||
public static IdentifierRef getCurrentCloakTexture(String cloakName) {
|
||||
if (cloakName == null || !Arrays.asList(ALL_CLOAKS).contains(cloakName)) {
|
||||
return null;
|
||||
}
|
||||
if (Arrays.asList(ANIMATED_CLOAKS).contains(cloakName)) {
|
||||
return IdentifierRef.ofSaturn("textures/cloaks/" + cloakName + ".gif");
|
||||
} else {
|
||||
|
||||
@@ -22,9 +22,9 @@ public class Sidebar extends Element {
|
||||
|
||||
// Values for the constructor's `active`
|
||||
public static final int MODS = 0;
|
||||
public static final int COSMETICS = 1;
|
||||
public static final int HUD_EDITOR = 2;
|
||||
public static final int SETTINGS = 3;
|
||||
public static final int SETTINGS = 1;
|
||||
public static final int COSMETICS = 2;
|
||||
public static final int HUD_EDITOR = 3;
|
||||
|
||||
private static final int LOGO = 32;
|
||||
private static final int BUTTON = 44;
|
||||
@@ -35,11 +35,12 @@ public class Sidebar extends Element {
|
||||
private record Item(IdentifierRef icon, Runnable onClick) {
|
||||
}
|
||||
|
||||
// In the order of the constants above
|
||||
private final Item[] items = {
|
||||
new Item(Textures.ICON_MODS, () -> Providers.saturn.getClient().setScreen(new ModMenu())),
|
||||
new Item(Textures.ICON_SETTINGS, () -> Providers.saturn.getClient().setScreen(new ClientSettings())),
|
||||
new Item(Textures.ICON_COSMETICS, () -> Providers.saturn.getClient().setScreen(new CosmeticsMenu())),
|
||||
new Item(Textures.ICON_HUD_EDITOR, () -> Providers.saturn.getClient().setScreen(new HudEditor())),
|
||||
new Item(Textures.ICON_SETTINGS, () -> Providers.saturn.getClient().setScreen(new ClientSettings())),
|
||||
};
|
||||
|
||||
private final int active;
|
||||
|
||||
@@ -26,8 +26,8 @@ import org.saturnclient.ui.resources.Textures;
|
||||
|
||||
/**
|
||||
* Saturn's title screen: the logo over the game's menus in the middle, the
|
||||
* player and a quit button in the top corners, and along the bottom a dock of
|
||||
* Saturn's screens, the shift menu and Minecraft's options, and the version.
|
||||
* player and a quit button in the top corners, and along the bottom a dock
|
||||
* (Saturn's settings, its mods and cosmetics, then Minecraft's options) and the version.
|
||||
*/
|
||||
public class TitleMenu extends SaturnScreen {
|
||||
// The logo and wordmark as the shift menu has them: the wordmark over the logo's foot
|
||||
@@ -106,12 +106,12 @@ public class TitleMenu extends SaturnScreen {
|
||||
.position(width - TOP_EDGE - QUIT_SIZE, TOP_EDGE)
|
||||
.animation(step(new SlideFade(AnimationConfig.mainMenu, 8), STEP_QUIT)));
|
||||
|
||||
// Along the bottom: the dock of Saturn's screens, the shift menu and Minecraft's options, and the version
|
||||
// Along the bottom: the dock, Saturn first (its settings) and Minecraft's options last, and the version
|
||||
Dock dock = new Dock(List.of(
|
||||
new Dock.Item(Textures.LOGO, () -> Providers.saturn.getClient().setScreen(new ClientSettings())),
|
||||
new Dock.Item(Textures.ICON_MODS, () -> Providers.saturn.getClient().setScreen(new ModMenu())),
|
||||
new Dock.Item(Textures.ICON_COSMETICS,
|
||||
() -> Providers.saturn.getClient().setScreen(new CosmeticsMenu())),
|
||||
new Dock.Item(Textures.LOGO, () -> Providers.saturn.getClient().setScreen(new ShiftMenu())),
|
||||
new Dock.Item(Textures.ICON_SETTINGS,
|
||||
() -> Providers.saturn.getClient().setScreen(MinecraftScreen.Options))));
|
||||
draw(dock.position((width - dock.width) / 2, height - EDGE - Dock.HEIGHT)
|
||||
|
||||
Reference in New Issue
Block a user