mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 13:03:55 -07:00
Capture cards before semaphore.
Took 1 minute
This commit is contained in:
parent
9be9b0c05a
commit
94a4d5b13a
1 changed files with 6 additions and 3 deletions
|
|
@ -248,6 +248,7 @@ void PlayerDialogs::onMoveCardXCardsFromTopDialogRequested(int defaultNumberTopC
|
|||
void PlayerDialogs::onSetPTDialogRequested(const QString &oldPT)
|
||||
{
|
||||
bool ok;
|
||||
auto cards = player->getGameScene()->selectedCards();
|
||||
emit requestDialogSemaphore(true);
|
||||
QString pt = getTextWithMax(dialogParent(), tr("Change power/toughness"), tr("Change stats to:"), QLineEdit::Normal,
|
||||
oldPT, &ok);
|
||||
|
|
@ -257,11 +258,12 @@ void PlayerDialogs::onSetPTDialogRequested(const QString &oldPT)
|
|||
return;
|
||||
}
|
||||
|
||||
playerActions->actSetPT(player->getGameScene()->selectedCards(), pt);
|
||||
playerActions->actSetPT(cards, pt);
|
||||
}
|
||||
|
||||
void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation)
|
||||
{
|
||||
auto cards = player->getGameScene()->selectedCards();
|
||||
emit requestDialogSemaphore(true);
|
||||
AnnotationDialog *dialog = new AnnotationDialog(dialogParent());
|
||||
dialog->setOptions(QInputDialog::UsePlainTextEditForTextInput);
|
||||
|
|
@ -274,11 +276,12 @@ void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation)
|
|||
return;
|
||||
}
|
||||
QString annotation = dialog->textValue().left(MAX_NAME_LENGTH);
|
||||
playerActions->actSetAnnotation(player->getGameScene()->selectedCards(), annotation);
|
||||
playerActions->actSetAnnotation(cards, annotation);
|
||||
}
|
||||
|
||||
void PlayerDialogs::onSetCardCounterDialogRequested(int counterId, const QString &oldValueForDlg)
|
||||
{
|
||||
auto cards = player->getGameScene()->selectedCards();
|
||||
emit requestDialogSemaphore(true);
|
||||
|
||||
auto &cardCounterSettings = SettingsCache::instance().cardCounters();
|
||||
|
|
@ -291,5 +294,5 @@ void PlayerDialogs::onSetCardCounterDialogRequested(int counterId, const QString
|
|||
if (!ok || player->getLogic()->clearCardsToDelete()) {
|
||||
return;
|
||||
}
|
||||
playerActions->actSetCardCounter(player->getGameScene()->selectedCards(), counterId, dialog.textValue());
|
||||
playerActions->actSetCardCounter(cards, counterId, dialog.textValue());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue