mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
- 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
62 lines
1.9 KiB
C++
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
|