mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 13:30:00 -08:00
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.
46 lines
874 B
C++
46 lines
874 B
C++
/**
|
|
* @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
|