[Client] Address tournament UI review feedback

- Drop the in-game tournament-settings button: Command_TournamentSettingsSelect
  has no server handler (RespContextError), the host-ness decision was evaluated
  once at tab construction, and the button never received a label on first show.
  The dialog can be re-added together with a working Server_Player override.
- Pass PlayerManager::isSpectator() to TournamentWidget instead of relying on
  localPlayerId == -1, which never holds for spectators.
- Report games per match as the total series length (Best of %1) to match the
  DlgTournamentSettings hint and the server's use of the value; the previous
  gamesPerMatch * 2 - 1 mislabeled Bo3 as Best of 5.
- Block signals around read-only tournamentCheckBox setChecked so the disabled
  settings button is not re-enabled, and seed Command_CreateGame through
  mutable_tournament_settings() (field 15 became the settings message).
- return after closing a sub-game that routed to its parent tab.
This commit is contained in:
Lukas Brübach 2026-09-02 11:35:23 +02:00 committed by GitHub
parent c5fd10087a
commit 55099ab82c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 21 additions and 55 deletions

View file

@ -15,6 +15,7 @@
#include <QPushButton>
#include <QRadioButton>
#include <QSet>
#include <QSignalBlocker>
#include <QSpinBox>
#include <libcockatrice/protocol/pb/serverinfo_game.pb.h>
#include <libcockatrice/protocol/pending_command.h>
@ -233,7 +234,10 @@ DlgCreateGame::DlgCreateGame(const ServerInfo_Game &gameInfo, const QMap<int, QS
spectatorsCanTalkCheckBox->setChecked(gameInfo.spectators_can_chat());
spectatorsSeeEverythingCheckBox->setChecked(gameInfo.spectators_omniscient());
shareDecklistsOnLoadCheckBox->setChecked(gameInfo.share_decklists_on_load());
tournamentCheckBox->setChecked(gameInfo.is_tournament());
{
const QSignalBlocker blocker(tournamentCheckBox);
tournamentCheckBox->setChecked(gameInfo.is_tournament());
}
QSet<int> types;
for (int i = 0; i < gameInfo.game_types_size(); ++i) {
@ -305,7 +309,7 @@ void DlgCreateGame::actOK()
cmd.set_share_decklists_on_load(shareDecklistsOnLoadCheckBox->isChecked());
cmd.set_is_tournament(tournamentCheckBox->isChecked());
if (tournamentCheckBox->isChecked()) {
cmd.set_games_per_match(tournamentSettings.gamesPerMatch);
cmd.mutable_tournament_settings()->set_games_per_match(tournamentSettings.gamesPerMatch);
}
auto _gameTypes = QString();