mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -07:00
feat(command-zone): add game creation UI
Implement UI components for configuring command zones when creating new games. New components: - GameZoneOptionsWidget: reusable widget for zone configuration - DlgLocalGameOptions: local game setup with command zone options Integration points: - DlgCreateGame: add command zone options to game creation dialog - WindowMain: wire up command zone configuration in game flow This allows players to: - Enable/disable command zones for a game - Select zone type (Commander, Companion, etc.) - Configure zone-specific options
This commit is contained in:
parent
437d2e4ed4
commit
4bd6ab56c5
9 changed files with 367 additions and 13 deletions
|
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file game_zone_options_widget.h
|
||||
* @ingroup RoomDialogs
|
||||
* @brief Reusable widget for Commander format zone options.
|
||||
*
|
||||
* This widget encapsulates the zone enable/disable checkboxes used in both
|
||||
* DlgCreateGame and DlgLocalGameOptions. It provides a simple interface
|
||||
* while hiding settings persistence details.
|
||||
*/
|
||||
|
||||
#ifndef GAME_ZONE_OPTIONS_WIDGET_H
|
||||
#define GAME_ZONE_OPTIONS_WIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QCheckBox;
|
||||
class QVBoxLayout;
|
||||
|
||||
/**
|
||||
* @class GameZoneOptionsWidget
|
||||
* @brief Widget for configuring Commander format zone options.
|
||||
*
|
||||
* Provides checkboxes for enabling command zone, companion zone, and
|
||||
* background zone. Handles settings persistence internally, so callers
|
||||
* don't need to know about SettingsCache keys or default values.
|
||||
*/
|
||||
class GameZoneOptionsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GameZoneOptionsWidget(QWidget *parent = nullptr);
|
||||
|
||||
[[nodiscard]] bool enableCommandZone() const;
|
||||
[[nodiscard]] bool enableCompanionZone() const;
|
||||
[[nodiscard]] bool enableBackgroundZone() const;
|
||||
|
||||
void setCommandZoneEnabled(bool enabled);
|
||||
void setCompanionZoneEnabled(bool enabled);
|
||||
void setBackgroundZoneEnabled(bool enabled);
|
||||
|
||||
void loadFromSettings();
|
||||
void saveToSettings();
|
||||
void resetToDefaults();
|
||||
|
||||
void setReadOnly(bool readOnly);
|
||||
|
||||
QCheckBox *getCommandZoneCheckBox() const
|
||||
{
|
||||
return enableCommandZoneCheckBox;
|
||||
}
|
||||
QCheckBox *getCompanionZoneCheckBox() const
|
||||
{
|
||||
return enableCompanionZoneCheckBox;
|
||||
}
|
||||
QCheckBox *getBackgroundZoneCheckBox() const
|
||||
{
|
||||
return enableBackgroundZoneCheckBox;
|
||||
}
|
||||
|
||||
private:
|
||||
QCheckBox *enableCommandZoneCheckBox;
|
||||
QCheckBox *enableCompanionZoneCheckBox;
|
||||
QCheckBox *enableBackgroundZoneCheckBox;
|
||||
};
|
||||
|
||||
#endif // GAME_ZONE_OPTIONS_WIDGET_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue