mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
* Add local game options dialog. Introduces LocalGameOptions struct and DlgLocalGameOptions dialog to replace the previous QInputDialog for starting local games. Encapsulates game configuration with a simple interface that prevents parameter explosion as options are added. The dialog provides UI with settings persistence via SettingsCache * integrate local game options into main window. Replaces QInputDialog with DlgLocalGameOptions in actSinglePlayer(). The startLocalGame() function now accepts LocalGameOptions, enabling configuration of starting life total and spectator visibility in addition to player count. Also adds user documentation for the local game options flow. * Removed superfluous documentation file * removed spectator option and moved structure definition * Now remember settings separately and & shortcuts removed * re-run checks
53 lines
1 KiB
C++
53 lines
1 KiB
C++
/**
|
|
* @file dlg_local_game_options.h
|
|
* @ingroup RoomDialogs
|
|
* @brief Dialog for configuring local game options.
|
|
*
|
|
* Provides a user interface for setting up local games with configurable
|
|
* number of players and starting life total.
|
|
*/
|
|
|
|
#ifndef DLG_LOCAL_GAME_OPTIONS_H
|
|
#define DLG_LOCAL_GAME_OPTIONS_H
|
|
|
|
#include <QDialog>
|
|
|
|
struct LocalGameOptions
|
|
{
|
|
int numberPlayers = 1;
|
|
int startingLifeTotal = 20;
|
|
};
|
|
|
|
class QCheckBox;
|
|
class QDialogButtonBox;
|
|
class QGroupBox;
|
|
class QLabel;
|
|
class QSpinBox;
|
|
|
|
class DlgLocalGameOptions : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DlgLocalGameOptions(QWidget *parent = nullptr);
|
|
|
|
[[nodiscard]] LocalGameOptions getOptions() const;
|
|
|
|
private slots:
|
|
void actOK();
|
|
|
|
private:
|
|
QGroupBox *generalGroupBox;
|
|
QGroupBox *gameSetupOptionsGroupBox;
|
|
|
|
QLabel *numberPlayersLabel;
|
|
QSpinBox *numberPlayersEdit;
|
|
|
|
QLabel *startingLifeTotalLabel;
|
|
QSpinBox *startingLifeTotalEdit;
|
|
|
|
QCheckBox *rememberSettingsCheckBox;
|
|
|
|
QDialogButtonBox *buttonBox;
|
|
};
|
|
|
|
#endif // DLG_LOCAL_GAME_OPTIONS_H
|