mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
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
67 lines
1.8 KiB
C++
67 lines
1.8 KiB
C++
/**
|
|
* @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
|