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 createGraveyardOrExileMenu();
|
||||||
void createHandOrCustomZoneMenu();
|
void createHandOrCustomZoneMenu();
|
||||||
|
|
||||||
QMenu *mCardCounters = nullptr;
|
QMenu *mCardCounters;
|
||||||
|
|
||||||
QAction *aPlay, *aPlayFacedown;
|
QAction *aPlay, *aPlayFacedown;
|
||||||
QAction *aHide;
|
QAction *aHide;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ GraveyardMenu::GraveyardMenu(Player *_player, QWidget *parent) : TearOffMenu(par
|
||||||
newAction->setData(-1);
|
newAction->setData(-1);
|
||||||
connect(newAction, &QAction::triggered, player->getPlayerActions(),
|
connect(newAction, &QAction::triggered, player->getPlayerActions(),
|
||||||
&PlayerActions::actRevealRandomGraveyardCard);
|
&PlayerActions::actRevealRandomGraveyardCard);
|
||||||
// allPlayersActions.append(newAction);
|
emit newPlayerActionCreated(newAction);
|
||||||
mRevealRandomGraveyardCard->addSeparator();
|
mRevealRandomGraveyardCard->addSeparator();
|
||||||
|
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ class Player;
|
||||||
class GraveyardMenu : public TearOffMenu
|
class GraveyardMenu : public TearOffMenu
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
signals:
|
||||||
|
void newPlayerActionCreated(QAction *action);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GraveyardMenu(Player *player, QWidget *parent = nullptr);
|
explicit GraveyardMenu(Player *player, QWidget *parent = nullptr);
|
||||||
void createMoveActions();
|
void createMoveActions();
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,8 @@ LibraryMenu::LibraryMenu(Player *_player, QWidget *parent) : TearOffMenu(parent)
|
||||||
addAction(aViewTopCards);
|
addAction(aViewTopCards);
|
||||||
addAction(aViewBottomCards);
|
addAction(aViewBottomCards);
|
||||||
addSeparator();
|
addSeparator();
|
||||||
// playerLists.append(mRevealLibrary = libraryMenu->addMenu(QString()));
|
|
||||||
mRevealLibrary = addMenu(QString());
|
mRevealLibrary = addMenu(QString());
|
||||||
// singlePlayerLists.append(mLendLibrary = libraryMenu->addMenu(QString()));
|
|
||||||
mLendLibrary = addMenu(QString());
|
mLendLibrary = addMenu(QString());
|
||||||
// playerLists.append(mRevealTopCard = libraryMenu->addMenu(QString()));
|
|
||||||
mRevealTopCard = addMenu(QString());
|
mRevealTopCard = addMenu(QString());
|
||||||
addAction(aAlwaysRevealTopCard);
|
addAction(aAlwaysRevealTopCard);
|
||||||
addAction(aAlwaysLookAtTopCard);
|
addAction(aAlwaysLookAtTopCard);
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,13 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
||||||
if (player->getPlayerInfo()->getLocalOrJudge()) {
|
if (player->getPlayerInfo()->getLocalOrJudge()) {
|
||||||
handMenu = new HandMenu(player, player->getPlayerActions(), playerMenu);
|
handMenu = new HandMenu(player, player->getPlayerActions(), playerMenu);
|
||||||
playerMenu->addMenu(handMenu);
|
playerMenu->addMenu(handMenu);
|
||||||
/*playerLists.append(mRevealHand = handMenu->addMenu(QString()));
|
playerLists.append(handMenu->revealHandMenu());
|
||||||
playerLists.append(mRevealRandomHandCard = handMenu->addMenu(QString()));*/
|
playerLists.append(handMenu->revealRandomHandCardMenu());
|
||||||
|
|
||||||
libraryMenu = new LibraryMenu(player, playerMenu);
|
libraryMenu = new LibraryMenu(player, playerMenu);
|
||||||
|
playerLists.append(libraryMenu->revealLibrary());
|
||||||
|
playerLists.append(libraryMenu->lendLibraryMenu());
|
||||||
|
playerLists.append(libraryMenu->revealTopCardMenu());
|
||||||
playerMenu->addMenu(libraryMenu);
|
playerMenu->addMenu(libraryMenu);
|
||||||
} else {
|
} else {
|
||||||
handMenu = nullptr;
|
handMenu = nullptr;
|
||||||
|
|
@ -39,6 +42,7 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
||||||
}
|
}
|
||||||
|
|
||||||
graveMenu = new GraveyardMenu(player, playerMenu);
|
graveMenu = new GraveyardMenu(player, playerMenu);
|
||||||
|
connect(graveMenu, &GraveyardMenu::newPlayerActionCreated, this, &PlayerMenu::onNewPlayerListActionCreated);
|
||||||
playerMenu->addMenu(graveMenu);
|
playerMenu->addMenu(graveMenu);
|
||||||
|
|
||||||
rfgMenu = new RfgMenu(player, playerMenu);
|
rfgMenu = new RfgMenu(player, playerMenu);
|
||||||
|
|
@ -182,6 +186,11 @@ void PlayerMenu::playerListActionTriggered()
|
||||||
player->getPlayerActions()->sendGameCommand(cmd);
|
player->getPlayerActions()->sendGameCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayerMenu::onNewPlayerListActionCreated(QAction *action)
|
||||||
|
{
|
||||||
|
allPlayersActions.append(action);
|
||||||
|
}
|
||||||
|
|
||||||
QMenu *PlayerMenu::updateCardMenu(const CardItem *card)
|
QMenu *PlayerMenu::updateCardMenu(const CardItem *card)
|
||||||
{
|
{
|
||||||
if (!card) {
|
if (!card) {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ private slots:
|
||||||
void addPlayer(Player *playerToAdd);
|
void addPlayer(Player *playerToAdd);
|
||||||
void removePlayer(Player *playerToRemove);
|
void removePlayer(Player *playerToRemove);
|
||||||
void playerListActionTriggered();
|
void playerListActionTriggered();
|
||||||
|
void onNewPlayerListActionCreated(QAction *action);
|
||||||
void refreshShortcuts();
|
void refreshShortcuts();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue