mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 21:40:00 -08:00
[Client] Add shuffle players option and turn order dialog
Adds the 'Shuffle players at start' checkbox to game creation and a host-only 'Set turn order...' action that opens a dialog to reorder or randomize the seats before the game starts. Seating changes are shown in the game's message log.
This commit is contained in:
parent
d2d65836ab
commit
17a1f8cf78
15 changed files with 312 additions and 1 deletions
46
cockatrice/src/interface/widgets/dialogs/dlg_turn_order.h
Normal file
46
cockatrice/src/interface/widgets/dialogs/dlg_turn_order.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* @file dlg_turn_order.h
|
||||
* @ingroup GameDialogs
|
||||
*/
|
||||
//! \todo Document this file.
|
||||
|
||||
#ifndef DLG_TURN_ORDER_H
|
||||
#define DLG_TURN_ORDER_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QStringList>
|
||||
|
||||
class QListWidget;
|
||||
class QPushButton;
|
||||
|
||||
class DlgTurnOrder : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QListWidget *listWidget;
|
||||
QPushButton *moveUpButton;
|
||||
QPushButton *moveDownButton;
|
||||
QPushButton *randomizeButton;
|
||||
bool randomizeRequested;
|
||||
|
||||
void moveSelected(int delta);
|
||||
void updateButtons();
|
||||
|
||||
private slots:
|
||||
void actMoveUp();
|
||||
void actMoveDown();
|
||||
void actRandomize();
|
||||
void actOk();
|
||||
void selectionChanged();
|
||||
|
||||
public:
|
||||
explicit DlgTurnOrder(const QStringList &_playerNames, QWidget *parent = nullptr);
|
||||
|
||||
[[nodiscard]] bool randomize() const
|
||||
{
|
||||
return randomizeRequested;
|
||||
}
|
||||
[[nodiscard]] QStringList order() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue