Cockatrice 2026-04-21-Development-2.11.0-beta.61
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
hand_menu.h
Go to the documentation of this file.
1
6
7#ifndef COCKATRICE_HAND_MENU_H
8#define COCKATRICE_HAND_MENU_H
9
12
13#include <QAction>
14#include <QMenu>
15
16class Player;
17class PlayerActions;
18
20{
21 Q_OBJECT
22
23public:
24 HandMenu(Player *player, PlayerActions *actions, QWidget *parent = nullptr);
25
26 QMenu *revealHandMenu() const
27 {
28 return mRevealHand;
29 }
31 {
33 }
34
35 void retranslateUi() override;
36 void setShortcutsActive() override;
37 void setShortcutsInactive() override;
38
39private slots:
44
45private:
47
48 QAction *aViewHand = nullptr;
49 QAction *aMulligan = nullptr;
50 QAction *aMulliganSame = nullptr;
51 QAction *aMulliganMinusOne = nullptr;
52
53 QMenu *mSortHand = nullptr;
54 QAction *aSortHandByName = nullptr;
55 QAction *aSortHandByType = nullptr;
56 QAction *aSortHandByManaValue = nullptr;
57
58 QMenu *mRevealHand = nullptr;
59 QAction *aRevealHandToAll = nullptr;
60
61 QMenu *mRevealRandomHandCard = nullptr;
62 QAction *aRevealRandomHandCardToAll = nullptr;
63
64 QMenu *mMoveHandMenu = nullptr;
65 QAction *aMoveHandToTopLibrary = nullptr;
66 QAction *aMoveHandToBottomLibrary = nullptr;
67 QAction *aMoveHandToGrave = nullptr;
68 QAction *aMoveHandToRfg = nullptr;
69};
70
71#endif // COCKATRICE_HAND_MENU_H
Polymorphic interface for player-bound UI components managed by PlayerMenu.
Interface for player-bound UI components that need shortcut and translation lifecycle management.
Definition abstract_player_component.h:18
QMenu * mRevealRandomHandCard
Definition hand_menu.h:61
QMenu * revealHandMenu() const
Definition hand_menu.h:26
QAction * aSortHandByType
Definition hand_menu.h:55
QAction * aMoveHandToBottomLibrary
Definition hand_menu.h:66
QAction * aMoveHandToGrave
Definition hand_menu.h:67
HandMenu(Player *player, PlayerActions *actions, QWidget *parent=nullptr)
Definition hand_menu.cpp:14
QMenu * mMoveHandMenu
Definition hand_menu.h:64
void onRevealHandTriggered()
Definition hand_menu.cpp:197
QAction * aRevealRandomHandCardToAll
Definition hand_menu.h:62
void retranslateUi() override
Retranslate all user-visible strings. Called on language change.
Definition hand_menu.cpp:106
QAction * aMulliganSame
Definition hand_menu.h:50
QAction * aSortHandByManaValue
Definition hand_menu.h:56
QMenu * mRevealHand
Definition hand_menu.h:58
void populateRevealRandomHandCardMenuWithActivePlayers()
Definition hand_menu.cpp:179
void setShortcutsActive() override
Bind keyboard shortcuts. Called when this player gains focus.
Definition hand_menu.cpp:136
void onRevealRandomHandCardTriggered()
Definition hand_menu.cpp:207
void setShortcutsInactive() override
Unbind keyboard shortcuts. Called when this player loses focus.
Definition hand_menu.cpp:150
QAction * aSortHandByName
Definition hand_menu.h:54
QMenu * mSortHand
Definition hand_menu.h:53
Player * player
Definition hand_menu.h:46
QAction * aMoveHandToRfg
Definition hand_menu.h:68
QAction * aRevealHandToAll
Definition hand_menu.h:59
QAction * aMulliganMinusOne
Definition hand_menu.h:51
void populateRevealHandMenuWithActivePlayers()
Definition hand_menu.cpp:161
QMenu * revealRandomHandCardMenu() const
Definition hand_menu.h:30
QAction * aViewHand
Definition hand_menu.h:48
QAction * aMulligan
Definition hand_menu.h:49
QAction * aMoveHandToTopLibrary
Definition hand_menu.h:65
Definition player_actions.h:35
Definition player.h:66
TearOffMenu(const QString &title, QWidget *parent=nullptr)
Definition tearoff_menu.h:16
TODO: Document this.