Skip to content

added that you can change num rounds in lobby screen that host can ch… #44

Merged
merged 1 commit into from
Apr 10, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ public void onFailure(Exception exception) {
}

/** Called by the host when they press Start Game. */
public void onStartGame(String sessionId, List<Player> players) {
public void onStartGame(String sessionId, List<Player> players, int rounds) {
numRounds = rounds;
int tracksNeeded = numRounds * OPTIONS_PER_Q;
game.getMusicService().fetchTracks(tracksNeeded, new MusicServiceCallback() {
@Override
Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/group07/beatbattle/view/LobbyView.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import group07.beatbattle.model.Player;
import group07.beatbattle.model.services.LobbyService;
import group07.beatbattle.ui.components.BackButton;
import group07.beatbattle.ui.components.RoundSelector;
import group07.beatbattle.ui.components.SettingsButton;
import group07.beatbattle.ui.components.StartGameButton;
import group07.beatbattle.ui.dialog.AlertDialogs;
Expand Down Expand Up @@ -339,16 +340,18 @@ private Table createFooter() {
Table footer = new Table();

if (mode == GameMode.CREATE) {
StartGameButton startButton = new StartGameButton(game.getMontserratFont());
RoundSelector roundSelector = new RoundSelector(game.getMontserratFont());

StartGameButton startButton = new StartGameButton(game.getMontserratFont());
startButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
controller.onStartGame(sessionId, currentPlayers);
controller.onStartGame(sessionId, currentPlayers, roundSelector.getSelectedRounds());
}
});

float btnWidth = Math.min(800f, Gdx.graphics.getWidth() - 80f);
footer.add(roundSelector.getActor()).width(btnWidth).padBottom(20f).row();
footer.add(startButton).width(btnWidth).height(150);
}

Expand Down
Loading