Commit ed24b38a authored by Fabio Bas's avatar Fabio Bas
Browse files

support <tablerow> for tokens; fix #232

parent 9f247283
......@@ -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);
......
......@@ -185,6 +185,7 @@ private:
int defaultNumberTopCards;
QString lastTokenName, lastTokenColor, lastTokenPT, lastTokenAnnotation;
bool lastTokenDestroy;
int lastTokenTableRow;
ServerInfo_User *userInfo;
int id;
bool active;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment