mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Fine, the game can remember the tab.
Took 10 minutes Took 21 seconds Took 9 seconds
This commit is contained in:
parent
cba5ab2847
commit
270bdefd87
6 changed files with 39 additions and 26 deletions
|
|
@ -147,7 +147,7 @@ void PlayerActions::actViewTopCards()
|
|||
int deckSize = player->getDeckZone()->getCards().size();
|
||||
bool ok;
|
||||
// TODO: Signal this
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("View top cards of library"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("View top cards of library"),
|
||||
tr("Number of cards: (max. %1)").arg(deckSize), defaultNumberTopCards, 1,
|
||||
deckSize, 1, &ok);
|
||||
if (ok) {
|
||||
|
|
@ -160,7 +160,7 @@ void PlayerActions::actViewBottomCards()
|
|||
{
|
||||
int deckSize = player->getDeckZone()->getCards().size();
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("View bottom cards of library"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("View bottom cards of library"),
|
||||
tr("Number of cards: (max. %1)").arg(deckSize), defaultNumberBottomCards, 1,
|
||||
deckSize, 1, &ok);
|
||||
if (ok) {
|
||||
|
|
@ -233,7 +233,7 @@ void PlayerActions::actShuffleTop()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Shuffle top cards of library"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Shuffle top cards of library"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberTopCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -262,7 +262,7 @@ void PlayerActions::actShuffleBottom()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Shuffle bottom cards of library"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Shuffle bottom cards of library"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberBottomCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -296,7 +296,7 @@ void PlayerActions::actMulligan()
|
|||
int handSize = player->getHandZone()->getCards().size();
|
||||
int deckSize = player->getDeckZone()->getCards().size() + handSize; // hand is shuffled back into the deck
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Draw hand"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Draw hand"),
|
||||
tr("Number of cards: (max. %1)").arg(deckSize) + '\n' +
|
||||
tr("0 and lower are in comparison to current hand size"),
|
||||
startSize, -handSize, deckSize, 1, &ok);
|
||||
|
|
@ -322,7 +322,7 @@ void PlayerActions::actDrawCards()
|
|||
{
|
||||
int deckSize = player->getDeckZone()->getCards().size();
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Draw cards"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Draw cards"),
|
||||
tr("Number of cards: (max. %1)").arg(deckSize), defaultNumberTopCards, 1,
|
||||
deckSize, 1, &ok);
|
||||
if (ok) {
|
||||
|
|
@ -394,7 +394,7 @@ void PlayerActions::actMoveTopCardsToGrave()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Move top cards to grave"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Move top cards to grave"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberTopCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -426,7 +426,7 @@ void PlayerActions::actMoveTopCardsToExile()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Move top cards to exile"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Move top cards to exile"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberTopCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -454,7 +454,7 @@ void PlayerActions::actMoveTopCardsUntil()
|
|||
{
|
||||
stopMoveTopCardsUntil();
|
||||
|
||||
DlgMoveTopCardsUntil dlg(/* player->getGame() */ nullptr, movingCardsUntilExprs, movingCardsUntilNumberOfHits,
|
||||
DlgMoveTopCardsUntil dlg(player->getGame()->getTab(), movingCardsUntilExprs, movingCardsUntilNumberOfHits,
|
||||
movingCardsUntilAutoPlay);
|
||||
if (!dlg.exec()) {
|
||||
return;
|
||||
|
|
@ -598,7 +598,7 @@ void PlayerActions::actMoveBottomCardsToGrave()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Move bottom cards to grave"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Move bottom cards to grave"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberBottomCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -630,7 +630,7 @@ void PlayerActions::actMoveBottomCardsToExile()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Move bottom cards to exile"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Move bottom cards to exile"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberBottomCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -747,7 +747,7 @@ void PlayerActions::actDrawBottomCards()
|
|||
}
|
||||
|
||||
bool ok;
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Draw bottom cards"),
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Draw bottom cards"),
|
||||
tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberBottomCards, 1,
|
||||
maxCards, 1, &ok);
|
||||
if (!ok) {
|
||||
|
|
@ -821,7 +821,7 @@ void PlayerActions::actUntapAll()
|
|||
|
||||
void PlayerActions::actRollDie()
|
||||
{
|
||||
DlgRollDice dlg(/* player->getGame() */ nullptr);
|
||||
DlgRollDice dlg(player->getGame()->getTab());
|
||||
if (!dlg.exec()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -834,7 +834,7 @@ void PlayerActions::actRollDie()
|
|||
|
||||
void PlayerActions::actCreateToken()
|
||||
{
|
||||
DlgCreateToken dlg(player->getPlayerMenu()->getPredefinedTokens(), /* player->getGame() */ nullptr);
|
||||
DlgCreateToken dlg(player->getPlayerMenu()->getPredefinedTokens(), player->getGame()->getTab());
|
||||
if (!dlg.exec()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1022,7 +1022,7 @@ bool PlayerActions::createRelatedFromRelation(const CardItem *sourceCard, const
|
|||
if (cardRelation->getIsVariable()) {
|
||||
bool ok;
|
||||
player->setDialogSemaphore(true);
|
||||
int count = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Create tokens"), tr("Number:"),
|
||||
int count = QInputDialog::getInt(player->getGame()->getTab(), tr("Create tokens"), tr("Number:"),
|
||||
cardRelation->getDefaultCount(), 1, MAX_TOKENS_PER_DIALOG, 1, &ok);
|
||||
player->setDialogSemaphore(false);
|
||||
if (!ok) {
|
||||
|
|
@ -1188,7 +1188,7 @@ void PlayerActions::actMoveCardXCardsFromTop()
|
|||
int deckSize = player->getDeckZone()->getCards().size() + 1; // add the card to move to the deck
|
||||
bool ok;
|
||||
int number =
|
||||
QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Place card X cards from top of library"),
|
||||
QInputDialog::getInt(player->getGame()->getTab(), tr("Place card X cards from top of library"),
|
||||
tr("Which position should this card be placed:") + "\n" + tr("(max. %1)").arg(deckSize),
|
||||
defaultNumberTopCardsToPlaceBelow, 1, deckSize, 1, &ok);
|
||||
number -= 1; // indexes start at 0
|
||||
|
|
@ -1348,7 +1348,7 @@ void PlayerActions::actSetPT()
|
|||
}
|
||||
bool ok;
|
||||
player->setDialogSemaphore(true);
|
||||
QString pt = getTextWithMax(/* player->getGame() */ nullptr, tr("Change power/toughness"), tr("Change stats to:"),
|
||||
QString pt = getTextWithMax(player->getGame()->getTab(), tr("Change power/toughness"), tr("Change stats to:"),
|
||||
QLineEdit::Normal, oldPT, &ok);
|
||||
player->setDialogSemaphore(false);
|
||||
if (player->clearCardsToDelete() || !ok) {
|
||||
|
|
@ -1466,7 +1466,7 @@ void PlayerActions::actSetAnnotation()
|
|||
}
|
||||
|
||||
player->setDialogSemaphore(true);
|
||||
AnnotationDialog *dialog = new AnnotationDialog(/* player->getGame() */);
|
||||
AnnotationDialog *dialog = new AnnotationDialog(player->getGame()->getTab());
|
||||
dialog->setOptions(QInputDialog::UsePlainTextEditForTextInput);
|
||||
dialog->setWindowTitle(tr("Set annotation"));
|
||||
dialog->setLabelText(tr("Please enter the new annotation:"));
|
||||
|
|
@ -1562,8 +1562,8 @@ void PlayerActions::actCardCounterTrigger()
|
|||
auto *card = static_cast<CardItem *>(player->getGameScene()->selectedItems().first());
|
||||
oldValue = card->getCounters().value(counterId, 0);
|
||||
}
|
||||
int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Set counters"), tr("Number:"),
|
||||
oldValue, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
int number = QInputDialog::getInt(player->getGame()->getTab(), tr("Set counters"), tr("Number:"), oldValue,
|
||||
0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
player->setDialogSemaphore(false);
|
||||
if (player->clearCardsToDelete() || !ok) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue