mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 21:13: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)
|
void PlayerDialogs::onSetPTDialogRequested(const QString &oldPT)
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
auto cards = player->getGameScene()->selectedCards();
|
||||||
emit requestDialogSemaphore(true);
|
emit requestDialogSemaphore(true);
|
||||||
QString pt = getTextWithMax(dialogParent(), tr("Change power/toughness"), tr("Change stats to:"), QLineEdit::Normal,
|
QString pt = getTextWithMax(dialogParent(), tr("Change power/toughness"), tr("Change stats to:"), QLineEdit::Normal,
|
||||||
oldPT, &ok);
|
oldPT, &ok);
|
||||||
|
|
@ -257,11 +258,12 @@ void PlayerDialogs::onSetPTDialogRequested(const QString &oldPT)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
playerActions->actSetPT(player->getGameScene()->selectedCards(), pt);
|
playerActions->actSetPT(cards, pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation)
|
void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation)
|
||||||
{
|
{
|
||||||
|
auto cards = player->getGameScene()->selectedCards();
|
||||||
emit requestDialogSemaphore(true);
|
emit requestDialogSemaphore(true);
|
||||||
AnnotationDialog *dialog = new AnnotationDialog(dialogParent());
|
AnnotationDialog *dialog = new AnnotationDialog(dialogParent());
|
||||||
dialog->setOptions(QInputDialog::UsePlainTextEditForTextInput);
|
dialog->setOptions(QInputDialog::UsePlainTextEditForTextInput);
|
||||||
|
|
@ -274,11 +276,12 @@ void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString annotation = dialog->textValue().left(MAX_NAME_LENGTH);
|
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)
|
void PlayerDialogs::onSetCardCounterDialogRequested(int counterId, const QString &oldValueForDlg)
|
||||||
{
|
{
|
||||||
|
auto cards = player->getGameScene()->selectedCards();
|
||||||
emit requestDialogSemaphore(true);
|
emit requestDialogSemaphore(true);
|
||||||
|
|
||||||
auto &cardCounterSettings = SettingsCache::instance().cardCounters();
|
auto &cardCounterSettings = SettingsCache::instance().cardCounters();
|
||||||
|
|
@ -291,5 +294,5 @@ void PlayerDialogs::onSetCardCounterDialogRequested(int counterId, const QString
|
||||||
if (!ok || player->getLogic()->clearCardsToDelete()) {
|
if (!ok || player->getLogic()->clearCardsToDelete()) {
|
||||||
return;
|
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