mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 00:23:55 -07:00
[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
This commit is contained in:
parent
687e6644bc
commit
75d59e2d82
73 changed files with 1540 additions and 86 deletions
62
cockatrice/src/game_graphics/player/menu/command_zone_menu.h
Normal file
62
cockatrice/src/game_graphics/player/menu/command_zone_menu.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* @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
|
||||
Loading…
Add table
Add a link
Reference in a new issue