Built-in lobby screens
Three pre-baked screen builders, all in me.zlex.conduit.lobby.screen.builtin, that produce a ScreenContent for the most common lobby UIs. Each screen exposes stable button id constants for click routing.
When to use it
Section titled “When to use it”- You want the standard “lobby info panel” without building it yourself.
- You want host-editable world rules with the standard save/discard pattern.
- You want a podium-style end-of-game celebration screen.
package me.zlex.conduit.lobby.screen.builtin;
public final class LobbyScreen { public static final String BTN_START; public static final String BTN_LEAVE; public static ScreenContent build(Game game, List<String> playerNames, List<String> statusLines);}
public final class WinnerScreen { public static final String BTN_CONTINUE; public static final String BTN_LEAVE; public static ScreenContent build(String winnerName, String tagline, int accentArgb);}
public final class WorldSettingsScreen { public static final float WIDTH; // recommended panel width (world units) public static final float HEIGHT;
public static final String BTN_PVP, BTN_DAYLIGHT, BTN_WEATHER; public static final String BTN_SEED_TOGGLE, BTN_SEED_NEW; public static final String FIELD_SEED; public static final String BTN_VILLAGE; public static final String BTN_SAVE, BTN_DISCARD;
public static ScreenContent build(WorldSettings applied, WorldSettings pending);}All three return ScreenContent ready for ServerScreenManager.showWithId.
Example
Section titled “Example”import me.zlex.conduit.lobby.screen.builtin.LobbyScreen;import me.zlex.conduit.lobby.screen.builtin.WinnerScreen;import me.zlex.conduit.lobby.screen.builtin.WorldSettingsScreen;import me.zlex.conduit.screen.ServerScreenManager;import me.zlex.conduit.screen.placement.Placements;import me.zlex.conduit.world.WorldSettings;
public final class MyScreens {
private static final int ID_LOBBY = 7100; private static final int ID_SETTINGS = 7101; private static final int ID_WINNER = 7102;
public static void showLobby(ServerPlayer host, Game game, java.util.List<String> roster) { var place = Placements.inFrontOf(host, 2.5f); var content = LobbyScreen.build(game, roster, java.util.List.of()); ServerScreenManager.showWithId(host, ID_LOBBY, place, 4.5f, 4.0f, content);
ServerScreenManager.onButton(ID_LOBBY, (clicker, btn) -> { if (LobbyScreen.BTN_START.equals(btn)) MyRound.start(clicker); if (LobbyScreen.BTN_LEAVE.equals(btn)) MyLobby.leave(clicker); }); }
public static void showSettings(ServerPlayer host, WorldSettings applied, WorldSettings pending) { var place = Placements.inFrontOf(host, 2.5f); var content = WorldSettingsScreen.build(applied, pending); ServerScreenManager.showWithId(host, ID_SETTINGS, place, WorldSettingsScreen.WIDTH, WorldSettingsScreen.HEIGHT, content); }
public static void showWinner(ServerPlayer p, String winnerName, int accent) { var place = Placements.inFrontOf(p, 2.5f); var content = WinnerScreen.build(winnerName, "WINNER", accent); ServerScreenManager.showWithId(p, ID_WINNER, place, 3.5f, 4.5f, content); }}LobbyScreendoesn’t gate the START button — host-only logic is your responsibility. The screen just exposes the button id.WorldSettingsScreenshowspendingso the host sees their edits live; theDISCARDbutton only renders whenapplieddiffers frompending.WinnerScreenis a tall narrow panel intended for placement directly in front of the winner.