mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
View hand window (#3731)
* Roar * Add View Hand menu to player * Add shortcut * reorder right click menu
This commit is contained in:
parent
a80f3b77da
commit
8682367b52
3 changed files with 16 additions and 1 deletions
|
|
@ -192,6 +192,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
||||||
|
|
||||||
aViewLibrary = new QAction(this);
|
aViewLibrary = new QAction(this);
|
||||||
connect(aViewLibrary, SIGNAL(triggered()), this, SLOT(actViewLibrary()));
|
connect(aViewLibrary, SIGNAL(triggered()), this, SLOT(actViewLibrary()));
|
||||||
|
aViewHand = new QAction(this);
|
||||||
|
connect(aViewHand, SIGNAL(triggered()), this, SLOT(actViewHand()));
|
||||||
|
|
||||||
aViewTopCards = new QAction(this);
|
aViewTopCards = new QAction(this);
|
||||||
connect(aViewTopCards, SIGNAL(triggered()), this, SLOT(actViewTopCards()));
|
connect(aViewTopCards, SIGNAL(triggered()), this, SLOT(actViewTopCards()));
|
||||||
aAlwaysRevealTopCard = new QAction(this);
|
aAlwaysRevealTopCard = new QAction(this);
|
||||||
|
|
@ -243,6 +246,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
||||||
|
|
||||||
if (local || judge) {
|
if (local || judge) {
|
||||||
handMenu = playerMenu->addMenu(QString());
|
handMenu = playerMenu->addMenu(QString());
|
||||||
|
handMenu->addAction(aViewHand);
|
||||||
playerLists.append(mRevealHand = handMenu->addMenu(QString()));
|
playerLists.append(mRevealHand = handMenu->addMenu(QString()));
|
||||||
playerLists.append(mRevealRandomHandCard = handMenu->addMenu(QString()));
|
playerLists.append(mRevealRandomHandCard = handMenu->addMenu(QString()));
|
||||||
handMenu->addSeparator();
|
handMenu->addSeparator();
|
||||||
|
|
@ -672,6 +676,7 @@ void Player::retranslateUi()
|
||||||
aMoveRfgToGrave->setText(tr("&Graveyard"));
|
aMoveRfgToGrave->setText(tr("&Graveyard"));
|
||||||
|
|
||||||
aViewLibrary->setText(tr("&View library"));
|
aViewLibrary->setText(tr("&View library"));
|
||||||
|
aViewHand->setText(tr("&View hand"));
|
||||||
aViewTopCards->setText(tr("View &top cards of library..."));
|
aViewTopCards->setText(tr("View &top cards of library..."));
|
||||||
mRevealLibrary->setTitle(tr("Reveal &library to..."));
|
mRevealLibrary->setTitle(tr("Reveal &library to..."));
|
||||||
mRevealTopCard->setTitle(tr("Reveal t&op cards to..."));
|
mRevealTopCard->setTitle(tr("Reveal t&op cards to..."));
|
||||||
|
|
@ -839,6 +844,7 @@ void Player::setShortcutsActive()
|
||||||
|
|
||||||
aViewSideboard->setShortcut(shortcuts.getSingleShortcut("Player/aViewSideboard"));
|
aViewSideboard->setShortcut(shortcuts.getSingleShortcut("Player/aViewSideboard"));
|
||||||
aViewLibrary->setShortcut(shortcuts.getSingleShortcut("Player/aViewLibrary"));
|
aViewLibrary->setShortcut(shortcuts.getSingleShortcut("Player/aViewLibrary"));
|
||||||
|
aViewHand->setShortcut(shortcuts.getSingleShortcut("Player/aViewHand"));
|
||||||
aViewTopCards->setShortcut(shortcuts.getSingleShortcut("Player/aViewTopCards"));
|
aViewTopCards->setShortcut(shortcuts.getSingleShortcut("Player/aViewTopCards"));
|
||||||
aViewGraveyard->setShortcut(shortcuts.getSingleShortcut("Player/aViewGraveyard"));
|
aViewGraveyard->setShortcut(shortcuts.getSingleShortcut("Player/aViewGraveyard"));
|
||||||
aDrawCard->setShortcut(shortcuts.getSingleShortcut("Player/aDrawCard"));
|
aDrawCard->setShortcut(shortcuts.getSingleShortcut("Player/aDrawCard"));
|
||||||
|
|
@ -864,6 +870,7 @@ void Player::setShortcutsInactive()
|
||||||
|
|
||||||
aViewSideboard->setShortcut(QKeySequence());
|
aViewSideboard->setShortcut(QKeySequence());
|
||||||
aViewLibrary->setShortcut(QKeySequence());
|
aViewLibrary->setShortcut(QKeySequence());
|
||||||
|
aViewHand->setShortcut(QKeySequence());
|
||||||
aViewTopCards->setShortcut(QKeySequence());
|
aViewTopCards->setShortcut(QKeySequence());
|
||||||
aViewGraveyard->setShortcut(QKeySequence());
|
aViewGraveyard->setShortcut(QKeySequence());
|
||||||
aDrawCard->setShortcut(QKeySequence());
|
aDrawCard->setShortcut(QKeySequence());
|
||||||
|
|
@ -930,6 +937,11 @@ void Player::actViewLibrary()
|
||||||
static_cast<GameScene *>(scene())->toggleZoneView(this, "deck", -1);
|
static_cast<GameScene *>(scene())->toggleZoneView(this, "deck", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::actViewHand()
|
||||||
|
{
|
||||||
|
static_cast<GameScene *>(scene())->toggleZoneView(this, "hand", -1);
|
||||||
|
}
|
||||||
|
|
||||||
void Player::actViewTopCards()
|
void Player::actViewTopCards()
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ public slots:
|
||||||
void actMoveBottomCardToGrave();
|
void actMoveBottomCardToGrave();
|
||||||
|
|
||||||
void actViewLibrary();
|
void actViewLibrary();
|
||||||
|
void actViewHand();
|
||||||
void actViewTopCards();
|
void actViewTopCards();
|
||||||
void actAlwaysRevealTopCard();
|
void actAlwaysRevealTopCard();
|
||||||
void actViewGraveyard();
|
void actViewGraveyard();
|
||||||
|
|
@ -209,7 +210,7 @@ private:
|
||||||
QList<QAction *> allPlayersActions;
|
QList<QAction *> allPlayersActions;
|
||||||
QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary, *aMoveHandToGrave, *aMoveHandToRfg,
|
QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary, *aMoveHandToGrave, *aMoveHandToRfg,
|
||||||
*aMoveGraveToTopLibrary, *aMoveGraveToBottomLibrary, *aMoveGraveToHand, *aMoveGraveToRfg, *aMoveRfgToTopLibrary,
|
*aMoveGraveToTopLibrary, *aMoveGraveToBottomLibrary, *aMoveGraveToHand, *aMoveGraveToRfg, *aMoveRfgToTopLibrary,
|
||||||
*aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave, *aViewLibrary, *aViewTopCards,
|
*aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave, *aViewHand, *aViewLibrary, *aViewTopCards,
|
||||||
*aAlwaysRevealTopCard, *aOpenDeckInDeckEditor, *aMoveTopCardToGraveyard, *aMoveTopCardToExile,
|
*aAlwaysRevealTopCard, *aOpenDeckInDeckEditor, *aMoveTopCardToGraveyard, *aMoveTopCardToExile,
|
||||||
*aMoveTopCardsToGraveyard, *aMoveTopCardsToExile, *aMoveTopCardToBottom, *aViewGraveyard, *aViewRfg,
|
*aMoveTopCardsToGraveyard, *aMoveTopCardsToExile, *aMoveTopCardToBottom, *aViewGraveyard, *aViewRfg,
|
||||||
*aViewSideboard, *aDrawCard, *aDrawCards, *aUndoDraw, *aMulligan, *aShuffle, *aMoveTopToPlayFaceDown,
|
*aViewSideboard, *aDrawCard, *aDrawCards, *aUndoDraw, *aMulligan, *aShuffle, *aMoveTopToPlayFaceDown,
|
||||||
|
|
|
||||||
|
|
@ -419,6 +419,8 @@ private:
|
||||||
{"Player/aMoveTopToPlayFaceDown", SK(QT_TRANSLATE_NOOP("shortcutsTab", "Play face down"),
|
{"Player/aMoveTopToPlayFaceDown", SK(QT_TRANSLATE_NOOP("shortcutsTab", "Play face down"),
|
||||||
parseSequenceString("Ctrl+Shift+E"),
|
parseSequenceString("Ctrl+Shift+E"),
|
||||||
ShortcutGroup::Move_selected)},
|
ShortcutGroup::Move_selected)},
|
||||||
|
{"Player/aViewHand",
|
||||||
|
SK(QT_TRANSLATE_NOOP("shortcutsTab", "Hand"), parseSequenceString(""), ShortcutGroup::View)},
|
||||||
{"Player/aViewGraveyard",
|
{"Player/aViewGraveyard",
|
||||||
SK(QT_TRANSLATE_NOOP("shortcutsTab", "Graveyard"), parseSequenceString("F4"), ShortcutGroup::View)},
|
SK(QT_TRANSLATE_NOOP("shortcutsTab", "Graveyard"), parseSequenceString("F4"), ShortcutGroup::View)},
|
||||||
{"Player/aViewLibrary",
|
{"Player/aViewLibrary",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue