Merge pull request #726 from kaiserfro/jo-add-play-face-down-menu-item
Add a play face down context menu item when in the hand zone.
This commit is contained in:
commit
96af5bd09c
2 changed files with 13 additions and 3 deletions
|
@ -415,7 +415,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
|
||||||
connect(aPlay, SIGNAL(triggered()), this, SLOT(actPlay()));
|
connect(aPlay, SIGNAL(triggered()), this, SLOT(actPlay()));
|
||||||
aHide = new QAction(this);
|
aHide = new QAction(this);
|
||||||
connect(aHide, SIGNAL(triggered()), this, SLOT(actHide()));
|
connect(aHide, SIGNAL(triggered()), this, SLOT(actHide()));
|
||||||
|
aPlayFacedown = new QAction(this);
|
||||||
|
connect(aPlayFacedown, SIGNAL(triggered()), this, SLOT(actPlayFacedown()));
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
QAction *tempAddCounter = new QAction(this);
|
QAction *tempAddCounter = new QAction(this);
|
||||||
tempAddCounter->setData(9 + i * 1000);
|
tempAddCounter->setData(9 + i * 1000);
|
||||||
|
@ -651,7 +653,8 @@ void Player::retranslateUi()
|
||||||
|
|
||||||
aPlay->setText(tr("&Play"));
|
aPlay->setText(tr("&Play"));
|
||||||
aHide->setText(tr("&Hide"));
|
aHide->setText(tr("&Hide"));
|
||||||
|
aPlayFacedown->setText(tr("Play &Face Down"));
|
||||||
|
|
||||||
aTap->setText(tr("&Tap"));
|
aTap->setText(tr("&Tap"));
|
||||||
aUntap->setText(tr("&Untap"));
|
aUntap->setText(tr("&Untap"));
|
||||||
aDoesntUntap->setText(tr("Toggle &normal untapping"));
|
aDoesntUntap->setText(tr("Toggle &normal untapping"));
|
||||||
|
@ -2141,6 +2144,11 @@ void Player::actHide()
|
||||||
game->getActiveCard()->getZone()->removeCard(game->getActiveCard());
|
game->getActiveCard()->getZone()->removeCard(game->getActiveCard());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::actPlayFacedown()
|
||||||
|
{
|
||||||
|
playCard(game->getActiveCard(), true, game->getActiveCard()->getInfo()->getCipt());
|
||||||
|
}
|
||||||
|
|
||||||
void Player::updateCardMenu(CardItem *card)
|
void Player::updateCardMenu(CardItem *card)
|
||||||
{
|
{
|
||||||
QMenu *cardMenu = card->getCardMenu();
|
QMenu *cardMenu = card->getCardMenu();
|
||||||
|
@ -2217,6 +2225,7 @@ void Player::updateCardMenu(CardItem *card)
|
||||||
cardMenu->addMenu(moveMenu);
|
cardMenu->addMenu(moveMenu);
|
||||||
} else {
|
} else {
|
||||||
cardMenu->addAction(aPlay);
|
cardMenu->addAction(aPlay);
|
||||||
|
cardMenu->addAction(aPlayFacedown);
|
||||||
cardMenu->addMenu(moveMenu);
|
cardMenu->addMenu(moveMenu);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -156,6 +156,7 @@ private slots:
|
||||||
void actSetAnnotation();
|
void actSetAnnotation();
|
||||||
void actPlay();
|
void actPlay();
|
||||||
void actHide();
|
void actHide();
|
||||||
|
void actPlayFacedown();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TabGame *game;
|
TabGame *game;
|
||||||
|
@ -173,7 +174,7 @@ private:
|
||||||
*aCardMenu, *aMoveBottomCardToGrave;
|
*aCardMenu, *aMoveBottomCardToGrave;
|
||||||
|
|
||||||
QList<QAction *> aAddCounter, aSetCounter, aRemoveCounter;
|
QList<QAction *> aAddCounter, aSetCounter, aRemoveCounter;
|
||||||
QAction *aPlay,
|
QAction *aPlay, *aPlayFacedown,
|
||||||
*aHide,
|
*aHide,
|
||||||
*aTap, *aUntap, *aDoesntUntap, *aAttach, *aUnattach, *aDrawArrow, *aSetPT, *aIncP, *aDecP, *aIncT, *aDecT, *aIncPT, *aDecPT, *aSetAnnotation, *aFlip, *aPeek, *aClone,
|
*aTap, *aUntap, *aDoesntUntap, *aAttach, *aUnattach, *aDrawArrow, *aSetPT, *aIncP, *aDecP, *aIncT, *aDecT, *aIncPT, *aDecPT, *aSetAnnotation, *aFlip, *aPeek, *aClone,
|
||||||
*aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToGraveyard, *aMoveToExile;
|
*aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToGraveyard, *aMoveToExile;
|
||||||
|
|
Loading…
Reference in a new issue