mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 17:44:01 -07:00
AsJudge
Took 4 minutes
This commit is contained in:
parent
be85b5bbe3
commit
7f536c5ff7
2 changed files with 6 additions and 6 deletions
|
|
@ -306,7 +306,7 @@ void GameSelector::customContextMenu(const QPoint &point)
|
||||||
menu.exec(gameListView->mapToGlobal(point));
|
menu.exec(gameListView->mapToGlobal(point));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameSelector::joinGame(const bool isSpectator, const bool isJudge)
|
void GameSelector::joinGame(const bool asSpectator, const bool asJudge)
|
||||||
{
|
{
|
||||||
QModelIndex ind = gameListView->currentIndex();
|
QModelIndex ind = gameListView->currentIndex();
|
||||||
if (!ind.isValid()) {
|
if (!ind.isValid()) {
|
||||||
|
|
@ -318,7 +318,7 @@ void GameSelector::joinGame(const bool isSpectator, const bool isJudge)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool spectator = isSpectator || game.player_count() == game.max_players();
|
bool spectator = asSpectator || game.player_count() == game.max_players();
|
||||||
|
|
||||||
bool overrideRestrictions = !tabSupervisor->getAdminLocked();
|
bool overrideRestrictions = !tabSupervisor->getAdminLocked();
|
||||||
QString password;
|
QString password;
|
||||||
|
|
@ -335,7 +335,7 @@ void GameSelector::joinGame(const bool isSpectator, const bool isJudge)
|
||||||
cmd.set_password(password.toStdString());
|
cmd.set_password(password.toStdString());
|
||||||
cmd.set_spectator(spectator);
|
cmd.set_spectator(spectator);
|
||||||
cmd.set_override_restrictions(overrideRestrictions);
|
cmd.set_override_restrictions(overrideRestrictions);
|
||||||
cmd.set_join_as_judge(isJudge);
|
cmd.set_join_as_judge(asJudge);
|
||||||
|
|
||||||
TabRoom *r = tabSupervisor->getRoomTabs().value(game.room_id());
|
TabRoom *r = tabSupervisor->getRoomTabs().value(game.room_id());
|
||||||
if (!r) {
|
if (!r) {
|
||||||
|
|
|
||||||
|
|
@ -159,12 +159,12 @@ private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Performs the join or spectate action for the currently selected game.
|
* @brief Performs the join or spectate action for the currently selected game.
|
||||||
* @param isSpectator True to join as a spectator, false to join as a player.
|
* @param asSpectator True to join as a spectator, false to join as a player.
|
||||||
* @param isJudge True to join as a judge, false to join as a player.
|
* @param asJudge True to join as a judge, false to join as a player.
|
||||||
*
|
*
|
||||||
* Handles password prompts, overrides, and sending the join command to the server.
|
* Handles password prompts, overrides, and sending the join command to the server.
|
||||||
*/
|
*/
|
||||||
void joinGame(bool isSpectator = false, bool isJudge = false);
|
void joinGame(bool asSpectator = false, bool asJudge = false);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue