add the amount of cards logged to the reveal cards event (#3516)

* add the amount of cards logged to the reveal cards event

sets cardname to the amount for the call if not 1 for the fromstr only
add braces for single line statements

* zach cleanup
This commit is contained in:
ebbit1q 2019-01-24 08:53:05 +01:00 committed by ctrlaltca
parent ed70099e36
commit 495e232c22
4 changed files with 47 additions and 30 deletions

View file

@ -1830,14 +1830,14 @@ void Player::eventRevealCards(const Event_RevealCards &event)
}
if (peeking) {
for (auto i : cardList) {
QString cardName = QString::fromStdString(i->name());
CardItem *card = zone->getCard(i->id(), QString());
if (!card) {
for (auto &card : cardList) {
QString cardName = QString::fromStdString(card->name());
CardItem *cardItem = zone->getCard(card->id(), QString());
if (!cardItem) {
continue;
}
card->setName(cardName);
emit logRevealCards(this, zone, i->id(), cardName, this, true);
cardItem->setName(cardName);
emit logRevealCards(this, zone, card->id(), cardName, this, true, 1);
}
} else {
bool showZoneView = true;
@ -1854,7 +1854,7 @@ void Player::eventRevealCards(const Event_RevealCards &event)
static_cast<GameScene *>(scene())->addRevealedZoneView(this, zone, cardList, event.grant_write_access());
}
emit logRevealCards(this, zone, event.card_id(), cardName, otherPlayer, false);
emit logRevealCards(this, zone, event.card_id(), cardName, otherPlayer, false, cardList.size());
}
}