From 70005a6f1d3f2bcd428a23b3585440e39867ec4b Mon Sep 17 00:00:00 2001 From: Lee Tran <41343559+leestran1995@users.noreply.github.com> Date: Fri, 7 Sep 2018 02:14:34 -0500 Subject: [PATCH] Enable the creation and using of shortcuts to move cards from the top of the library to play face down. (#3388) --- cockatrice/src/player.cpp | 1 + cockatrice/src/sequenceEdit/ui_shortcutstab.h | 15 +++++++++++++++ cockatrice/src/shortcutssettings.cpp | 1 + 3 files changed, 17 insertions(+) diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 108d3da9..1949df2e 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -801,6 +801,7 @@ void Player::setShortcutsActive() aCreateToken->setShortcut(settingsCache->shortcuts().getSingleShortcut("Player/aCreateToken")); aCreateAnotherToken->setShortcut(settingsCache->shortcuts().getSingleShortcut("Player/aCreateAnotherToken")); aAlwaysRevealTopCard->setShortcut(settingsCache->shortcuts().getSingleShortcut("Player/aAlwaysRevealTopCard")); + aMoveTopToPlayFaceDown->setShortcut(settingsCache->shortcuts().getSingleShortcut("Player/aMoveTopToPlayFaceDown")); } void Player::setShortcutsInactive() diff --git a/cockatrice/src/sequenceEdit/ui_shortcutstab.h b/cockatrice/src/sequenceEdit/ui_shortcutstab.h index 9c9ae2e0..1f36254f 100644 --- a/cockatrice/src/sequenceEdit/ui_shortcutstab.h +++ b/cockatrice/src/sequenceEdit/ui_shortcutstab.h @@ -289,6 +289,8 @@ public: SequenceEdit *Player_aMoveToExile; QLabel *lbl_Player_aMoveToHand; SequenceEdit *Player_aMoveToHand; + QLabel *lbl_Player_aMoveTopToPlayFaceDown; + SequenceEdit *Player_aMoveTopToPlayFaceDown; QGroupBox *groupBox_16; QGridLayout *gridLayout_16; QLabel *lbl_Player_aViewGraveyard; @@ -1446,6 +1448,18 @@ public: gridLayout_15->addWidget(Player_aMoveToHand, 4, 1, 1, 1); + lbl_Player_aMoveTopToPlayFaceDown = new QLabel(groupBox_15); + lbl_Player_aMoveTopToPlayFaceDown->setObjectName("lbl_Player_aMoveTopToPlayFaceDown"); + + gridLayout_15->addWidget(lbl_Player_aMoveTopToPlayFaceDown, 5, 0, 1, 1); + + Player_aMoveTopToPlayFaceDown = new SequenceEdit("Player/aMoveTopToPlayFaceDown", groupBox_15); + Player_aMoveTopToPlayFaceDown->setObjectName("Player_aMoveTopToPlayFaceDown"); + + gridLayout_15->addWidget(Player_aMoveTopToPlayFaceDown, 5, 1, 1, 1); + + + gridLayout_20->addWidget(groupBox_15, 0, 1, 1, 1); groupBox_16 = new QGroupBox(tab_3); @@ -1874,6 +1888,7 @@ public: lbl_Player_aMoveToGraveyard->setText(QApplication::translate("shortcutsTab", "Graveyard", 0)); lbl_Player_aMoveToExile->setText(QApplication::translate("shortcutsTab", "Exile", 0)); lbl_Player_aMoveToHand->setText(QApplication::translate("shortcutsTab", "Hand", 0)); + lbl_Player_aMoveTopToPlayFaceDown->setText(QApplication::translate("shortcutsTab", "Play face down")); groupBox_16->setTitle(QApplication::translate("shortcutsTab", "View", 0)); lbl_Player_aViewGraveyard->setText(QApplication::translate("shortcutsTab", "Graveyard", 0)); lbl_Player_aViewLibrary->setText(QApplication::translate("shortcutsTab", "Library", 0)); diff --git a/cockatrice/src/shortcutssettings.cpp b/cockatrice/src/shortcutssettings.cpp index 4296b687..d694753c 100644 --- a/cockatrice/src/shortcutssettings.cpp +++ b/cockatrice/src/shortcutssettings.cpp @@ -325,4 +325,5 @@ void ShortcutsSettings::fillDefaultShorcuts() defaultShortCuts["tab_room/aClearChat"] = parseSequenceString("F12"); defaultShortCuts["DlgLoadDeckFromClipboard/refreshButton"] = parseSequenceString("F5"); defaultShortCuts["Player/aResetLayout"] = parseSequenceString(""); + defaultShortCuts["Player/aMoveTopToPlayFaceDown"] = parseSequenceString("Ctrl+Shift+E"); }