From 45d214aa1993c85bd69a2033cebe374aca5636ad Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Mon, 4 May 2015 16:21:59 +0200 Subject: [PATCH] Added deck size limit Updated to use the current deck size limit --- cockatrice/src/player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 276e8ebe..a44f6953 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -515,6 +515,7 @@ void Player::playerListActionTriggered() if (menu == mRevealLibrary) { cmd.set_zone_name("deck"); } else if (menu == mRevealTopCard) { + int decksize = zones.value("deck")->getCards().size(); bool ok; int number = #if QT_VERSION < 0x050000 @@ -522,7 +523,7 @@ void Player::playerListActionTriggered() #else QInputDialog::getInt( #endif - 0, tr("Reveal top cards of library"), tr("Number of cards:"), defaultNumberTopCards, 1, 2000000000, 1, &ok); + 0, tr("Reveal top cards of library"), tr("Number of cards: (max %1)").arg(decksize), defaultNumberTopCards, 1, decksize, 1, &ok); if (ok) { cmd.set_zone_name("deck"); cmd.set_top_cards(number);