diff --git a/cockatrice/src/chatwidget.cpp b/cockatrice/src/chatwidget.cpp index d42e7ef1..065afdf6 100644 --- a/cockatrice/src/chatwidget.cpp +++ b/cockatrice/src/chatwidget.cpp @@ -103,7 +103,6 @@ void ChatWidget::retranslateUi() joinButton->setText(tr("Joi&n")); QTreeWidgetItem *header = channelList->headerItem(); - Q_ASSERT(header != 0); header->setText(0, tr("Channel")); header->setText(1, tr("Players")); header->setTextAlignment(1, Qt::AlignRight); diff --git a/cockatrice/src/client.cpp b/cockatrice/src/client.cpp index cd8407c3..f5b9d28d 100644 --- a/cockatrice/src/client.cpp +++ b/cockatrice/src/client.cpp @@ -301,9 +301,9 @@ PendingCommand *Client::shuffle() return cmd("shuffle"); } -PendingCommand *Client::rollDice(unsigned int sides) +PendingCommand *Client::rollDie(unsigned int sides) { - return cmd(QString("roll_dice|%1").arg(sides)); + return cmd(QString("roll_die|%1").arg(sides)); } PendingCommand *Client::drawCards(unsigned int number) diff --git a/cockatrice/src/client.h b/cockatrice/src/client.h index 9aac7c76..c799dadd 100644 --- a/cockatrice/src/client.h +++ b/cockatrice/src/client.h @@ -106,7 +106,7 @@ public slots: PendingCommand *login(const QString &name, const QString &pass); PendingCommand *say(const QString &s); PendingCommand *shuffle(); - PendingCommand *rollDice(unsigned int sides); + PendingCommand *rollDie(unsigned int sides); PendingCommand *drawCards(unsigned int number); PendingCommand *moveCard(int cardid, const QString &startzone, const QString &targetzone, int x, int y = 0, bool faceDown = false); PendingCommand *createToken(const QString &zone, const QString &name, const QString &powtough, int x, int y); diff --git a/cockatrice/src/game.cpp b/cockatrice/src/game.cpp index f3638983..1cf464a2 100644 --- a/cockatrice/src/game.cpp +++ b/cockatrice/src/game.cpp @@ -23,33 +23,25 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a connect(client, SIGNAL(gameEvent(const ServerEventData &)), this, SLOT(gameEvent(const ServerEventData &))); connect(client, SIGNAL(playerListReceived(QList)), this, SLOT(playerListReceived(QList))); - aUntapAll = new QAction(tr("&Untap all permanents"), this); - aUntapAll->setShortcut(tr("Ctrl+U")); + aUntapAll = new QAction(this); connect(aUntapAll, SIGNAL(triggered()), this, SLOT(actUntapAll())); - aDecLife = new QAction(tr("&Decrement life"), this); - aDecLife->setShortcut(tr("F11")); + aDecLife = new QAction(this); connect(aDecLife, SIGNAL(triggered()), this, SLOT(actDecLife())); - aIncLife = new QAction(tr("&Increment life"), this); - aIncLife->setShortcut(tr("F12")); + aIncLife = new QAction(this); connect(aIncLife, SIGNAL(triggered()), this, SLOT(actIncLife())); - aSetLife = new QAction(tr("&Set life"), this); - aSetLife->setShortcut(tr("Ctrl+L")); + aSetLife = new QAction(this); connect(aSetLife, SIGNAL(triggered()), this, SLOT(actSetLife())); - aRollDice = new QAction(tr("R&oll dice..."), this); - aRollDice->setShortcut(tr("Ctrl+I")); - connect(aRollDice, SIGNAL(triggered()), this, SLOT(actRollDice())); + aRollDie = new QAction(this); + connect(aRollDie, SIGNAL(triggered()), this, SLOT(actRollDie())); - aCreateToken = new QAction(tr("&Create token..."), this); - aCreateToken->setShortcut(tr("Ctrl+T")); + aCreateToken = new QAction(this); connect(aCreateToken, SIGNAL(triggered()), this, SLOT(actCreateToken())); - aNextPhase = new QAction(tr("Next &phase"), this); - aNextPhase->setShortcut(tr("Ctrl+Space")); + aNextPhase = new QAction(this); connect(aNextPhase, SIGNAL(triggered()), this, SLOT(actNextPhase())); - aNextTurn = new QAction(tr("Next &turn"), this); - aNextTurn->setShortcuts(QList() << QKeySequence(tr("Ctrl+Return")) << QKeySequence(tr("Ctrl+Enter"))); + aNextTurn = new QAction(this); connect(aNextTurn, SIGNAL(triggered()), this, SLOT(actNextTurn())); actionsMenu->addAction(aNextPhase); @@ -61,25 +53,25 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a actionsMenu->addAction(aIncLife); actionsMenu->addAction(aSetLife); actionsMenu->addSeparator(); - actionsMenu->addAction(aRollDice); + actionsMenu->addAction(aRollDie); actionsMenu->addSeparator(); actionsMenu->addAction(aCreateToken); actionsMenu->addSeparator(); - sayMenu = actionsMenu->addMenu(tr("S&ay")); + sayMenu = actionsMenu->addMenu(QString()); initSayMenu(); - aTap = new QAction(tr("&Tap"), this); - aUntap = new QAction(tr("&Untap"), this); - aDoesntUntap = new QAction(tr("Toggle &normal untapping"), this); - aFlip = new QAction(tr("&Flip"), this); - aAddCounter = new QAction(tr("&Add counter"), this); - aRemoveCounter = new QAction(tr("&Remove counter"), this); - aSetCounters = new QAction(tr("&Set counters..."), this); + aTap = new QAction(this); + aUntap = new QAction(this); + aDoesntUntap = new QAction(this); + aFlip = new QAction(this); + aAddCounter = new QAction(this); + aRemoveCounter = new QAction(this); + aSetCounters = new QAction(this); connect(aSetCounters, SIGNAL(triggered()), this, SLOT(actSetCounters())); - aMoveToTopLibrary = new QAction(tr("&top of library"), this); - aMoveToBottomLibrary = new QAction(tr("&bottom of library"), this); - aMoveToGraveyard = new QAction(tr("&graveyard"), this); - aMoveToExile = new QAction(tr("&exile"), this); + aMoveToTopLibrary = new QAction(this); + aMoveToBottomLibrary = new QAction(this); + aMoveToGraveyard = new QAction(this); + aMoveToExile = new QAction(this); cardMenu->addAction(aTap); cardMenu->addAction(aUntap); @@ -91,7 +83,7 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a cardMenu->addAction(aRemoveCounter); cardMenu->addAction(aSetCounters); cardMenu->addSeparator(); - moveMenu = cardMenu->addMenu(tr("&Move to")); + moveMenu = cardMenu->addMenu(QString()); moveMenu->addAction(aMoveToTopLibrary); moveMenu->addAction(aMoveToBottomLibrary); @@ -118,6 +110,8 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a dlgStartGame = new DlgStartGame(db); connect(dlgStartGame, SIGNAL(newDeckLoaded(const QStringList &)), client, SLOT(submitDeck(const QStringList &))); connect(dlgStartGame, SIGNAL(finished(int)), this, SLOT(readyStart())); + + retranslateUi(); } Game::~Game() @@ -129,6 +123,45 @@ Game::~Game() } } +void Game::retranslateUi() +{ + aUntapAll->setText(tr("&Untap all permanents")); + aUntapAll->setShortcut(tr("Ctrl+U")); + aDecLife->setText(tr("&Decrement life")); + aDecLife->setShortcut(tr("F11")); + aIncLife->setText(tr("&Increment life")); + aIncLife->setShortcut(tr("F12")); + aSetLife->setText(tr("&Set life")); + aSetLife->setShortcut(tr("Ctrl+L")); + aRollDie->setText(tr("R&oll die...")); + aRollDie->setShortcut(tr("Ctrl+I")); + aCreateToken->setText(tr("&Create token...")); + aCreateToken->setShortcut(tr("Ctrl+T")); + aNextPhase->setText(tr("Next &phase")); + aNextPhase->setShortcut(tr("Ctrl+Space")); + aNextTurn->setText(tr("Next &turn")); + aNextTurn->setShortcuts(QList() << QKeySequence(tr("Ctrl+Return")) << QKeySequence(tr("Ctrl+Enter"))); + + sayMenu->setTitle(tr("S&ay")); + + aTap->setText(tr("&Tap")); + aUntap->setText(tr("&Untap")); + aDoesntUntap->setText(tr("Toggle &normal untapping")); + aFlip->setText(tr("&Flip")); + aAddCounter->setText(tr("&Add counter")); + aRemoveCounter->setText(tr("&Remove counter")); + aSetCounters->setText(tr("&Set counters...")); + aMoveToTopLibrary->setText(tr("&top of library")); + aMoveToBottomLibrary->setText(tr("&bottom of library")); + aMoveToGraveyard->setText(tr("&graveyard")); + aMoveToExile->setText(tr("&exile")); + + moveMenu->setTitle(tr("&Move to")); + + for (int i = 0; i < players.size(); ++i) + players[i]->retranslateUi(); +} + void Game::initSayMenu() { sayMenu->clear(); @@ -238,11 +271,11 @@ void Game::gameEvent(const ServerEventData &msg) case eventShuffle: emit logShuffle(p); break; - case eventRollDice: { + case eventRollDie: { QStringList data = msg.getEventData(); int sides = data[0].toInt(); int roll = data[1].toInt(); - emit logRollDice(p, sides, roll); + emit logRollDie(p, sides, roll); break; } case eventSetActivePlayer: { @@ -279,12 +312,24 @@ void Game::gameEvent(const ServerEventData &msg) } case eventDumpZone: { QStringList data = msg.getEventData(); - emit logDumpZone(p, data[1], players.findPlayer(data[0].toInt())->getName(), data[2].toInt()); + Player *zoneOwner = players.findPlayer(data[0].toInt()); + if (!zoneOwner) + break; + CardZone *zone = zoneOwner->getZones()->findZone(data[1]); + if (!zone) + break; + emit logDumpZone(p, zone, zoneOwner, data[2].toInt()); break; } case eventStopDumpZone: { QStringList data = msg.getEventData(); - emit logStopDumpZone(p, data[1], players.findPlayer(data[0].toInt())->getName()); + Player *zoneOwner = players.findPlayer(data[0].toInt()); + if (!zoneOwner) + break; + CardZone *zone = zoneOwner->getZones()->findZone(data[1]); + if (!zone) + break; + emit logStopDumpZone(p, zone, zoneOwner); break; } case eventMoveCard: { @@ -345,12 +390,12 @@ void Game::actSetLife() client->setCounter("life", life); } -void Game::actRollDice() +void Game::actRollDie() { bool ok; - int sides = QInputDialog::getInteger(0, tr("Roll dice"), tr("Number of sides:"), 20, 2, 1000, 1, &ok); + int sides = QInputDialog::getInteger(0, tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok); if (ok) - client->rollDice(sides); + client->rollDie(sides); } void Game::actCreateToken() diff --git a/cockatrice/src/game.h b/cockatrice/src/game.h index 5db758c9..7d3d0710 100644 --- a/cockatrice/src/game.h +++ b/cockatrice/src/game.h @@ -24,7 +24,7 @@ private: QMenu *actionsMenu, *sayMenu, *cardMenu, *moveMenu; QAction *aTap, *aUntap, *aDoesntUntap, *aFlip, *aAddCounter, *aRemoveCounter, *aSetCounters, *aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToGraveyard, *aMoveToExile, - *aNextPhase, *aNextTurn, *aUntapAll, *aDecLife, *aIncLife, *aSetLife, *aRollDice, *aCreateToken; + *aNextPhase, *aNextTurn, *aUntapAll, *aDecLife, *aIncLife, *aSetLife, *aRollDie, *aCreateToken; DlgStartGame *dlgStartGame; CardDatabase *db; @@ -45,7 +45,7 @@ private slots: void actIncLife(); void actDecLife(); void actSetLife(); - void actRollDice(); + void actRollDie(); void actCreateToken(); void showCardMenu(QPoint p); @@ -80,7 +80,7 @@ signals: void logGameStart(); void logSay(Player *player, QString text); void logShuffle(Player *player); - void logRollDice(Player *player, int sides, int roll); + void logRollDie(Player *player, int sides, int roll); void logDraw(Player *player, int number); void logMoveCard(Player *player, QString cardName, CardZone *startZone, int oldX, CardZone *targetZone, int newX); void logCreateToken(Player *player, QString cardName); @@ -88,14 +88,15 @@ signals: void logSetTapped(Player *player, QString cardName, bool tapped); void logSetCounter(Player *player, QString counterName, int value, int oldValue); void logSetDoesntUntap(Player *player, QString cardName, bool doesntUntap); - void logDumpZone(Player *player, QString zoneName, QString zoneOwner, int numberCards); - void logStopDumpZone(Player *player, QString zoneName, QString zoneOwner); + void logDumpZone(Player *player, CardZone *zone, Player *zoneOwner, int numberCards); + void logStopDumpZone(Player *player, CardZone *zone, Player *zoneOwner); void logSetActivePlayer(Player *player); void setActivePhase(int phase); public: Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_actionsMenu, QMenu *_cardMenu, int playerId, const QString &playerName, QObject *parent = 0); ~Game(); Player *getLocalPlayer() const { return localPlayer; } + void retranslateUi(); void restartGameDialog(); void hoverCardEvent(CardItem *card); }; diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index 15335d16..2a553e4f 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -3,7 +3,7 @@ #include "player.h" #include "cardzone.h" -QString MessageLogWidget::sanitizeHtml(QString dirty) +QString MessageLogWidget::sanitizeHtml(QString dirty) const { return dirty .replace("&", "&") @@ -11,6 +11,29 @@ QString MessageLogWidget::sanitizeHtml(QString dirty) .replace(">", ">"); } +QString MessageLogWidget::trZoneName(CardZone *zone, Player *owner, bool hisOwn, GrammaticalCase gc) const +{ + if (zone->getName() == "hand") + switch (gc) { +// case CaseNominative: return hisOwn ? tr("his hand") : tr("%1's hand").arg(owner->getName()); + case CaseGenitive: return hisOwn ? tr("of his hand") : tr("of %1's hand").arg(owner->getName()); + case CaseAccusative: return hisOwn ? tr("his hand") : tr("%1's hand").arg(owner->getName()); + } + else if (zone->getName() == "deck") + switch (gc) { +// case CaseNominative: return hisOwn ? tr("his library") : tr("%1's library").arg(owner->getName()); + case CaseGenitive: return hisOwn ? tr("of his library") : tr("of %1's library").arg(owner->getName()); + case CaseAccusative: return hisOwn ? tr("his library") : tr("%1's library").arg(owner->getName()); + } + else if (zone->getName() == "sb") + switch (gc) { +// case CaseNominative: return hisOwn ? tr("his sideboard") : tr("%1's sideboard").arg(owner->getName()); + case CaseGenitive: return hisOwn ? tr("of his sideboard") : tr("of %1's sideboard").arg(owner->getName()); + case CaseAccusative: return hisOwn ? tr("his sideboard") : tr("%1's sideboard").arg(owner->getName()); + } + return QString(); +} + void MessageLogWidget::logConnecting(QString hostname) { append(tr("Connecting to %1...").arg(sanitizeHtml(hostname))); @@ -69,7 +92,7 @@ void MessageLogWidget::logReadyStart(Player *player) void MessageLogWidget::logGameStart() { - append(tr("Game has started.")); + append(tr("The game has started.")); } void MessageLogWidget::logSay(Player *player, QString message) @@ -79,20 +102,20 @@ void MessageLogWidget::logSay(Player *player, QString message) void MessageLogWidget::logShuffle(Player *player) { - append(tr("%1 shuffles his/her library").arg(sanitizeHtml(player->getName()))); + append(tr("%1 shuffles his library.").arg(sanitizeHtml(player->getName()))); } -void MessageLogWidget::logRollDice(Player *player, int sides, int roll) +void MessageLogWidget::logRollDie(Player *player, int sides, int roll) { - append(tr("%1 rolled a %2 with a %3-sided dice").arg(sanitizeHtml(player->getName())).arg(roll).arg(sides)); + append(tr("%1 rolls a %2 with a %3-sided die.").arg(sanitizeHtml(player->getName())).arg(roll).arg(sides)); } void MessageLogWidget::logDraw(Player *player, int number) { if (number == 1) - append(tr("%1 draws a card").arg(sanitizeHtml(player->getName()))); + append(tr("%1 draws a card.").arg(sanitizeHtml(player->getName()))); else - append(tr("%1 draws %2 cards").arg(sanitizeHtml(player->getName())).arg(number)); + append(tr("%1 draws %2 cards.").arg(sanitizeHtml(player->getName())).arg(number)); } void MessageLogWidget::logMoveCard(Player *player, QString cardName, CardZone *startZone, int oldX, CardZone *targetZone, int newX) @@ -102,60 +125,78 @@ void MessageLogWidget::logMoveCard(Player *player, QString cardName, CardZone *s if (((startName == "table") && (targetName == "table")) || ((startName == "hand") && (targetName == "hand"))) return; QString fromStr; + bool cardNameContainsStartZone = false; + if (startName == "table") - fromStr = tr("from table"); + fromStr = tr(" from table"); else if (startName == "grave") - fromStr = tr("from graveyard"); + fromStr = tr(" from graveyard"); else if (startName == "rfg") - fromStr = tr("from exile"); + fromStr = tr(" from exile"); else if (startName == "hand") - fromStr = tr("from hand"); + fromStr = tr(" from hand"); else if (startName == "deck") { - if (oldX == startZone->getCards().size() - 1) - fromStr = tr("from the bottom of his library"); - else if (oldX == 0) - fromStr = tr("from the top of his library"); - else - fromStr = tr("from library"); + if (oldX == startZone->getCards().size() - 1) { + if (cardName.isEmpty()) { + cardName = tr("the bottom card of his library"); + cardNameContainsStartZone = true; + } else + fromStr = tr(" from the bottom of his library"); + } else if (oldX == 0) { + if (cardName.isEmpty()) { + cardName = tr("the top card of his library"); + cardNameContainsStartZone = true; + } else + fromStr = tr(" from the top of his library"); + } else + fromStr = tr(" from library"); } else if (startName == "sb") - fromStr = tr("from sideboard"); + fromStr = tr(" from sideboard"); QString finalStr; if (targetName == "table") - finalStr = tr("%1 puts %2 into play %3"); + finalStr = tr("%1 puts %2 into play%3."); else if (targetName == "grave") - finalStr = tr("%1 puts %2 %3 into graveyard"); + finalStr = tr("%1 puts %2%3 into graveyard."); else if (targetName == "rfg") - finalStr = tr("%1 exiles %2 %3"); + finalStr = tr("%1 exiles %2%3."); else if (targetName == "hand") - finalStr = tr("%1 moves %2 %3 to hand"); + finalStr = tr("%1 moves %2%3 to hand."); else if (targetName == "deck") { if (newX == -1) - finalStr = tr("%1 puts %2 %3 into his library"); + finalStr = tr("%1 puts %2%3 into his library."); else if (newX == targetZone->getCards().size()) - finalStr = tr("%1 puts %2 %3 on bottom of his library"); + finalStr = tr("%1 puts %2%3 on bottom of his library."); else if (newX == 0) - finalStr = tr("%1 puts %2 %3 on top of his library"); + finalStr = tr("%1 puts %2%3 on top of his library."); else - finalStr = tr("%1 puts %2 %3 into his library at position %4"); + finalStr = tr("%1 puts %2%3 into his library at position %4."); } else if (targetName == "sb") - finalStr = tr("%1 moves %2 %3 to sideboard"); + finalStr = tr("%1 moves %2%3 to sideboard."); - append(finalStr.arg(sanitizeHtml(player->getName())).arg(cardName.isEmpty() ? tr("a card") : QString("%1").arg(sanitizeHtml(cardName))).arg(fromStr).arg(newX)); + QString cardStr; + if (cardNameContainsStartZone) + cardStr = cardName; + else if (cardName.isEmpty()) + cardStr = tr("a card"); + else + cardStr = QString("%1").arg(sanitizeHtml(cardName)); + + append(finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr).arg(newX)); } void MessageLogWidget::logCreateToken(Player *player, QString cardName) { - append(tr("%1 creates token: %2").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); + append(tr("%1 creates token: %2.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); } void MessageLogWidget::logSetCardCounters(Player *player, QString cardName, int value, int oldValue) { QString finalStr; if (value > oldValue) - finalStr = tr("%1 places %2 counters on %3 (now %4)"); + finalStr = tr("%1 places %2 counters on %3 (now %4)."); else - finalStr = tr("%1 removes %2 counters from %3 (now %4)"); + finalStr = tr("%1 removes %2 counters from %3 (now %4)."); append(finalStr.arg(sanitizeHtml(player->getName())).arg(abs(oldValue - value)).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(value)); } @@ -166,12 +207,12 @@ void MessageLogWidget::logSetTapped(Player *player, QString cardName, bool tappe cardStr = tr("his permanents"); else cardStr = QString("%1").arg(sanitizeHtml(cardName)); - append(tr("%1 %2 %3").arg(sanitizeHtml(player->getName())).arg(tapped ? tr("taps") : tr("untaps")).arg(cardStr)); + append(tr("%1 %2 %3.").arg(sanitizeHtml(player->getName())).arg(tapped ? tr("taps") : tr("untaps")).arg(cardStr)); } void MessageLogWidget::logSetCounter(Player *player, QString counterName, int value, int oldValue) { - append(tr("%1 sets counter \"%2\" to %3 (%4%5)").arg(sanitizeHtml(player->getName())).arg(counterName).arg(value).arg(value > oldValue ? "+" : "").arg(value - oldValue)); + append(tr("%1 sets counter \"%2\" to %3 (%4%5).").arg(sanitizeHtml(player->getName())).arg(counterName).arg(value).arg(value > oldValue ? "+" : "").arg(value - oldValue)); } void MessageLogWidget::logSetDoesntUntap(Player *player, QString cardName, bool doesntUntap) @@ -184,17 +225,18 @@ void MessageLogWidget::logSetDoesntUntap(Player *player, QString cardName, bool append(finalStr.arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); } -void MessageLogWidget::logDumpZone(Player *player, QString zoneName, QString zoneOwner, int numberCards) +void MessageLogWidget::logDumpZone(Player *player, CardZone *zone, Player *zoneOwner, int numberCards) { if (numberCards != -1) - append(tr("%1 is looking at the top %2 cards of %3's %4").arg(sanitizeHtml(player->getName())).arg(numberCards).arg(zoneOwner).arg(zoneName)); + append(tr("%1 is looking at the top %2 cards %3.").arg(sanitizeHtml(player->getName())).arg(numberCards).arg(trZoneName(zone, zoneOwner, zoneOwner == player, CaseGenitive))); else - append(tr("%1 is looking at %2's %3").arg(sanitizeHtml(player->getName())).arg(zoneOwner).arg(zoneName)); + append(tr("%1 is looking at %2.").arg(sanitizeHtml(player->getName())).arg(trZoneName(zone, zoneOwner, zoneOwner == player, CaseAccusative))); } -void MessageLogWidget::logStopDumpZone(Player *player, QString zoneName, QString zoneOwner) +void MessageLogWidget::logStopDumpZone(Player *player, CardZone *zone, Player *zoneOwner) { - append(tr("%1 stops looking at %2's %3").arg(sanitizeHtml(player->getName())).arg(zoneOwner).arg(zoneName)); + QString zoneName = trZoneName(zone, zoneOwner, zoneOwner == player, CaseAccusative); + append(tr("%1 stops looking at %2.").arg(sanitizeHtml(player->getName())).arg(zoneName)); } void MessageLogWidget::logSetActivePlayer(Player *player) @@ -218,7 +260,7 @@ void MessageLogWidget::logSetActivePhase(int phase) case 7: phaseName = tr("combat damage step"); break; case 8: phaseName = tr("end of combat step"); break; case 9: phaseName = tr("second main phase"); break; - case 10: phaseName = tr("end of turn step"); break; + case 10: phaseName = tr("ending phase"); break; } append("" + tr("It is now the %1.").arg(phaseName) + ""); } @@ -232,7 +274,7 @@ void MessageLogWidget::connectToGame(Game *game) connect(game, SIGNAL(logGameStart()), this, SLOT(logGameStart())); connect(game, SIGNAL(logSay(Player *, QString)), this, SLOT(logSay(Player *, QString))); connect(game, SIGNAL(logShuffle(Player *)), this, SLOT(logShuffle(Player *))); - connect(game, SIGNAL(logRollDice(Player *, int, int)), this, SLOT(logRollDice(Player *, int, int))); + connect(game, SIGNAL(logRollDie(Player *, int, int)), this, SLOT(logRollDie(Player *, int, int))); connect(game, SIGNAL(logDraw(Player *, int)), this, SLOT(logDraw(Player *, int))); connect(game, SIGNAL(logMoveCard(Player *, QString, CardZone *, int, CardZone *, int)), this, SLOT(logMoveCard(Player *, QString, CardZone *, int, CardZone *, int))); connect(game, SIGNAL(logCreateToken(Player *, QString)), this, SLOT(logCreateToken(Player *, QString))); @@ -240,8 +282,8 @@ void MessageLogWidget::connectToGame(Game *game) connect(game, SIGNAL(logSetTapped(Player *, QString, bool)), this, SLOT(logSetTapped(Player *, QString, bool))); connect(game, SIGNAL(logSetCounter(Player *, QString, int, int)), this, SLOT(logSetCounter(Player *, QString, int, int))); connect(game, SIGNAL(logSetDoesntUntap(Player *, QString, bool)), this, SLOT(logSetDoesntUntap(Player *, QString, bool))); - connect(game, SIGNAL(logDumpZone(Player *, QString, QString, int)), this, SLOT(logDumpZone(Player *, QString, QString, int))); - connect(game, SIGNAL(logStopDumpZone(Player *, QString, QString)), this, SLOT(logStopDumpZone(Player *, QString, QString))); + connect(game, SIGNAL(logDumpZone(Player *, CardZone *, Player *, int)), this, SLOT(logDumpZone(Player *, CardZone *, Player *, int))); + connect(game, SIGNAL(logStopDumpZone(Player *, CardZone *, Player *)), this, SLOT(logStopDumpZone(Player *, CardZone *, Player *))); connect(game, SIGNAL(logSetActivePlayer(Player *)), this, SLOT(logSetActivePlayer(Player *))); connect(game, SIGNAL(setActivePhase(int)), this, SLOT(logSetActivePhase(int))); } diff --git a/cockatrice/src/messagelogwidget.h b/cockatrice/src/messagelogwidget.h index 027cb1b4..56c5a81e 100644 --- a/cockatrice/src/messagelogwidget.h +++ b/cockatrice/src/messagelogwidget.h @@ -12,7 +12,9 @@ class CardZone; class MessageLogWidget : public QTextEdit { Q_OBJECT private: - QString sanitizeHtml(QString dirty); + enum GrammaticalCase { /*CaseNominative, */CaseGenitive, CaseAccusative }; + QString sanitizeHtml(QString dirty) const; + QString trZoneName(CardZone *zone, Player *player, bool hisOwn, GrammaticalCase gc) const; public slots: void logConnecting(QString hostname); void logConnected(const QStringList WelcomeMsg); @@ -27,7 +29,7 @@ private slots: void logGameStart(); void logSay(Player *player, QString message); void logShuffle(Player *player); - void logRollDice(Player *player, int sides, int roll); + void logRollDie(Player *player, int sides, int roll); void logDraw(Player *player, int number); void logMoveCard(Player *player, QString cardName, CardZone *startZone, int oldX, CardZone *targetZone, int newX); void logCreateToken(Player *player, QString cardName); @@ -35,8 +37,8 @@ private slots: void logSetTapped(Player *player, QString cardName, bool tapped); void logSetCounter(Player *player, QString counterName, int value, int oldValue); void logSetDoesntUntap(Player *player, QString cardName, bool doesntUntap); - void logDumpZone(Player *player, QString zoneName, QString zoneOwner, int numberCards); - void logStopDumpZone(Player *player, QString zoneName, QString zoneOwner); + void logDumpZone(Player *player, CardZone *zone, Player *zoneOwner, int numberCards); + void logStopDumpZone(Player *player, CardZone *zone, Player *zoneOwner); void logSetActivePlayer(Player *player); void logSetActivePhase(int phase); public: diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 36b039d0..942d1d28 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -17,50 +17,44 @@ Player::Player(const QString &_name, int _id, QPointF _base, bool _local, CardDa _scene->addItem(area); if (local) { - aMoveHandToTopLibrary = new QAction(tr("Move to &top of library"), this); + aMoveHandToTopLibrary = new QAction(this); connect(aMoveHandToTopLibrary, SIGNAL(triggered()), this, SLOT(actMoveHandToTopLibrary())); - aMoveHandToBottomLibrary = new QAction(tr("Move to &bottom of library"), this); + aMoveHandToBottomLibrary = new QAction(this); connect(aMoveHandToBottomLibrary, SIGNAL(triggered()), this, SLOT(actMoveHandToBottomLibrary())); - aViewLibrary = new QAction(tr("&View library"), this); - aViewLibrary->setShortcut(tr("F3")); + aViewLibrary = new QAction(this); connect(aViewLibrary, SIGNAL(triggered()), this, SLOT(actViewLibrary())); - aViewTopCards = new QAction(tr("View &top cards of library..."), this); + aViewTopCards = new QAction(this); connect(aViewTopCards, SIGNAL(triggered()), this, SLOT(actViewTopCards())); } - aViewGraveyard = new QAction(tr("&View graveyard"), this); - if (local) - aViewGraveyard->setShortcut(tr("F4")); + aViewGraveyard = new QAction(this); connect(aViewGraveyard, SIGNAL(triggered()), this, SLOT(actViewGraveyard())); - aViewRfg = new QAction(tr("&View removed cards"), this); + aViewRfg = new QAction(this); connect(aViewRfg, SIGNAL(triggered()), this, SLOT(actViewRfg())); if (local) { - aViewSideboard = new QAction(tr("&View sideboard"), this); + aViewSideboard = new QAction(this); connect(aViewSideboard, SIGNAL(triggered()), this, SLOT(actViewSideboard())); - aDrawCard = new QAction(tr("&Draw card"), this); + aDrawCard = new QAction(this); connect(aDrawCard, SIGNAL(triggered()), this, SLOT(actDrawCard())); - aDrawCard->setShortcut(tr("Ctrl+D")); - aDrawCards = new QAction(tr("D&raw cards..."), this); + aDrawCards = new QAction(this); connect(aDrawCards, SIGNAL(triggered()), this, SLOT(actDrawCards())); - aDrawCards->setShortcut(tr("Ctrl+E")); - aShuffle = new QAction(tr("&Shuffle"), this); + aShuffle = new QAction(this); connect(aShuffle, SIGNAL(triggered()), this, SLOT(actShuffle())); - aShuffle->setShortcut(tr("Ctrl+S")); } - playerMenu = new QMenu(tr("Player \"%1\"").arg(name)); + playerMenu = new QMenu(QString()); if (local) { - QMenu *handMenu = playerMenu->addMenu(tr("&Hand")); + handMenu = playerMenu->addMenu(QString()); handMenu->addAction(aMoveHandToTopLibrary); handMenu->addAction(aMoveHandToBottomLibrary); zones.findZone("hand")->setMenu(handMenu); - QMenu *libraryMenu = playerMenu->addMenu(tr("&Library")); + libraryMenu = playerMenu->addMenu(QString()); libraryMenu->addAction(aDrawCard); libraryMenu->addAction(aDrawCards); libraryMenu->addSeparator(); @@ -69,21 +63,27 @@ Player::Player(const QString &_name, int _id, QPointF _base, bool _local, CardDa libraryMenu->addAction(aViewLibrary); libraryMenu->addAction(aViewTopCards); zones.findZone("deck")->setMenu(libraryMenu, aDrawCard); + } else { + handMenu = 0; + libraryMenu = 0; } - QMenu *graveMenu = playerMenu->addMenu(tr("&Graveyard")); + graveMenu = playerMenu->addMenu(QString()); graveMenu->addAction(aViewGraveyard); zones.findZone("grave")->setMenu(graveMenu, aViewGraveyard); - QMenu *rfgMenu = playerMenu->addMenu(tr("&Removed cards")); + rfgMenu = playerMenu->addMenu(QString()); rfgMenu->addAction(aViewRfg); zones.findZone("rfg")->setMenu(rfgMenu, aViewRfg); if (local) { - QMenu *sbMenu = playerMenu->addMenu(tr("&Sideboard")); + sbMenu = playerMenu->addMenu(QString()); sbMenu->addAction(aViewSideboard); zones.findZone("sb")->setMenu(sbMenu, aViewSideboard); - } + } else + sbMenu = 0; + + retranslateUi(); } Player::~Player() @@ -96,6 +96,35 @@ Player::~Player() delete area; } +void Player::retranslateUi() +{ + aViewGraveyard->setText(tr("&View graveyard")); + aViewRfg->setText(tr("&View exile")); + playerMenu->setTitle(tr("Player \"%1\"").arg(name)); + graveMenu->setTitle(tr("&Graveyard")); + rfgMenu->setTitle(tr("&Exile")); + + if (local) { + aMoveHandToTopLibrary->setText(tr("Move to &top of library")); + aMoveHandToBottomLibrary->setText(tr("Move to &bottom of library")); + aViewLibrary->setText(tr("&View library")); + aViewLibrary->setShortcut(tr("F3")); + aViewTopCards->setText(tr("View &top cards of library...")); + aViewGraveyard->setShortcut(tr("F4")); + aViewSideboard->setText(tr("&View sideboard")); + aDrawCard->setText(tr("&Draw card")); + aDrawCard->setShortcut(tr("Ctrl+D")); + aDrawCards->setText(tr("D&raw cards...")); + aDrawCards->setShortcut(tr("Ctrl+E")); + aShuffle->setText(tr("&Shuffle")); + aShuffle->setShortcut(tr("Ctrl+S")); + + handMenu->setTitle(tr("&Hand")); + sbMenu->setTitle(tr("&Sideboard")); + libraryMenu->setTitle(tr("&Library")); + } +} + void Player::actMoveHandToTopLibrary() { zones.findZone("hand")->moveAllToZone("deck", 0); diff --git a/cockatrice/src/player.h b/cockatrice/src/player.h index 46a4fd99..9a37d1ac 100644 --- a/cockatrice/src/player.h +++ b/cockatrice/src/player.h @@ -43,7 +43,7 @@ private slots: void actViewRfg(); void actViewSideboard(); private: - QMenu *playerMenu; + QMenu *playerMenu, *handMenu, *graveMenu, *rfgMenu, *libraryMenu, *sbMenu; QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary, *aViewLibrary, *aViewTopCards, *aViewGraveyard, *aViewRfg, *aViewSideboard, *aDrawCard, *aDrawCards, *aShuffle; @@ -63,6 +63,7 @@ public: void addZone(CardZone *z); Player(const QString &_name, int _id, QPointF _base, bool _local, CardDatabase *_db, Client *_client, QGraphicsScene *_scene, Game *_parent); ~Player(); + void retranslateUi(); QMenu *getPlayerMenu() const { return playerMenu; } int getId() const { return id; } QString getName() const { return name; } diff --git a/cockatrice/src/servereventdata.cpp b/cockatrice/src/servereventdata.cpp index 324e90fe..dbdb32a3 100644 --- a/cockatrice/src/servereventdata.cpp +++ b/cockatrice/src/servereventdata.cpp @@ -17,7 +17,7 @@ ServerEventData::ServerEventData(const QString &line) eventHash.insert("setup_zones", eventSetupZones); eventHash.insert("game_start", eventGameStart); eventHash.insert("shuffle", eventShuffle); - eventHash.insert("roll_dice", eventRollDice); + eventHash.insert("roll_die", eventRollDie); eventHash.insert("draw", eventDraw); eventHash.insert("move_card", eventMoveCard); eventHash.insert("create_token", eventCreateToken); diff --git a/cockatrice/src/servereventdata.h b/cockatrice/src/servereventdata.h index 9f809fcf..f9fdbe7a 100644 --- a/cockatrice/src/servereventdata.h +++ b/cockatrice/src/servereventdata.h @@ -15,7 +15,7 @@ enum ServerEventType { eventSetupZones, eventGameStart, eventShuffle, - eventRollDice, + eventRollDie, eventDraw, eventMoveCard, eventCreateToken, diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index b9d76deb..fcff6589 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -219,6 +219,8 @@ void MainWindow::retranslateUi() cardInfo->retranslateUi(); chatWidget->retranslateUi(); gameSelector->retranslateUi(); + if (game) + game->retranslateUi(); } void MainWindow::createActions() diff --git a/cockatrice/translations/cockatrice_de.ts b/cockatrice/translations/cockatrice_de.ts index 834020f2..bed251b5 100644 --- a/cockatrice/translations/cockatrice_de.ts +++ b/cockatrice/translations/cockatrice_de.ts @@ -104,7 +104,7 @@ Teil&nehmen - + Channel Raum @@ -113,7 +113,7 @@ Beschreibung - + Players Spielerzahl @@ -312,42 +312,42 @@ Game - + &Untap all permanents &Enttappe alle bleibenden Karten - + Ctrl+U Ctrl+U - + &Decrement life Lebenspunkt &verringern - + F11 F11 - + &Increment life Lebens&punkt erhöhen - + F12 F12 - + &Set life &Setze Lebenspunkte - + Ctrl+L Ctrl+L @@ -376,72 +376,71 @@ Ctrl+E - R&oll dice... - &Würfeln... + &Würfeln... - + Ctrl+I Ctrl+I - + &Create token... &Token erstellen... - + Ctrl+T Ctrl+T - + Next &phase Nächste &Phase - + Ctrl+Space Ctrl+Space - + Next &turn Nächster &Zug - + Ctrl+Enter Ctrl+Enter - + Ctrl+Return Ctrl+Return - + &top of library &auf die Bibliothek - + &bottom of library &unter die Bibliothek - + &graveyard in den &Friedhof - + &exile ins &Exil - + &Move to &Verschieben @@ -450,42 +449,42 @@ Mitteilungen &bearbeiten... - + S&ay &Sagen - + &Tap &Tappen - + &Untap E&nttappen - + Toggle &normal untapping &Normales enttappen umschalten - + &Flip &Umdrehen - + &Add counter Zählm&arke hinzufügen - + &Remove counter Zählma&rke entfernen - + &Set counters... &Setze Zählmarken... @@ -494,52 +493,51 @@ Neu a&rrangieren - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + Set life Setze Leben - + New life total: Neues Leben insgesammt: - Roll dice - Würfeln + Würfeln - + Number of sides: Anzahl der Seiten: @@ -548,22 +546,32 @@ Karten ziehen - + Number: Anzahl: - + Create token Token erstellen - + + R&oll die... + &Würfeln... + + + + Roll die + Würfeln + + + Name: Name: - + Set counters Setze Zählmarke @@ -792,227 +800,472 @@ MessageLogWidget - + Connecting to %1... Verbinde zu %1... - + Connected. Verbunden. - + Disconnected from server. Verbindung zum Server getrennt. - + Invalid password. Ungültiges Passwort. - + You have joined the game. Player list: Du bist dem Spiel beigetreten. Spielerliste: - + %1 has joined the game %1 ist dem Spiel beigetreten - + %1 has left the game %1 hat das Spiel verlassen - + %1 is ready to start a new game. %1 ist bereit ein neues Spiel zu starten. - Game has started. - Spiel hat begonnen. + Spiel hat begonnen. - %1 shuffles his/her library - %1 mischt seine/ihre Bibliothek + %1 mischt seine/ihre Bibliothek - %1 rolled a %2 with a %3-sided dice - %1 würfelte eine %2 mit einem %3-seitigen Würfel + %1 würfelte eine %2 mit einem %3-seitigen Würfel - %1 draws a card - %1 zieht eine Karte + %1 zieht eine Karte - %1 draws %2 cards - %1 zieht %2 Karten + %1 zieht %2 Karten - + a card eine Karte - from table - vom Spielfeld + vom Spielfeld - - from graveyard - aus dem Friedhof + + of his hand + seiner Hand + + + + of %1's hand + von %1s Hand + + + + his hand + seine Hand + + + + %1's hand + %1s Hand + + + + of his library + seiner Bibliothek + + + + of %1's library + von %1s Bibliothek + + + + his library + seine Bibliothek + + + + %1's library + %1s Bibliothek + + + + of his sideboard + seines Sideboards + + + + of %1's sideboard + von %1s Sideboard + + + + his sideboard + sein Sideboard + + + + %1's sideboard + %1s Sideboard + + + + The game has started. + Das Spiel hat begonnen. + + + + %1 shuffles his library. + %1 mischt seine Bibliothek. + + + %1 rolls a %2 with a %3-sided dice. + %1 würfelt eine %2 mit einem %3-seitigen Würfel. - from exile - aus dem Exil + %1 rolls a %2 with a %3-sided die. + %1 würfelt eine %2 mit einem %3-seitigen Würfel. - - from hand - von der Hand + + %1 draws a card. + %1 zieht eine Karte. - - from the bottom of his library - von der Unterseite seiner Bibliothek - - - - from the top of his library - oben von seiner Bibliothek - - - - from library - von der Bibliothek - - - - from sideboard - aus seinem Sideboard - - - - %1 puts %2 into play %3 - %1 bringt %2 %3 ins Spiel - - - - %1 puts %2 %3 into graveyard - %1 legt %2 %3 auf den Friedhof - - - - %1 exiles %2 %3 - %1 schickt %2 %3 ins Exil + + %1 draws %2 cards. + %1 zieht %2 Karten. + from table + vom Spielfeld + + + + from graveyard + aus dem Friedhof + + + + from exile + aus dem Exil + + + + from hand + von der Hand + + + + the bottom card of his library + die unterste Karte seiner Bibliothek + + + + from the bottom of his library + , die unterste Karte seiner Bibliothek, + + + + the top card of his library + die oberste Karte seiner Bibliothek + + + + from the top of his library + , die oberste Karte seiner Bibliothek, + + + + from library + aus der Bibliothek + + + + from sideboard + aus dem Sideboard + + + + %1 puts %2 into play%3. + %1 bringt %2%3 ins Spiel. + + + + %1 puts %2%3 into graveyard. + %1 legt %2%3 auf den Friedhof. + + + + %1 exiles %2%3. + %1 schickt %2%3 ins Exil. + + + + %1 moves %2%3 to hand. + %1 nimmt %2%3 auf die Hand. + + + + %1 puts %2%3 into his library. + %1 legt %2%3 in seine Bibliothek. + + + + %1 puts %2%3 on bottom of his library. + %1 legt %2%3 unter seine Bibliothek. + + + + %1 puts %2%3 on top of his library. + %1 legt %2%3 auf die Bibliothek. + + + + %1 puts %2%3 into his library at position %4. + %1 legt %2%3 in seine Bibliothek an %4. Stelle. + + + + %1 moves %2%3 to sideboard. + %1 legt %2%3 in sein Sideboard. + + + + %1 is looking at the top %2 cards %3. + %1 sieht sich die obersten %2 Karten %3 an. + + + from graveyard + aus dem Friedhof + + + from exile + aus dem Exil + + + from hand + von der Hand + + + from the bottom of his library + von der Unterseite seiner Bibliothek + + + from the top of his library + , die oberste Karte seiner Bibliothek, + + + from library + von der Bibliothek + + + from sideboard + aus seinem Sideboard + + + %1 puts %2 into play %3. + %1 bringt %2%3ins Spiel. + + + %1 puts %2 %3 into graveyard. + %1 legt %2%3auf den Friedhof. + + + %1 exiles %2 %3. + %1 schickt %2%3ins Exil. + + + %1 moves %2 %3 to hand. + %1 nimmt %2%3auf die Hand. + + + %1 puts %2 into play %3 + %1 bringt %2%3ins Spiel + + + %1 puts %2 %3 into graveyard + %1 legt %2 %3 auf den Friedhof + + + %1 exiles %2 %3 + %1 schickt %2 %3 ins Exil + + %1 moves %2 %3 to hand - %1 nimmt %2 %3 auf die Hand + %1 nimmt %2 %3 auf die Hand - - %1 puts %2 %3 into his library - %1 legt %2 %3 in seine Bibliothek + %1 puts %2 %3 into his library. + %1 legt %2%3in seine Bibliothek. - - %1 puts %2 %3 on bottom of his library - %1 legt %2 %3 unter seine Bibliothek + %1 puts %2 %3 on bottom of his library. + %1 legt %2%3unter seine Bibliothek. - - %1 puts %2 %3 on top of his library - %1 legt %2 %3 auf die Bibliothek + %1 puts %2 %3 on top of his library. + %1 legt %2%3auf die Bibliothek. - - %1 puts %2 %3 into his library at position %4 - %1 legt %2 %3 in seine Bibliothek an Stelle %4 + %1 puts %2 %3 into his library at position %4. + %1 legt %2%3in seine Bibliothek an Stelle %4. - - %1 moves %2 %3 to sideboard - %1 legt %2 %3 in sein Sideboard + %1 moves %2 %3 to sideboard. + %1 legt %2%3in sein Sideboard. + + + + %1 creates token: %2. + %1 erstellt Token: %2. - %1 stops looking at %2's %3 - %1 sieht sich %2s %3 nicht mehr an + %1 places %2 counters on %3 (now %4). + %1 legt %2 Zählmarken auf %3 (jetzt %4). - + + %1 removes %2 counters from %3 (now %4). + %1 entfernt %2 Zählmarken von %3 (jetzt %4). + + + + %1 %2 %3. + %1 %2 %3. + + + + %1 sets counter "%2" to %3 (%4%5). + %1 setzt Zählmarke "%2" auf %3% (%4%5). + + + %1 is looking at the top %2 cards of %3. + %1 sieht sich die obersten %2 Karten %3 an. + + + + %1 is looking at %2. + %1 sieht sich %2 an. + + + + %1 stops looking at %2. + %1 sieht sich %2 nicht mehr an. + + + + ending phase + die Zugendphase + + + %1 puts %2 %3 into his library + %1 legt %2 %3 in seine Bibliothek + + + %1 puts %2 %3 on bottom of his library + %1 legt %2 %3 unter seine Bibliothek + + + %1 puts %2 %3 on top of his library + %1 legt %2 %3 auf die Bibliothek + + + %1 puts %2 %3 into his library at position %4 + %1 legt %2 %3 in seine Bibliothek an Stelle %4 + + + %1 moves %2 %3 to sideboard + %1 legt %2 %3 in sein Sideboard + + + %1 stops looking at %2's %3 + %1 sieht sich %2s %3 nicht mehr an + + + It is now %1's turn. %1 ist am Zug. - + untap step das Enttappsegment - + upkeep step das Versorgungssegment - + draw step das Ziehsegment - + first main phase die erste Hauptphase - + beginning of combat step das Anfangssegment der Kampfphase - + declare attackers step das Angreifer-Deklarieren-Segment - + declare blockers step das Blocker-Deklarieren-Segment - + combat damage step das Kampfschadenssegment - + end of combat step das Endsegment der Kampfphase - + second main phase die zweite Hauptphase - end of turn step - das Ende-des-Zuges-Segment + das Ende-des-Zuges-Segment - + It is now the %1. Es ist nun %1. @@ -1021,12 +1274,12 @@ %1 bewegt %2 %3 nach %4 - + taps tappt - + untaps enttappt @@ -1039,54 +1292,47 @@ %1 bewegt %2 von %3 nach %4 - %1 creates token: %2 - %1 erstellt Token: %2 + %1 erstellt Token: %2 - %1 places %2 counters on %3 (now %4) - %1 legt %2 Zählmarken auf %3 (jetzt %4) + %1 legt %2 Zählmarken auf %3 (jetzt %4) - %1 removes %2 counters from %3 (now %4) - %1 entfernt %2 Zählmarken von %3 (jetzt %4) + %1 entfernt %2 Zählmarken von %3 (jetzt %4) - + his permanents seine bleibenden Karten - %1 %2 %3 - %1 %2 %3 + %1 %2 %3 - %1 sets counter "%2" to %3 (%4%5) - %1 setzt Zähler "%2" auf %3 (%4%5) + %1 setzt Zähler "%2" auf %3 (%4%5) - + %1 sets %2 to not untap normally. %1 setzt %2 auf explizites Enttappen. - + %1 sets %2 to untap normally. %1 setzt %2 auf normales Enttappen. - %1 is looking at the top %2 cards of %3's %4 - %1 sieht sich die obersten %2 Karten von %3s %4 an + %1 sieht sich die obersten %2 Karten von %3s %4 an - %1 is looking at %2's %3 - %1 sieht sich %2s %3 an + %1 sieht sich %2s %3 an @@ -1181,127 +1427,135 @@ Player - + Move to &top of library Oben auf die Biblio&thek legen - + Move to &bottom of library Unter die &Bibliothek legen - + &View library &Zeige Bibliothek - + F3 F3 - + View &top cards of library... Zeige die oberen Kar&ten der Bibliothek... - + &View graveyard &Zeige Friedhof - + F4 F4 - &View removed cards - Zeige ent&fernte Karten + Zeige ent&fernte Karten - + &View sideboard Zeige &Sideboard - + Player "%1" Spieler "%1" - + &Hand &Hand - + &Library Bib&liothek - + &Graveyard &Friedhof - &Removed cards - Entfe&rnte Karten + Entfe&rnte Karten - + &Sideboard &Sideboard - + View top cards of library Zeige die obersten Karten der Bibliothek - + Number of cards: Anzahl der Karten: - + &Draw card Karte &ziehen - + + &View exile + &Zeige Exil + + + + &Exile + &Exil + + + Ctrl+D Ctrl+D - + D&raw cards... Ka&rten ziehen... - + Ctrl+E Ctrl+E - + &Shuffle Mi&schen - + Ctrl+S Ctrl+S - + Draw cards Karten ziehen - + Number: Anzahl: diff --git a/cockatrice/translations/cockatrice_en.ts b/cockatrice/translations/cockatrice_en.ts index c021d286..4ee4cf9e 100644 --- a/cockatrice/translations/cockatrice_en.ts +++ b/cockatrice/translations/cockatrice_en.ts @@ -73,12 +73,12 @@ - + Channel - + Players @@ -250,222 +250,222 @@ Game - + &Untap all permanents - + Ctrl+U - + &Decrement life - + F11 - + &Increment life - + F12 - + &Set life - + Ctrl+L - - R&oll dice... - - - - + Ctrl+I - + &Create token... - + Ctrl+T - + Next &phase - + Ctrl+Space - + Next &turn - + Ctrl+Enter - + Ctrl+Return - + S&ay - + &Tap - + &Untap - + Toggle &normal untapping - + &Flip - + &Add counter - + &Remove counter - + &Set counters... - + &top of library - + &bottom of library - + &graveyard - + &exile - + &Move to - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + Set life - + New life total: - - Roll dice - - - - + Number of sides: - + Number: - + Create token - + + R&oll die... + + + + + Roll die + + + + Name: - + Set counters @@ -694,287 +694,357 @@ MessageLogWidget - + Connecting to %1... - + Connected. - + Disconnected from server. - + Invalid password. - + You have joined the game. Player list: - + %1 has joined the game - + %1 has left the game - + %1 is ready to start a new game. - - - Game has started. - - - - - %1 shuffles his/her library - - - - - %1 rolled a %2 with a %3-sided dice - - - - - %1 draws a card - - - - - %1 draws %2 cards - - - - - a card - - - - - from table - - - - - from graveyard - - - from exile - - - - - from hand - - - - - from the bottom of his library - - - - - from the top of his library - - - - - from library - - - - - from sideboard - - - - - %1 puts %2 into play %3 - - - - - %1 puts %2 %3 into graveyard - - - - - %1 exiles %2 %3 + %1 rolls a %2 with a %3-sided die. - %1 moves %2 %3 to hand + from table - - %1 puts %2 %3 into his library + + from graveyard - - %1 puts %2 %3 on bottom of his library + + from exile - - %1 puts %2 %3 on top of his library + + from hand - - %1 puts %2 %3 into his library at position %4 + + the bottom card of his library - - %1 moves %2 %3 to sideboard + + from the bottom of his library - - %1 stops looking at %2's %3 + + the top card of his library - - It is now %1's turn. + + from the top of his library - - untap step + + from library - - upkeep step - - - - - draw step - - - - - first main phase - - - - - beginning of combat step - - - - - declare attackers step - - - - - declare blockers step - - - - - combat damage step - - - - - end of combat step - - - - - second main phase - - - - - end of turn step - - - - - It is now the %1. - - - - - %1 creates token: %2 - - - - - %1 places %2 counters on %3 (now %4) + + from sideboard - %1 removes %2 counters from %3 (now %4) + %1 puts %2 into play%3. + + + + + %1 puts %2%3 into graveyard. + + + + + %1 exiles %2%3. + + + + + %1 moves %2%3 to hand. + + + + + %1 puts %2%3 into his library. - %1 %2 %3 + %1 puts %2%3 on bottom of his library. - - taps + + %1 puts %2%3 on top of his library. - - untaps + + %1 puts %2%3 into his library at position %4. - - %1 sets counter "%2" to %3 (%4%5) + + %1 moves %2%3 to sideboard. - %1 sets %2 to not untap normally. + a card - - %1 sets %2 to untap normally. + + %1 is looking at the top %2 cards %3. + + + + + of his hand + + + + + of %1's hand + + + + + his hand + + + + + %1's hand + + + + + of his library + + + + + of %1's library + + + + + his library + + + + + %1's library + + + + + of his sideboard + + + + + of %1's sideboard + + + + + his sideboard + + + + + %1's sideboard + + + + + The game has started. + + + + + %1 draws a card. + + + + + %1 draws %2 cards. - %1 is looking at the top %2 cards of %3's %4 + %1 creates token: %2. - - %1 is looking at %2's %3 + + %1 places %2 counters on %3 (now %4). - + + %1 removes %2 counters from %3 (now %4). + + + + + %1 %2 %3. + + + + + %1 sets counter "%2" to %3 (%4%5). + + + + + %1 is looking at %2. + + + + + %1 stops looking at %2. + + + + + ending phase + + + + + It is now %1's turn. + + + + + %1 shuffles his library. + + + + + untap step + + + + + upkeep step + + + + + draw step + + + + + first main phase + + + + + beginning of combat step + + + + + declare attackers step + + + + + declare blockers step + + + + + combat damage step + + + + + end of combat step + + + + + second main phase + + + + + It is now the %1. + + + + + taps + + + + + untaps + + + + + %1 sets %2 to not untap normally. + + + + + %1 sets %2 to untap normally. + + + + his permanents @@ -1063,127 +1133,127 @@ Player - + Move to &top of library - + Move to &bottom of library - + &View library - + F3 - + View &top cards of library... - + &View graveyard - + F4 - - &View removed cards - - - - + &View sideboard - + Player "%1" - + &Hand - + &Library - + &Graveyard - - &Removed cards - - - - + &Sideboard - + View top cards of library - + Number of cards: - + &Draw card - + + &View exile + + + + + &Exile + + + + Ctrl+D - + D&raw cards... - + Ctrl+E - + &Shuffle - + Ctrl+S - + Draw cards - + Number: diff --git a/servatrice/src/serversocket.cpp b/servatrice/src/serversocket.cpp index c4a07a4b..92d8105d 100644 --- a/servatrice/src/serversocket.cpp +++ b/servatrice/src/serversocket.cpp @@ -219,7 +219,7 @@ const ServerSocket::CommandProperties ServerSocket::commandList[ServerSocket::nu << QVariant::Int, &ServerSocket::cmdDumpZone}, {"stop_dump_zone", true, true, true, QList() << QVariant::Int << QVariant::String, &ServerSocket::cmdStopDumpZone}, - {"roll_dice", true, true, true, QList() << QVariant::Int, &ServerSocket::cmdRollDice}, + {"roll_die", true, true, true, QList() << QVariant::Int, &ServerSocket::cmdRollDie}, {"next_turn", true, true, true, QList(), &ServerSocket::cmdNextTurn}, {"set_active_phase", true, true, true, QList() << QVariant::Int, &ServerSocket::cmdSetActivePhase} }; @@ -662,10 +662,10 @@ ReturnMessage::ReturnCode ServerSocket::cmdStopDumpZone(const QList &p return ReturnMessage::ReturnOk; } -ReturnMessage::ReturnCode ServerSocket::cmdRollDice(const QList ¶ms) +ReturnMessage::ReturnCode ServerSocket::cmdRollDie(const QList ¶ms) { int sides = params[0].toInt(); - emit broadcastEvent(QString("roll_dice|%1|%2").arg(sides).arg(server->getRNG()->getNumber(1, sides)), this); + emit broadcastEvent(QString("roll_die|%1|%2").arg(sides).arg(server->getRNG()->getNumber(1, sides)), this); return ReturnMessage::ReturnOk; } diff --git a/servatrice/src/serversocket.h b/servatrice/src/serversocket.h index 08b1404b..40396d39 100644 --- a/servatrice/src/serversocket.h +++ b/servatrice/src/serversocket.h @@ -86,7 +86,7 @@ private: ReturnMessage::ReturnCode cmdListZones(const QList ¶ms); ReturnMessage::ReturnCode cmdDumpZone(const QList ¶ms); ReturnMessage::ReturnCode cmdStopDumpZone(const QList ¶ms); - ReturnMessage::ReturnCode cmdRollDice(const QList ¶ms); + ReturnMessage::ReturnCode cmdRollDie(const QList ¶ms); ReturnMessage::ReturnCode cmdNextTurn(const QList ¶ms); ReturnMessage::ReturnCode cmdSetActivePhase(const QList ¶ms);