Rework patch for "move to.." menu; fix "P/T"-related menus
This commit is contained in:
parent
ea1067189d
commit
0abd1fb299
1 changed files with 17 additions and 3 deletions
|
@ -1900,12 +1900,16 @@ void Player::cardMenuAction()
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game->sendGameCommand(prepareGameCommand(commandList), getId());
|
if(local)
|
||||||
|
sendGameCommand(prepareGameCommand(commandList));
|
||||||
|
else
|
||||||
|
game->sendGameCommand(prepareGameCommand(commandList));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::actIncPT(int deltaP, int deltaT)
|
void Player::actIncPT(int deltaP, int deltaT)
|
||||||
{
|
{
|
||||||
QString ptString = "+" + QString::number(deltaP) + "/+" + QString::number(deltaT);
|
QString ptString = "+" + QString::number(deltaP) + "/+" + QString::number(deltaT);
|
||||||
|
int playerid = id;
|
||||||
|
|
||||||
QList< const ::google::protobuf::Message * > commandList;
|
QList< const ::google::protobuf::Message * > commandList;
|
||||||
QListIterator<QGraphicsItem *> j(scene()->selectedItems());
|
QListIterator<QGraphicsItem *> j(scene()->selectedItems());
|
||||||
|
@ -1917,13 +1921,19 @@ void Player::actIncPT(int deltaP, int deltaT)
|
||||||
cmd->set_attribute(AttrPT);
|
cmd->set_attribute(AttrPT);
|
||||||
cmd->set_attr_value(ptString.toStdString());
|
cmd->set_attr_value(ptString.toStdString());
|
||||||
commandList.append(cmd);
|
commandList.append(cmd);
|
||||||
|
|
||||||
|
if(local)
|
||||||
|
playerid=card->getZone()->getPlayer()->getId();
|
||||||
}
|
}
|
||||||
sendGameCommand(prepareGameCommand(commandList));
|
|
||||||
|
game->sendGameCommand(prepareGameCommand(commandList), playerid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::actSetPT()
|
void Player::actSetPT()
|
||||||
{
|
{
|
||||||
QString oldPT;
|
QString oldPT;
|
||||||
|
int playerid = id;
|
||||||
|
|
||||||
QListIterator<QGraphicsItem *> i(scene()->selectedItems());
|
QListIterator<QGraphicsItem *> i(scene()->selectedItems());
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
CardItem *card = static_cast<CardItem *>(i.next());
|
CardItem *card = static_cast<CardItem *>(i.next());
|
||||||
|
@ -1949,8 +1959,12 @@ void Player::actSetPT()
|
||||||
cmd->set_attribute(AttrPT);
|
cmd->set_attribute(AttrPT);
|
||||||
cmd->set_attr_value(pt.toStdString());
|
cmd->set_attr_value(pt.toStdString());
|
||||||
commandList.append(cmd);
|
commandList.append(cmd);
|
||||||
|
|
||||||
|
if(local)
|
||||||
|
playerid=card->getZone()->getPlayer()->getId();
|
||||||
}
|
}
|
||||||
sendGameCommand(prepareGameCommand(commandList));
|
|
||||||
|
game->sendGameCommand(prepareGameCommand(commandList), playerid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::actDrawArrow()
|
void Player::actDrawArrow()
|
||||||
|
|
Loading…
Reference in a new issue