mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 20:43:54 -07:00
[Game] Populate playerLists for menus in their aboutToShow … (#6214)
* Populate playerLists for menus in their aboutToShow so they are always current and do not rely on playerMenu manually tracking them. Also add playerActions for previous playerListActions. Took 1 hour 35 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
015570c833
commit
30e6b52783
10 changed files with 313 additions and 159 deletions
|
|
@ -18,13 +18,10 @@ class PlayerActions;
|
|||
class HandMenu : public TearOffMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HandMenu(Player *player, PlayerActions *actions, QWidget *parent = nullptr);
|
||||
void retranslateUi();
|
||||
void setShortcutsActive();
|
||||
void setShortcutsInactive();
|
||||
|
||||
// expose useful actions/menus if PlayerMenu needs them
|
||||
public:
|
||||
HandMenu(Player *player, PlayerActions *actions, QWidget *parent = nullptr);
|
||||
|
||||
QMenu *revealHandMenu() const
|
||||
{
|
||||
return mRevealHand;
|
||||
|
|
@ -33,10 +30,16 @@ public:
|
|||
{
|
||||
return mRevealRandomHandCard;
|
||||
}
|
||||
QMenu *moveHandMenu() const
|
||||
{
|
||||
return mMoveHandMenu;
|
||||
}
|
||||
|
||||
void retranslateUi();
|
||||
void setShortcutsActive();
|
||||
void setShortcutsInactive();
|
||||
|
||||
private slots:
|
||||
void populateRevealHandMenuWithActivePlayers();
|
||||
void populateRevealRandomHandCardMenuWithActivePlayers();
|
||||
void onRevealHandTriggered();
|
||||
void onRevealRandomHandCardTriggered();
|
||||
|
||||
private:
|
||||
Player *player;
|
||||
|
|
@ -47,8 +50,8 @@ private:
|
|||
|
||||
QMenu *mRevealHand = nullptr;
|
||||
QMenu *mRevealRandomHandCard = nullptr;
|
||||
QMenu *mMoveHandMenu = nullptr;
|
||||
|
||||
QMenu *mMoveHandMenu = nullptr;
|
||||
QAction *aMoveHandToTopLibrary = nullptr;
|
||||
QAction *aMoveHandToBottomLibrary = nullptr;
|
||||
QAction *aMoveHandToGrave = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue