phase toolbar fixed

This commit is contained in:
Max-Wilhelm Bruker 2010-09-07 02:03:54 +02:00
parent 0b98d90337
commit 4d0c9962f4
3 changed files with 11 additions and 6 deletions

View file

@ -152,20 +152,20 @@ void PhasesToolbar::phaseButtonClicked()
PhaseButton *button = qobject_cast<PhaseButton *>(sender());
if (button->getActive())
button->triggerDoubleClickAction();
emit sendGameCommand(new Command_SetActivePhase(-1, buttonList.indexOf(button)));
emit sendGameCommand(new Command_SetActivePhase(-1, buttonList.indexOf(button)), -1);
}
void PhasesToolbar::actNextTurn()
{
emit sendGameCommand(new Command_NextTurn);
emit sendGameCommand(new Command_NextTurn, -1);
}
void PhasesToolbar::actUntapAll()
{
emit sendGameCommand(new Command_SetCardAttr(-1, "table", -1, "tapped", "0"));
emit sendGameCommand(new Command_SetCardAttr(-1, "table", -1, "tapped", "0"), -1);
}
void PhasesToolbar::actDrawCard()
{
emit sendGameCommand(new Command_DrawCards(-1, 1));
emit sendGameCommand(new Command_DrawCards(-1, 1), -1);
}

View file

@ -45,7 +45,7 @@ private slots:
void actUntapAll();
void actDrawCard();
signals:
void sendGameCommand(GameCommand *command);
void sendGameCommand(GameCommand *command, int playerId);
};
#endif

View file

@ -384,8 +384,10 @@ void TabGame::processGameEventContainer(GameEventContainer *cont)
void TabGame::sendGameCommand(GameCommand *command, int playerId)
{
if (playerId == -1)
playerId = getActiveLocalPlayer()->getId();
command->setGameId(gameId);
AbstractClient *client;
if (clients.size() > 1)
client = clients.at(playerId);
@ -396,6 +398,9 @@ void TabGame::sendGameCommand(GameCommand *command, int playerId)
void TabGame::sendCommandContainer(CommandContainer *cont, int playerId)
{
if (playerId == -1)
playerId = getActiveLocalPlayer()->getId();
const QList<Command *> &cmdList = cont->getCommandList();
for (int i = 0; i < cmdList.size(); ++i) {
GameCommand *cmd = qobject_cast<GameCommand *>(cmdList[i]);