Show current counter value on "set counter" dialog (#3650)
* fix point 10 of issue #655 * clanfigyism
This commit is contained in:
parent
6f95556632
commit
2d8f01b2e9
1 changed files with 8 additions and 2 deletions
|
@ -2855,8 +2855,14 @@ void Player::actCardCounterTrigger()
|
|||
case 11: { // set counter with dialog
|
||||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
int number =
|
||||
QInputDialog::getInt(nullptr, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
|
||||
int oldValue = 0;
|
||||
if (scene()->selectedItems().size() == 1) {
|
||||
auto *card = static_cast<CardItem *>(scene()->selectedItems().first());
|
||||
oldValue = card->getCounters().value(counterId, 0);
|
||||
}
|
||||
int number = QInputDialog::getInt(nullptr, tr("Set counters"), tr("Number:"), oldValue, 0,
|
||||
MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
dialogSemaphore = false;
|
||||
if (clearCardsToDelete() || !ok) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue