support <tablerow> for tokens; fix #232

This commit is contained in:
Fabio Bas 2015-06-24 10:31:00 +02:00
parent 9f24728301
commit ed24b38add
2 changed files with 5 additions and 1 deletions

View file

@ -102,6 +102,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
shortcutsActive(false),
defaultNumberTopCards(1),
lastTokenDestroy(true),
lastTokenTableRow(0),
id(_id),
active(false),
local(_local),
@ -1035,6 +1036,7 @@ void Player::actCreateToken()
lastTokenPT = dlg.getPT();
if (CardInfo *correctedCard = db->getCardBySimpleName(lastTokenName, false)) {
lastTokenName = correctedCard->getName();
lastTokenTableRow = 2 - correctedCard->getTableRow();
if (lastTokenPT.isEmpty())
lastTokenPT = correctedCard->getPowTough();
}
@ -1056,7 +1058,7 @@ void Player::actCreateAnotherToken()
cmd.set_annotation(lastTokenAnnotation.toStdString());
cmd.set_destroy_on_zone_change(lastTokenDestroy);
cmd.set_x(-1);
cmd.set_y(0);
cmd.set_y(lastTokenTableRow);
sendGameCommand(cmd);
}
@ -1070,6 +1072,7 @@ void Player::actCreatePredefinedToken()
lastTokenColor = cardInfo->getColors().isEmpty() ? QString() : cardInfo->getColors().first().toLower();
lastTokenPT = cardInfo->getPowTough();
lastTokenAnnotation = cardInfo->getText();
lastTokenTableRow = 2 - cardInfo->getTableRow();
lastTokenDestroy = true;
aCreateAnotherToken->setEnabled(true);

View file

@ -185,6 +185,7 @@ private:
int defaultNumberTopCards;
QString lastTokenName, lastTokenColor, lastTokenPT, lastTokenAnnotation;
bool lastTokenDestroy;
int lastTokenTableRow;
ServerInfo_User *userInfo;
int id;
bool active;