Cockatrice/cockatrice/src/game_graphics/player/menu/command_zone_menu.h
DawnFire42 75d59e2d82
[Game] Add Command Zone support with commander tax tracking
- Add CommandZone and CommandZoneLogic for commander
  - Add CommanderTaxCounter
  - Add counter active state protocol (show/hide tax counters)
  - Add "Enable Command Zone" option in game creation dialogs
  - Add context menu actions for command zone operations

Took 9 minutes

Took 11 minutes
2026-06-19 11:00:49 -04:00

62 lines
1.9 KiB
C++

/**
* @file command_zone_menu.h
* @ingroup GameMenusZones
* @brief Context menu for command zone right-click actions.
*/
#ifndef COCKATRICE_COMMAND_ZONE_MENU_H
#define COCKATRICE_COMMAND_ZONE_MENU_H
#include "abstract_player_component.h"
#include <QMenu>
class PlayerLogic;
/**
* @class CommandZoneMenu
* @brief Context menu for the command zone.
*
* Appears when right-clicking on the command zone. Provides actions for
* viewing zone contents, adjusting the commander tax counter, and
* toggling minimized state.
*
* @see PlayerMenu
* @see CommandZone
*/
class CommandZoneMenu : public QMenu, public AbstractPlayerComponent
{
Q_OBJECT
public:
explicit CommandZoneMenu(PlayerLogic *player, QMenu *playerMenu);
void retranslateUi() override;
void setShortcutsActive() override;
void setShortcutsInactive() override;
QAction *aViewZone = nullptr; ///< Opens a zone viewer for the command zone
private:
QAction *aIncreaseCommanderTax = nullptr; ///< Increments the primary commander tax counter
QAction *aDecreaseCommanderTax = nullptr; ///< Decrements the primary commander tax counter
QAction *aToggleCommanderTaxCounter = nullptr; ///< Toggles primary commander tax counter visibility
QAction *aIncreasePartnerTax = nullptr; ///< Increments the partner commander tax counter
QAction *aDecreasePartnerTax = nullptr; ///< Decrements the partner commander tax counter
QAction *aTogglePartnerTaxCounter = nullptr; ///< Toggles partner commander tax counter visibility
QAction *aToggleMinimized = nullptr; ///< Toggles command zone minimized state
private slots:
void actToggleMinimized();
private:
void updateTaxCounterActionStates();
PlayerLogic *player;
QString viewZoneShortcutKey;
QString incTaxShortcutKey;
QString decTaxShortcutKey;
QString incPartnerTaxShortcutKey;
QString decPartnerTaxShortcutKey;
};
#endif // COCKATRICE_COMMAND_ZONE_MENU_H