mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 00:12:15 -07:00
PlayerList things.
Took 16 minutes
This commit is contained in:
parent
33ca1c051f
commit
4860145273
6 changed files with 17 additions and 7 deletions
|
|
@ -17,7 +17,7 @@ public:
|
|||
void createGraveyardOrExileMenu();
|
||||
void createHandOrCustomZoneMenu();
|
||||
|
||||
QMenu *mCardCounters = nullptr;
|
||||
QMenu *mCardCounters;
|
||||
|
||||
QAction *aPlay, *aPlayFacedown;
|
||||
QAction *aHide;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ GraveyardMenu::GraveyardMenu(Player *_player, QWidget *parent) : TearOffMenu(par
|
|||
newAction->setData(-1);
|
||||
connect(newAction, &QAction::triggered, player->getPlayerActions(),
|
||||
&PlayerActions::actRevealRandomGraveyardCard);
|
||||
// allPlayersActions.append(newAction);
|
||||
emit newPlayerActionCreated(newAction);
|
||||
mRevealRandomGraveyardCard->addSeparator();
|
||||
|
||||
addSeparator();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ class Player;
|
|||
class GraveyardMenu : public TearOffMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void newPlayerActionCreated(QAction *action);
|
||||
|
||||
public:
|
||||
explicit GraveyardMenu(Player *player, QWidget *parent = nullptr);
|
||||
void createMoveActions();
|
||||
|
|
|
|||
|
|
@ -20,11 +20,8 @@ LibraryMenu::LibraryMenu(Player *_player, QWidget *parent) : TearOffMenu(parent)
|
|||
addAction(aViewTopCards);
|
||||
addAction(aViewBottomCards);
|
||||
addSeparator();
|
||||
// playerLists.append(mRevealLibrary = libraryMenu->addMenu(QString()));
|
||||
mRevealLibrary = addMenu(QString());
|
||||
// singlePlayerLists.append(mLendLibrary = libraryMenu->addMenu(QString()));
|
||||
mLendLibrary = addMenu(QString());
|
||||
// playerLists.append(mRevealTopCard = libraryMenu->addMenu(QString()));
|
||||
mRevealTopCard = addMenu(QString());
|
||||
addAction(aAlwaysRevealTopCard);
|
||||
addAction(aAlwaysLookAtTopCard);
|
||||
|
|
|
|||
|
|
@ -28,10 +28,13 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
|||
if (player->getPlayerInfo()->getLocalOrJudge()) {
|
||||
handMenu = new HandMenu(player, player->getPlayerActions(), playerMenu);
|
||||
playerMenu->addMenu(handMenu);
|
||||
/*playerLists.append(mRevealHand = handMenu->addMenu(QString()));
|
||||
playerLists.append(mRevealRandomHandCard = handMenu->addMenu(QString()));*/
|
||||
playerLists.append(handMenu->revealHandMenu());
|
||||
playerLists.append(handMenu->revealRandomHandCardMenu());
|
||||
|
||||
libraryMenu = new LibraryMenu(player, playerMenu);
|
||||
playerLists.append(libraryMenu->revealLibrary());
|
||||
playerLists.append(libraryMenu->lendLibraryMenu());
|
||||
playerLists.append(libraryMenu->revealTopCardMenu());
|
||||
playerMenu->addMenu(libraryMenu);
|
||||
} else {
|
||||
handMenu = nullptr;
|
||||
|
|
@ -39,6 +42,7 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
|||
}
|
||||
|
||||
graveMenu = new GraveyardMenu(player, playerMenu);
|
||||
connect(graveMenu, &GraveyardMenu::newPlayerActionCreated, this, &PlayerMenu::onNewPlayerListActionCreated);
|
||||
playerMenu->addMenu(graveMenu);
|
||||
|
||||
rfgMenu = new RfgMenu(player, playerMenu);
|
||||
|
|
@ -182,6 +186,11 @@ void PlayerMenu::playerListActionTriggered()
|
|||
player->getPlayerActions()->sendGameCommand(cmd);
|
||||
}
|
||||
|
||||
void PlayerMenu::onNewPlayerListActionCreated(QAction *action)
|
||||
{
|
||||
allPlayersActions.append(action);
|
||||
}
|
||||
|
||||
QMenu *PlayerMenu::updateCardMenu(const CardItem *card)
|
||||
{
|
||||
if (!card) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ private slots:
|
|||
void addPlayer(Player *playerToAdd);
|
||||
void removePlayer(Player *playerToRemove);
|
||||
void playerListActionTriggered();
|
||||
void onNewPlayerListActionCreated(QAction *action);
|
||||
void refreshShortcuts();
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue