View hand window (#3731)

* Roar

* Add View Hand menu to player

* Add shortcut

* reorder right click menu
This commit is contained in:
Rob Blanckaert 2019-05-31 07:53:24 -07:00 committed by ctrlaltca
parent a80f3b77da
commit 8682367b52
3 changed files with 16 additions and 1 deletions

View file

@ -192,6 +192,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
aViewLibrary = new QAction(this);
connect(aViewLibrary, SIGNAL(triggered()), this, SLOT(actViewLibrary()));
aViewHand = new QAction(this);
connect(aViewHand, SIGNAL(triggered()), this, SLOT(actViewHand()));
aViewTopCards = new QAction(this);
connect(aViewTopCards, SIGNAL(triggered()), this, SLOT(actViewTopCards()));
aAlwaysRevealTopCard = new QAction(this);
@ -243,6 +246,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
if (local || judge) {
handMenu = playerMenu->addMenu(QString());
handMenu->addAction(aViewHand);
playerLists.append(mRevealHand = handMenu->addMenu(QString()));
playerLists.append(mRevealRandomHandCard = handMenu->addMenu(QString()));
handMenu->addSeparator();
@ -672,6 +676,7 @@ void Player::retranslateUi()
aMoveRfgToGrave->setText(tr("&Graveyard"));
aViewLibrary->setText(tr("&View library"));
aViewHand->setText(tr("&View hand"));
aViewTopCards->setText(tr("View &top cards of library..."));
mRevealLibrary->setTitle(tr("Reveal &library to..."));
mRevealTopCard->setTitle(tr("Reveal t&op cards to..."));
@ -839,6 +844,7 @@ void Player::setShortcutsActive()
aViewSideboard->setShortcut(shortcuts.getSingleShortcut("Player/aViewSideboard"));
aViewLibrary->setShortcut(shortcuts.getSingleShortcut("Player/aViewLibrary"));
aViewHand->setShortcut(shortcuts.getSingleShortcut("Player/aViewHand"));
aViewTopCards->setShortcut(shortcuts.getSingleShortcut("Player/aViewTopCards"));
aViewGraveyard->setShortcut(shortcuts.getSingleShortcut("Player/aViewGraveyard"));
aDrawCard->setShortcut(shortcuts.getSingleShortcut("Player/aDrawCard"));
@ -864,6 +870,7 @@ void Player::setShortcutsInactive()
aViewSideboard->setShortcut(QKeySequence());
aViewLibrary->setShortcut(QKeySequence());
aViewHand->setShortcut(QKeySequence());
aViewTopCards->setShortcut(QKeySequence());
aViewGraveyard->setShortcut(QKeySequence());
aDrawCard->setShortcut(QKeySequence());
@ -930,6 +937,11 @@ void Player::actViewLibrary()
static_cast<GameScene *>(scene())->toggleZoneView(this, "deck", -1);
}
void Player::actViewHand()
{
static_cast<GameScene *>(scene())->toggleZoneView(this, "hand", -1);
}
void Player::actViewTopCards()
{
bool ok;

View file

@ -157,6 +157,7 @@ public slots:
void actMoveBottomCardToGrave();
void actViewLibrary();
void actViewHand();
void actViewTopCards();
void actAlwaysRevealTopCard();
void actViewGraveyard();
@ -209,7 +210,7 @@ private:
QList<QAction *> allPlayersActions;
QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary, *aMoveHandToGrave, *aMoveHandToRfg,
*aMoveGraveToTopLibrary, *aMoveGraveToBottomLibrary, *aMoveGraveToHand, *aMoveGraveToRfg, *aMoveRfgToTopLibrary,
*aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave, *aViewLibrary, *aViewTopCards,
*aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave, *aViewHand, *aViewLibrary, *aViewTopCards,
*aAlwaysRevealTopCard, *aOpenDeckInDeckEditor, *aMoveTopCardToGraveyard, *aMoveTopCardToExile,
*aMoveTopCardsToGraveyard, *aMoveTopCardsToExile, *aMoveTopCardToBottom, *aViewGraveyard, *aViewRfg,
*aViewSideboard, *aDrawCard, *aDrawCards, *aUndoDraw, *aMulligan, *aShuffle, *aMoveTopToPlayFaceDown,

View file

@ -419,6 +419,8 @@ private:
{"Player/aMoveTopToPlayFaceDown", SK(QT_TRANSLATE_NOOP("shortcutsTab", "Play face down"),
parseSequenceString("Ctrl+Shift+E"),
ShortcutGroup::Move_selected)},
{"Player/aViewHand",
SK(QT_TRANSLATE_NOOP("shortcutsTab", "Hand"), parseSequenceString(""), ShortcutGroup::View)},
{"Player/aViewGraveyard",
SK(QT_TRANSLATE_NOOP("shortcutsTab", "Graveyard"), parseSequenceString("F4"), ShortcutGroup::View)},
{"Player/aViewLibrary",