moved carddraw from game to player; qt 4.4 compilation fix; minor behaviour change

This commit is contained in:
Max-Wilhelm Bruker 2009-08-22 01:26:35 +02:00
parent 557aed2ed7
commit 0d84de2384
8 changed files with 315 additions and 260 deletions

View file

@ -37,15 +37,6 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a
aSetLife->setShortcut(tr("Ctrl+L"));
connect(aSetLife, SIGNAL(triggered()), this, SLOT(actSetLife()));
aShuffle = new QAction(tr("&Shuffle"), this);
aShuffle->setShortcut(tr("Ctrl+S"));
connect(aShuffle, SIGNAL(triggered()), this, SLOT(actShuffle()));
aDraw = new QAction(tr("&Draw a card"), this);
aDraw->setShortcut(tr("Ctrl+D"));
connect(aDraw, SIGNAL(triggered()), this, SLOT(actDrawCard()));
aDrawCards = new QAction(tr("D&raw cards..."), this);
connect(aDrawCards, SIGNAL(triggered()), this, SLOT(actDrawCards()));
aDrawCards->setShortcut(tr("Ctrl+E"));
aRollDice = new QAction(tr("R&oll dice..."), this);
aRollDice->setShortcut(tr("Ctrl+I"));
connect(aRollDice, SIGNAL(triggered()), this, SLOT(actRollDice()));
@ -70,9 +61,6 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a
actionsMenu->addAction(aIncLife);
actionsMenu->addAction(aSetLife);
actionsMenu->addSeparator();
actionsMenu->addAction(aShuffle);
actionsMenu->addAction(aDraw);
actionsMenu->addAction(aDrawCards);
actionsMenu->addAction(aRollDice);
actionsMenu->addSeparator();
actionsMenu->addAction(aCreateToken);
@ -354,11 +342,6 @@ void Game::actSetLife()
client->setCounter("life", life);
}
void Game::actShuffle()
{
client->shuffle();
}
void Game::actRollDice()
{
bool ok;
@ -367,18 +350,6 @@ void Game::actRollDice()
client->rollDice(sides);
}
void Game::actDrawCard()
{
client->drawCards(1);
}
void Game::actDrawCards()
{
int number = QInputDialog::getInteger(0, tr("Draw cards"), tr("Number:"));
if (number)
client->drawCards(number);
}
void Game::actCreateToken()
{
QString cardname = QInputDialog::getText(0, tr("Create token"), tr("Name:"));