protocol changes, menu cleanups, phase button speed improvement
This commit is contained in:
parent
ab3858239f
commit
890740bcc9
19 changed files with 514 additions and 442 deletions
|
@ -158,7 +158,7 @@ void Client::readLine()
|
|||
|
||||
// XXX Parametergültigkeit überprüfen
|
||||
if (prefix == "list_players")
|
||||
playerlist << new ServerPlayer(val[0].toInt(), val[1]);
|
||||
playerlist << new ServerPlayer(val[0].toInt(), val[1], val[2].toInt());
|
||||
else if (prefix == "list_counters")
|
||||
{ }
|
||||
else if (prefix == "list_zones")
|
||||
|
@ -185,10 +185,10 @@ void Client::readLine()
|
|||
|
||||
void Client::setStatus(const ProtocolStatus _status)
|
||||
{
|
||||
ProtocolStatus oldStatus = status;
|
||||
status = _status;
|
||||
if (oldStatus != _status)
|
||||
if (_status != status) {
|
||||
status = _status;
|
||||
emit statusChanged(_status);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::msg(const QString &s)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <stdlib.h>
|
||||
|
@ -13,51 +14,16 @@
|
|||
#include "counter.h"
|
||||
#include "gamescene.h"
|
||||
|
||||
Game::Game(CardDatabase *_db, Client *_client, GameScene *_scene, QMenu *_actionsMenu, QMenu *_cardMenu, int playerId, const QString &playerName, QObject *parent)
|
||||
: QObject(parent), actionsMenu(_actionsMenu), cardMenu(_cardMenu), db(_db), client(_client), scene(_scene), started(false), currentPhase(-1)
|
||||
Game::Game(CardDatabase *_db, Client *_client, GameScene *_scene, QMenuBar *menuBar, QObject *parent)
|
||||
: QObject(parent), db(_db), client(_client), scene(_scene), started(false), currentPhase(-1)
|
||||
{
|
||||
localPlayer = addPlayer(playerId, playerName, true);
|
||||
|
||||
connect(client, SIGNAL(gameEvent(const ServerEventData &)), this, SLOT(gameEvent(const ServerEventData &)));
|
||||
connect(client, SIGNAL(playerListReceived(QList<ServerPlayer *>)), this, SLOT(playerListReceived(QList<ServerPlayer *>)));
|
||||
|
||||
aUntapAll = new QAction(this);
|
||||
connect(aUntapAll, SIGNAL(triggered()), this, SLOT(actUntapAll()));
|
||||
|
||||
aDecLife = new QAction(this);
|
||||
connect(aDecLife, SIGNAL(triggered()), this, SLOT(actDecLife()));
|
||||
aIncLife = new QAction(this);
|
||||
connect(aIncLife, SIGNAL(triggered()), this, SLOT(actIncLife()));
|
||||
aSetLife = new QAction(this);
|
||||
connect(aSetLife, SIGNAL(triggered()), this, SLOT(actSetLife()));
|
||||
|
||||
aRollDie = new QAction(this);
|
||||
connect(aRollDie, SIGNAL(triggered()), this, SLOT(actRollDie()));
|
||||
|
||||
aCreateToken = new QAction(this);
|
||||
connect(aCreateToken, SIGNAL(triggered()), this, SLOT(actCreateToken()));
|
||||
|
||||
aNextPhase = new QAction(this);
|
||||
connect(aNextPhase, SIGNAL(triggered()), this, SLOT(actNextPhase()));
|
||||
aNextTurn = new QAction(this);
|
||||
connect(aNextTurn, SIGNAL(triggered()), this, SLOT(actNextTurn()));
|
||||
|
||||
actionsMenu->addAction(aNextPhase);
|
||||
actionsMenu->addAction(aNextTurn);
|
||||
actionsMenu->addSeparator();
|
||||
actionsMenu->addAction(aUntapAll);
|
||||
actionsMenu->addSeparator();
|
||||
actionsMenu->addAction(aDecLife);
|
||||
actionsMenu->addAction(aIncLife);
|
||||
actionsMenu->addAction(aSetLife);
|
||||
actionsMenu->addSeparator();
|
||||
actionsMenu->addAction(aRollDie);
|
||||
actionsMenu->addSeparator();
|
||||
actionsMenu->addAction(aCreateToken);
|
||||
actionsMenu->addSeparator();
|
||||
sayMenu = actionsMenu->addMenu(QString());
|
||||
initSayMenu();
|
||||
|
||||
aTap = new QAction(this);
|
||||
aUntap = new QAction(this);
|
||||
aDoesntUntap = new QAction(this);
|
||||
|
@ -71,6 +37,11 @@ Game::Game(CardDatabase *_db, Client *_client, GameScene *_scene, QMenu *_action
|
|||
aMoveToGraveyard = new QAction(this);
|
||||
aMoveToExile = new QAction(this);
|
||||
|
||||
gameMenu = menuBar->addMenu(QString());
|
||||
gameMenu->addAction(aNextPhase);
|
||||
gameMenu->addAction(aNextTurn);
|
||||
|
||||
cardMenu = menuBar->addMenu(QString());
|
||||
cardMenu->addAction(aTap);
|
||||
cardMenu->addAction(aUntap);
|
||||
cardMenu->addAction(aDoesntUntap);
|
||||
|
@ -110,6 +81,8 @@ Game::Game(CardDatabase *_db, Client *_client, GameScene *_scene, QMenu *_action
|
|||
connect(dlgStartGame, SIGNAL(finished(int)), this, SLOT(readyStart()));
|
||||
|
||||
retranslateUi();
|
||||
|
||||
client->listPlayers();
|
||||
}
|
||||
|
||||
Game::~Game()
|
||||
|
@ -119,29 +92,19 @@ Game::~Game()
|
|||
emit playerRemoved(players.at(i));
|
||||
delete players.at(i);
|
||||
}
|
||||
delete gameMenu;
|
||||
delete cardMenu;
|
||||
}
|
||||
|
||||
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"));
|
||||
gameMenu->setTitle(tr("&Game"));
|
||||
aNextPhase->setText(tr("Next &phase"));
|
||||
aNextPhase->setShortcut(tr("Ctrl+Space"));
|
||||
aNextTurn->setText(tr("Next &turn"));
|
||||
aNextTurn->setShortcuts(QList<QKeySequence>() << QKeySequence(tr("Ctrl+Return")) << QKeySequence(tr("Ctrl+Enter")));
|
||||
|
||||
sayMenu->setTitle(tr("S&ay"));
|
||||
|
||||
cardMenu->setTitle(tr("C&ard"));
|
||||
aTap->setText(tr("&Tap"));
|
||||
aUntap->setText(tr("&Untap"));
|
||||
aDoesntUntap->setText(tr("Toggle &normal untapping"));
|
||||
|
@ -161,30 +124,6 @@ void Game::retranslateUi()
|
|||
players[i]->retranslateUi();
|
||||
}
|
||||
|
||||
void Game::initSayMenu()
|
||||
{
|
||||
sayMenu->clear();
|
||||
|
||||
QSettings settings;
|
||||
settings.beginGroup("messages");
|
||||
int count = settings.value("count", 0).toInt();
|
||||
for (int i = 0; i < count; i++) {
|
||||
QAction *newAction = new QAction(settings.value(QString("msg%1").arg(i)).toString(), this);
|
||||
QString shortcut;
|
||||
switch (i) {
|
||||
case 0: shortcut = tr("F5"); break;
|
||||
case 1: shortcut = tr("F6"); break;
|
||||
case 2: shortcut = tr("F7"); break;
|
||||
case 3: shortcut = tr("F8"); break;
|
||||
case 4: shortcut = tr("F9"); break;
|
||||
case 5: shortcut = tr("F10"); break;
|
||||
}
|
||||
newAction->setShortcut(shortcut);
|
||||
connect(newAction, SIGNAL(triggered()), this, SLOT(actSayMessage()));
|
||||
sayMenu->addAction(newAction);
|
||||
}
|
||||
}
|
||||
|
||||
Player *Game::addPlayer(int playerId, const QString &playerName, bool local)
|
||||
{
|
||||
Player *newPlayer = new Player(playerName, playerId, local, db, client, this);
|
||||
|
@ -213,8 +152,7 @@ void Game::playerListReceived(QList<ServerPlayer *> playerList)
|
|||
nameList << temp->getName();
|
||||
int id = temp->getPlayerId();
|
||||
|
||||
if (id != localPlayer->getId())
|
||||
addPlayer(id, temp->getName(), false);
|
||||
addPlayer(id, temp->getName(), temp->getLocal());
|
||||
|
||||
delete temp;
|
||||
}
|
||||
|
@ -235,10 +173,12 @@ void Game::restartGameDialog()
|
|||
void Game::gameEvent(const ServerEventData &msg)
|
||||
{
|
||||
qDebug(QString("game::gameEvent: public=%1, player=%2, name=%3, type=%4, data=%5").arg(msg.getPublic()).arg(msg.getPlayerId()).arg(msg.getPlayerName()).arg(msg.getEventType()).arg(msg.getEventData().join("/")).toLatin1());
|
||||
if (!msg.getPublic())
|
||||
localPlayer->gameEvent(msg);
|
||||
else {
|
||||
Player *p = players.findPlayer(msg.getPlayerId());
|
||||
Player *p = players.findPlayer(msg.getPlayerId());
|
||||
if (!msg.getPublic()) {
|
||||
if (!p)
|
||||
return;
|
||||
p->gameEvent(msg);
|
||||
} else {
|
||||
if ((!p) && (msg.getEventType() != eventJoin)) {
|
||||
// XXX
|
||||
}
|
||||
|
@ -248,14 +188,32 @@ void Game::gameEvent(const ServerEventData &msg)
|
|||
emit logSay(p, msg.getEventData()[0]);
|
||||
break;
|
||||
case eventJoin: {
|
||||
Player *newPlayer = addPlayer(msg.getPlayerId(), msg.getPlayerName(), false);
|
||||
emit logJoin(newPlayer);
|
||||
const QStringList &data = msg.getEventData();
|
||||
if (data.size() != 1)
|
||||
return;
|
||||
bool spectator = data[0].toInt();
|
||||
if (spectator) {
|
||||
spectatorList << msg.getPlayerName();
|
||||
emit logJoinSpectator(msg.getPlayerName());
|
||||
} else {
|
||||
Player *newPlayer = addPlayer(msg.getPlayerId(), msg.getPlayerName(), false);
|
||||
emit logJoin(newPlayer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case eventLeave:
|
||||
emit logLeave(p);
|
||||
// XXX Spieler natürlich noch rauswerfen
|
||||
case eventLeave: {
|
||||
if (p)
|
||||
emit logLeave(p);
|
||||
// XXX Spieler natürlich noch rauswerfen
|
||||
else {
|
||||
int spectatorIndex = spectatorList.indexOf(msg.getPlayerName());
|
||||
if (spectatorIndex != -1) {
|
||||
spectatorList.removeAt(spectatorIndex);
|
||||
emit logLeaveSpectator(msg.getPlayerName());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case eventReadyStart:
|
||||
if (started) {
|
||||
started = false;
|
||||
|
@ -335,16 +293,14 @@ void Game::gameEvent(const ServerEventData &msg)
|
|||
break;
|
||||
}
|
||||
case eventMoveCard: {
|
||||
if (msg.getPlayerId() == localPlayer->getId())
|
||||
break;
|
||||
p->gameEvent(msg);
|
||||
if (!p->getLocal())
|
||||
p->gameEvent(msg);
|
||||
break;
|
||||
}
|
||||
case eventDraw: {
|
||||
emit logDraw(p, msg.getEventData()[0].toInt());
|
||||
if (msg.getPlayerId() == localPlayer->getId())
|
||||
break;
|
||||
p->gameEvent(msg);
|
||||
if (!p->getLocal())
|
||||
p->gameEvent(msg);
|
||||
break;
|
||||
}
|
||||
case eventInvalid: {
|
||||
|
@ -369,44 +325,6 @@ void Game::actNextTurn()
|
|||
client->nextTurn();
|
||||
}
|
||||
|
||||
void Game::actUntapAll()
|
||||
{
|
||||
client->setCardAttr("table", -1, "tapped", "false");
|
||||
}
|
||||
|
||||
void Game::actIncLife()
|
||||
{
|
||||
client->incCounter("life", 1);
|
||||
}
|
||||
|
||||
void Game::actDecLife()
|
||||
{
|
||||
client->incCounter("life", -1);
|
||||
}
|
||||
|
||||
void Game::actSetLife()
|
||||
{
|
||||
bool ok;
|
||||
int life = QInputDialog::getInteger(0, tr("Set life"), tr("New life total:"), localPlayer->getCounter("life")->getValue(), 0, 2000000000, 1, &ok);
|
||||
if (ok)
|
||||
client->setCounter("life", life);
|
||||
}
|
||||
|
||||
void Game::actRollDie()
|
||||
{
|
||||
bool ok;
|
||||
int sides = QInputDialog::getInteger(0, tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok);
|
||||
if (ok)
|
||||
client->rollDie(sides);
|
||||
}
|
||||
|
||||
void Game::actCreateToken()
|
||||
{
|
||||
QString cardname = QInputDialog::getText(0, tr("Create token"), tr("Name:"));
|
||||
if (!cardname.isEmpty())
|
||||
client->createToken("table", cardname, QString(), 0, 0);
|
||||
}
|
||||
|
||||
void Game::showCardMenu(QPoint p)
|
||||
{
|
||||
cardMenu->exec(p);
|
||||
|
@ -501,12 +419,6 @@ void Game::actMoveToExile(CardItem *card)
|
|||
client->moveCard(card->getId(), startZone->getName(), "rfg", 0, 0, false);
|
||||
}
|
||||
|
||||
void Game::actSayMessage()
|
||||
{
|
||||
QAction *a = qobject_cast<QAction *>(sender());
|
||||
client->say(a->text());
|
||||
}
|
||||
|
||||
void Game::hoverCardEvent(CardItem *card)
|
||||
{
|
||||
emit hoverCard(card->getName());
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define GAME_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QStringList>
|
||||
#include "playerlist.h"
|
||||
|
||||
class ServerPlayer;
|
||||
|
@ -12,6 +13,7 @@ class ServerEventData;
|
|||
class CardDatabase;
|
||||
class DlgStartGame;
|
||||
class CardItem;
|
||||
class QMenuBar;
|
||||
|
||||
class Game : public QObject {
|
||||
Q_OBJECT
|
||||
|
@ -21,30 +23,22 @@ private:
|
|||
typedef void (Game::*CardMenuHandler)(CardItem *card);
|
||||
QHash<QAction *, CardMenuHandler> cardMenuHandlers;
|
||||
|
||||
QMenu *actionsMenu, *sayMenu, *cardMenu, *moveMenu;
|
||||
QMenu *gameMenu, *cardMenu, *moveMenu;
|
||||
QAction *aTap, *aUntap, *aDoesntUntap, *aFlip, *aAddCounter, *aRemoveCounter, *aSetCounters,
|
||||
*aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToGraveyard, *aMoveToExile,
|
||||
*aNextPhase, *aNextTurn, *aUntapAll, *aDecLife, *aIncLife, *aSetLife, *aRollDie, *aCreateToken;
|
||||
*aNextPhase, *aNextTurn;
|
||||
DlgStartGame *dlgStartGame;
|
||||
|
||||
CardDatabase *db;
|
||||
Client *client;
|
||||
GameScene *scene;
|
||||
QStringList spectatorList;
|
||||
PlayerList players;
|
||||
Player *localPlayer;
|
||||
bool started;
|
||||
int currentPhase;
|
||||
Player *addPlayer(int playerId, const QString &playerName, bool local);
|
||||
void initSayMenu();
|
||||
public slots:
|
||||
void actNextPhase();
|
||||
void actNextTurn();
|
||||
void actUntapAll();
|
||||
void actIncLife();
|
||||
void actDecLife();
|
||||
void actSetLife();
|
||||
void actRollDie();
|
||||
void actCreateToken();
|
||||
private slots:
|
||||
void cardMenuAction();
|
||||
|
||||
|
@ -60,8 +54,6 @@ private slots:
|
|||
void actMoveToBottomLibrary(CardItem *card);
|
||||
void actMoveToGraveyard(CardItem *card);
|
||||
void actMoveToExile(CardItem *card);
|
||||
|
||||
void actSayMessage();
|
||||
|
||||
void gameEvent(const ServerEventData &msg);
|
||||
void playerListReceived(QList<ServerPlayer *> playerList);
|
||||
|
@ -76,6 +68,8 @@ signals:
|
|||
void logPlayerListReceived(QStringList players);
|
||||
void logJoin(Player *player);
|
||||
void logLeave(Player *player);
|
||||
void logJoinSpectator(QString playerName);
|
||||
void logLeaveSpectator(QString playerName);
|
||||
void logReadyStart(Player *player);
|
||||
void logGameStart();
|
||||
void logSay(Player *player, QString text);
|
||||
|
@ -93,12 +87,12 @@ signals:
|
|||
void logSetActivePlayer(Player *player);
|
||||
void setActivePhase(int phase);
|
||||
public:
|
||||
Game(CardDatabase *_db, Client *_client, GameScene *_scene, QMenu *_actionsMenu, QMenu *_cardMenu, int playerId, const QString &playerName, QObject *parent = 0);
|
||||
Game(CardDatabase *_db, Client *_client, GameScene *_scene, QMenuBar *menuBar, QObject *parent = 0);
|
||||
~Game();
|
||||
Player *getLocalPlayer() const { return localPlayer; }
|
||||
void retranslateUi();
|
||||
void restartGameDialog();
|
||||
void hoverCardEvent(CardItem *card);
|
||||
Player *addPlayer(int playerId, const QString &playerName, bool local);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,11 +15,11 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
|
|||
|
||||
ServerGame *g = gameList.at(index.row());
|
||||
switch (index.column()) {
|
||||
case 0: return g->getGameId();
|
||||
case 0: return g->getDescription();
|
||||
case 1: return g->getCreator();
|
||||
case 2: return g->getDescription();
|
||||
case 3: return QString(g->getHasPassword() ? tr("yes") : tr("no"));
|
||||
case 4: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers());
|
||||
case 2: return g->getHasPassword() ? tr("yes") : tr("no");
|
||||
case 3: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers());
|
||||
case 4: return g->getSpectatorsAllowed() ? QVariant(g->getSpectatorsCount()) : QVariant(tr("not allowed"));
|
||||
default: return QVariant();
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@ QVariant GamesModel::headerData(int section, Qt::Orientation orientation, int ro
|
|||
if ((role != Qt::DisplayRole) || (orientation != Qt::Horizontal))
|
||||
return QVariant();
|
||||
switch (section) {
|
||||
case 0: return tr("Game ID");
|
||||
case 0: return tr("Description");
|
||||
case 1: return tr("Creator");
|
||||
case 2: return tr("Description");
|
||||
case 3: return tr("Password");
|
||||
case 4: return tr("Players");
|
||||
case 2: return tr("Password");
|
||||
case 3: return tr("Players");
|
||||
case 4: return tr("Spectators");
|
||||
default: return QVariant();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,16 @@ void MessageLogWidget::logLeave(Player *player)
|
|||
append(tr("%1 has left the game").arg(sanitizeHtml(player->getName())));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logJoinSpectator(QString name)
|
||||
{
|
||||
append(tr("%1 is now watching the game.").arg(sanitizeHtml(name)));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logLeaveSpectator(QString name)
|
||||
{
|
||||
append(tr("%1 is not watching the game any more.").arg(sanitizeHtml(name)));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logReadyStart(Player *player)
|
||||
{
|
||||
append(tr("%1 is ready to start a new game.").arg(sanitizeHtml(player->getName())));
|
||||
|
@ -249,6 +259,8 @@ void MessageLogWidget::connectToGame(Game *game)
|
|||
connect(game, SIGNAL(logPlayerListReceived(QStringList)), this, SLOT(logPlayerListReceived(QStringList)));
|
||||
connect(game, SIGNAL(logJoin(Player *)), this, SLOT(logJoin(Player *)));
|
||||
connect(game, SIGNAL(logLeave(Player *)), this, SLOT(logLeave(Player *)));
|
||||
connect(game, SIGNAL(logJoinSpectator(QString)), this, SLOT(logJoinSpectator(QString)));
|
||||
connect(game, SIGNAL(logLeaveSpectator(QString)), this, SLOT(logLeaveSpectator(QString)));
|
||||
connect(game, SIGNAL(logReadyStart(Player *)), this, SLOT(logReadyStart(Player *)));
|
||||
connect(game, SIGNAL(logGameStart()), this, SLOT(logGameStart()));
|
||||
connect(game, SIGNAL(logSay(Player *, QString)), this, SLOT(logSay(Player *, QString)));
|
||||
|
|
|
@ -26,6 +26,8 @@ private slots:
|
|||
void logPlayerListReceived(QStringList players);
|
||||
void logJoin(Player *player);
|
||||
void logLeave(Player *player);
|
||||
void logJoinSpectator(QString name);
|
||||
void logLeaveSpectator(QString name);
|
||||
void logReadyStart(Player *player);
|
||||
void logGameStart();
|
||||
void logSay(Player *player, QString message);
|
||||
|
|
|
@ -5,30 +5,37 @@
|
|||
#include <QPen>
|
||||
|
||||
PhaseButton::PhaseButton(const QIcon &icon, QAction *_doubleClickAction)
|
||||
: QPushButton(icon, QString()), active(false), doubleClickAction(_doubleClickAction)
|
||||
: QPushButton(icon, QString()), active(false), doubleClickAction(_doubleClickAction), activePixmap(50, 50), inactivePixmap(50, 50)
|
||||
{
|
||||
setFixedSize(50, 50);
|
||||
|
||||
updatePixmap(activePixmap, true);
|
||||
updatePixmap(inactivePixmap, false);
|
||||
}
|
||||
|
||||
void PhaseButton::paintEvent(QPaintEvent *event)
|
||||
void PhaseButton::updatePixmap(QPixmap &pixmap, bool active)
|
||||
{
|
||||
QPushButton::paintEvent(event);
|
||||
if (active) {
|
||||
QPainter painter(this);
|
||||
int height = size().height();
|
||||
int width = size().width();
|
||||
pixmap.fill(Qt::transparent);
|
||||
|
||||
QPainter painter(&pixmap);
|
||||
int height = pixmap.height();
|
||||
int width = pixmap.width();
|
||||
|
||||
painter.setPen(QPen(Qt::transparent));
|
||||
if (active)
|
||||
painter.setBrush(Qt::red);
|
||||
painter.setPen(Qt::gray);
|
||||
painter.drawRect(1, 1, width - 2, height - 2);
|
||||
|
||||
QRadialGradient grad(QPointF(0.5, 0.5), 0.5);
|
||||
grad.setCoordinateMode(QGradient::ObjectBoundingMode);
|
||||
grad.setColorAt(0, QColor(180, 0, 0, 0));
|
||||
grad.setColorAt(0.8, QColor(180, 0, 0, 0));
|
||||
grad.setColorAt(1, QColor(180, 0, 0, 255));
|
||||
painter.setBrush(QBrush(grad));
|
||||
icon().paint(&painter, 5, 5, width - 10, height - 10);
|
||||
}
|
||||
|
||||
painter.drawRect(2, 2, width - 4, height - 4);
|
||||
}
|
||||
void PhaseButton::paintEvent(QPaintEvent */*event*/)
|
||||
{
|
||||
QPainter painter(this);
|
||||
if (active)
|
||||
painter.drawPixmap(0, 0, size().width(), size().height(), activePixmap);
|
||||
else
|
||||
painter.drawPixmap(0, 0, size().width(), size().height(), inactivePixmap);
|
||||
}
|
||||
|
||||
void PhaseButton::setPhaseText(const QString &_phaseText)
|
||||
|
@ -67,13 +74,11 @@ PhasesToolbar::PhasesToolbar(QWidget *parent)
|
|||
<< combatAttackersButton << combatBlockersButton << combatDamageButton << combatEndButton
|
||||
<< main2Button << cleanupButton;
|
||||
|
||||
for (int i = 0; i < buttonList.size(); ++i) {
|
||||
buttonList[i]->setIconSize(QSize(36, 36));
|
||||
for (int i = 0; i < buttonList.size(); ++i)
|
||||
connect(buttonList[i], SIGNAL(clicked()), this, SLOT(phaseButtonClicked()));
|
||||
}
|
||||
|
||||
QPushButton *nextTurnButton = new QPushButton(QIcon(":/resources/icon_nextturn.svg"), QString());
|
||||
nextTurnButton->setIconSize(QSize(36, 36));
|
||||
nextTurnButton->setIconSize(QSize(40, 40));
|
||||
nextTurnButton->setFixedSize(50, 50);
|
||||
connect(nextTurnButton, SIGNAL(clicked()), this, SIGNAL(signalNextTurn()));
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ private:
|
|||
QString phaseText;
|
||||
bool active;
|
||||
QAction *doubleClickAction;
|
||||
QPixmap activePixmap, inactivePixmap;
|
||||
|
||||
void updatePixmap(QPixmap &pixmap, bool active);
|
||||
public:
|
||||
PhaseButton(const QIcon &icon, QAction *_doubleClickAction = 0);
|
||||
void setPhaseText(const QString &_phaseText);
|
||||
|
|
|
@ -112,6 +112,37 @@ Player::Player(const QString &_name, int _id, bool _local, CardDatabase *_db, Cl
|
|||
sbMenu = playerMenu->addMenu(QString());
|
||||
sbMenu->addAction(aViewSideboard);
|
||||
sb->setMenu(sbMenu, aViewSideboard);
|
||||
|
||||
aUntapAll = new QAction(this);
|
||||
connect(aUntapAll, SIGNAL(triggered()), this, SLOT(actUntapAll()));
|
||||
|
||||
aDecLife = new QAction(this);
|
||||
connect(aDecLife, SIGNAL(triggered()), this, SLOT(actDecLife()));
|
||||
aIncLife = new QAction(this);
|
||||
connect(aIncLife, SIGNAL(triggered()), this, SLOT(actIncLife()));
|
||||
aSetLife = new QAction(this);
|
||||
connect(aSetLife, SIGNAL(triggered()), this, SLOT(actSetLife()));
|
||||
|
||||
aRollDie = new QAction(this);
|
||||
connect(aRollDie, SIGNAL(triggered()), this, SLOT(actRollDie()));
|
||||
|
||||
aCreateToken = new QAction(this);
|
||||
connect(aCreateToken, SIGNAL(triggered()), this, SLOT(actCreateToken()));
|
||||
|
||||
playerMenu->addSeparator();
|
||||
playerMenu->addAction(aUntapAll);
|
||||
playerMenu->addSeparator();
|
||||
playerMenu->addAction(aDecLife);
|
||||
playerMenu->addAction(aIncLife);
|
||||
playerMenu->addAction(aSetLife);
|
||||
playerMenu->addSeparator();
|
||||
playerMenu->addAction(aRollDie);
|
||||
playerMenu->addSeparator();
|
||||
playerMenu->addAction(aCreateToken);
|
||||
playerMenu->addSeparator();
|
||||
sayMenu = playerMenu->addMenu(QString());
|
||||
initSayMenu();
|
||||
|
||||
} else
|
||||
sbMenu = 0;
|
||||
|
||||
|
@ -126,6 +157,7 @@ Player::~Player()
|
|||
delete zones.at(i);
|
||||
|
||||
clearCounters();
|
||||
delete playerMenu;
|
||||
}
|
||||
|
||||
void Player::updateBoundingRect()
|
||||
|
@ -160,6 +192,44 @@ void Player::retranslateUi()
|
|||
handMenu->setTitle(tr("&Hand"));
|
||||
sbMenu->setTitle(tr("&Sideboard"));
|
||||
libraryMenu->setTitle(tr("&Library"));
|
||||
|
||||
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"));
|
||||
sayMenu->setTitle(tr("S&ay"));
|
||||
}
|
||||
}
|
||||
|
||||
void Player::initSayMenu()
|
||||
{
|
||||
sayMenu->clear();
|
||||
|
||||
QSettings settings;
|
||||
settings.beginGroup("messages");
|
||||
int count = settings.value("count", 0).toInt();
|
||||
for (int i = 0; i < count; i++) {
|
||||
QAction *newAction = new QAction(settings.value(QString("msg%1").arg(i)).toString(), this);
|
||||
QString shortcut;
|
||||
switch (i) {
|
||||
case 0: shortcut = tr("F5"); break;
|
||||
case 1: shortcut = tr("F6"); break;
|
||||
case 2: shortcut = tr("F7"); break;
|
||||
case 3: shortcut = tr("F8"); break;
|
||||
case 4: shortcut = tr("F9"); break;
|
||||
case 5: shortcut = tr("F10"); break;
|
||||
}
|
||||
newAction->setShortcut(shortcut);
|
||||
connect(newAction, SIGNAL(triggered()), this, SLOT(actSayMessage()));
|
||||
sayMenu->addAction(newAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,6 +290,50 @@ void Player::actDrawCards()
|
|||
client->drawCards(number);
|
||||
}
|
||||
|
||||
void Player::actUntapAll()
|
||||
{
|
||||
client->setCardAttr("table", -1, "tapped", "false");
|
||||
}
|
||||
|
||||
void Player::actIncLife()
|
||||
{
|
||||
client->incCounter("life", 1);
|
||||
}
|
||||
|
||||
void Player::actDecLife()
|
||||
{
|
||||
client->incCounter("life", -1);
|
||||
}
|
||||
|
||||
void Player::actSetLife()
|
||||
{
|
||||
bool ok;
|
||||
int life = QInputDialog::getInteger(0, tr("Set life"), tr("New life total:"), getCounter("life")->getValue(), 0, 2000000000, 1, &ok);
|
||||
if (ok)
|
||||
client->setCounter("life", life);
|
||||
}
|
||||
|
||||
void Player::actRollDie()
|
||||
{
|
||||
bool ok;
|
||||
int sides = QInputDialog::getInteger(0, tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok);
|
||||
if (ok)
|
||||
client->rollDie(sides);
|
||||
}
|
||||
|
||||
void Player::actCreateToken()
|
||||
{
|
||||
QString cardname = QInputDialog::getText(0, tr("Create token"), tr("Name:"));
|
||||
if (!cardname.isEmpty())
|
||||
client->createToken("table", cardname, QString(), 0, 0);
|
||||
}
|
||||
|
||||
void Player::actSayMessage()
|
||||
{
|
||||
QAction *a = qobject_cast<QAction *>(sender());
|
||||
client->say(a->text());
|
||||
}
|
||||
|
||||
void Player::addZone(CardZone *z)
|
||||
{
|
||||
zones << z;
|
||||
|
|
|
@ -33,6 +33,15 @@ signals:
|
|||
void logSetDoesntUntap(Player *player, QString cardName, bool doesntUntap);
|
||||
|
||||
void sizeChanged();
|
||||
public slots:
|
||||
void actUntapAll();
|
||||
void actIncLife();
|
||||
void actDecLife();
|
||||
void actSetLife();
|
||||
void actRollDie();
|
||||
void actCreateToken();
|
||||
|
||||
void actSayMessage();
|
||||
private slots:
|
||||
void updateBoundingRect();
|
||||
|
||||
|
@ -49,10 +58,11 @@ private slots:
|
|||
void actViewRfg();
|
||||
void actViewSideboard();
|
||||
private:
|
||||
QMenu *playerMenu, *handMenu, *graveMenu, *rfgMenu, *libraryMenu, *sbMenu;
|
||||
QMenu *playerMenu, *handMenu, *graveMenu, *rfgMenu, *libraryMenu, *sbMenu, *sayMenu;
|
||||
QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary,
|
||||
*aViewLibrary, *aViewTopCards, *aViewGraveyard, *aViewRfg, *aViewSideboard,
|
||||
*aDrawCard, *aDrawCards, *aShuffle;
|
||||
*aDrawCard, *aDrawCards, *aShuffle,
|
||||
*aUntapAll, *aDecLife, *aIncLife, *aSetLife, *aRollDie, *aCreateToken;
|
||||
|
||||
int defaultNumberTopCards;
|
||||
QString name;
|
||||
|
@ -72,6 +82,7 @@ private:
|
|||
|
||||
QList<Counter *> counterList;
|
||||
void rearrangeCounters();
|
||||
void initSayMenu();
|
||||
public:
|
||||
enum { Type = typeOther };
|
||||
int type() const { return Type; }
|
||||
|
|
|
@ -7,11 +7,13 @@ class ServerPlayer {
|
|||
private:
|
||||
int PlayerId;
|
||||
QString name;
|
||||
bool local;
|
||||
public:
|
||||
ServerPlayer(int _PlayerId, const QString &_name)
|
||||
: PlayerId(_PlayerId), name(_name) { }
|
||||
ServerPlayer(int _PlayerId, const QString &_name, bool _local)
|
||||
: PlayerId(_PlayerId), name(_name), local(_local) { }
|
||||
int getPlayerId() const { return PlayerId; }
|
||||
QString getName() const { return name; }
|
||||
bool getLocal() const { return local; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -38,11 +38,6 @@
|
|||
#include "zoneviewlayout.h"
|
||||
#include "chatwidget.h"
|
||||
|
||||
void MainWindow::hoverCard(QString name)
|
||||
{
|
||||
cardInfo->setCard(name);
|
||||
}
|
||||
|
||||
void MainWindow::playerAdded(Player *player)
|
||||
{
|
||||
menuBar()->addMenu(player->getPlayerMenu());
|
||||
|
@ -50,11 +45,6 @@ void MainWindow::playerAdded(Player *player)
|
|||
connect(player, SIGNAL(closeZoneView(ZoneViewZone *)), zoneLayout, SLOT(removeItem(ZoneViewZone *)));
|
||||
}
|
||||
|
||||
void MainWindow::playerRemoved(Player *player)
|
||||
{
|
||||
menuBar()->removeAction(player->getPlayerMenu()->menuAction());
|
||||
}
|
||||
|
||||
void MainWindow::statusChanged(ProtocolStatus _status)
|
||||
{
|
||||
switch (_status) {
|
||||
|
@ -95,11 +85,22 @@ void MainWindow::statusChanged(ProtocolStatus _status)
|
|||
chatWidget->enableChat();
|
||||
break;
|
||||
}
|
||||
case StatusPlaying:
|
||||
case StatusPlaying: {
|
||||
chatWidget->disableChat();
|
||||
|
||||
game = new Game(db, client, scene, menuBar(), this);
|
||||
connect(game, SIGNAL(hoverCard(QString)), cardInfo, SLOT(setCard(const QString &)));
|
||||
connect(game, SIGNAL(playerAdded(Player *)), this, SLOT(playerAdded(Player *)));
|
||||
connect(game, SIGNAL(playerRemoved(Player *)), scene, SLOT(removePlayer(Player *)));
|
||||
connect(game, SIGNAL(setActivePhase(int)), phasesToolbar, SLOT(setActivePhase(int)));
|
||||
messageLog->connectToGame(game);
|
||||
aRestartGame->setEnabled(true);
|
||||
aLeaveGame->setEnabled(true);
|
||||
|
||||
phasesToolbar->show();
|
||||
view->show();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -164,24 +165,6 @@ void MainWindow::actSay()
|
|||
sayEdit->clear();
|
||||
}
|
||||
|
||||
void MainWindow::playerIdReceived(int id, QString name)
|
||||
{
|
||||
game = new Game(db, client, scene, actionsMenu, cardMenu, id, name, this);
|
||||
connect(game, SIGNAL(hoverCard(QString)), this, SLOT(hoverCard(QString)));
|
||||
connect(game, SIGNAL(playerAdded(Player *)), this, SLOT(playerAdded(Player *)));
|
||||
connect(game, SIGNAL(playerRemoved(Player *)), this, SLOT(playerRemoved(Player *)));
|
||||
connect(game, SIGNAL(playerRemoved(Player *)), scene, SLOT(removePlayer(Player *)));
|
||||
connect(game, SIGNAL(setActivePhase(int)), phasesToolbar, SLOT(setActivePhase(int)));
|
||||
connect(phasesToolbar, SIGNAL(signalUntapAll()), game, SLOT(actUntapAll()));
|
||||
playerAdded(game->getLocalPlayer());
|
||||
|
||||
messageLog->connectToGame(game);
|
||||
aRestartGame->setEnabled(true);
|
||||
aLeaveGame->setEnabled(true);
|
||||
|
||||
client->listPlayers();
|
||||
}
|
||||
|
||||
void MainWindow::serverTimeout()
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Server timeout"));
|
||||
|
@ -204,9 +187,7 @@ void MainWindow::retranslateUi()
|
|||
aCloseMostRecentZoneView->setText(tr("Close most recent zone view"));
|
||||
aCloseMostRecentZoneView->setShortcut(tr("Esc"));
|
||||
|
||||
gameMenu->setTitle(tr("&Game"));
|
||||
actionsMenu->setTitle(tr("&Actions"));
|
||||
cardMenu->setTitle(tr("&Card"));
|
||||
cockatriceMenu->setTitle(tr("&Cockatrice"));
|
||||
|
||||
sayLabel->setText(tr("&Say:"));
|
||||
|
||||
|
@ -248,24 +229,20 @@ void MainWindow::createActions()
|
|||
|
||||
void MainWindow::createMenus()
|
||||
{
|
||||
gameMenu = menuBar()->addMenu(QString());
|
||||
gameMenu->addAction(aConnect);
|
||||
gameMenu->addAction(aDisconnect);
|
||||
gameMenu->addSeparator();
|
||||
gameMenu->addAction(aRestartGame);
|
||||
gameMenu->addAction(aLeaveGame);
|
||||
gameMenu->addSeparator();
|
||||
gameMenu->addAction(aDeckEditor);
|
||||
gameMenu->addSeparator();
|
||||
gameMenu->addAction(aFullScreen);
|
||||
gameMenu->addSeparator();
|
||||
gameMenu->addAction(aSettings);
|
||||
gameMenu->addSeparator();
|
||||
gameMenu->addAction(aExit);
|
||||
|
||||
actionsMenu = menuBar()->addMenu(QString());
|
||||
|
||||
cardMenu = menuBar()->addMenu(QString());
|
||||
cockatriceMenu = menuBar()->addMenu(QString());
|
||||
cockatriceMenu->addAction(aConnect);
|
||||
cockatriceMenu->addAction(aDisconnect);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aRestartGame);
|
||||
cockatriceMenu->addAction(aLeaveGame);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aDeckEditor);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aFullScreen);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aSettings);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aExit);
|
||||
}
|
||||
|
||||
MainWindow::MainWindow(QTranslator *_translator, QWidget *parent)
|
||||
|
@ -323,7 +300,6 @@ MainWindow::MainWindow(QTranslator *_translator, QWidget *parent)
|
|||
|
||||
connect(client, SIGNAL(serverTimeout()), this, SLOT(serverTimeout()));
|
||||
connect(client, SIGNAL(statusChanged(ProtocolStatus)), this, SLOT(statusChanged(ProtocolStatus)));
|
||||
connect(client, SIGNAL(playerIdReceived(int, QString)), this, SLOT(playerIdReceived(int, QString)));
|
||||
|
||||
connect(this, SIGNAL(logConnecting(QString)), messageLog, SLOT(logConnecting(QString)));
|
||||
connect(client, SIGNAL(welcomeMsgReceived(QString)), messageLog, SLOT(logConnected(QString)));
|
||||
|
|
|
@ -46,11 +46,8 @@ class ChatWidget;
|
|||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void hoverCard(QString name);
|
||||
void playerAdded(Player *player);
|
||||
void playerRemoved(Player *player);
|
||||
void statusChanged(ProtocolStatus _status);
|
||||
void playerIdReceived(int id, QString name);
|
||||
void serverTimeout();
|
||||
|
||||
void actSay();
|
||||
|
@ -70,7 +67,7 @@ private:
|
|||
void retranslateUi();
|
||||
void createActions();
|
||||
void createMenus();
|
||||
QMenu *gameMenu, *actionsMenu, *cardMenu;
|
||||
QMenu *cockatriceMenu;
|
||||
QAction *aConnect, *aDisconnect, *aRestartGame, *aLeaveGame, *aDeckEditor, *aFullScreen, *aSettings, *aExit;
|
||||
QAction *aCloseMostRecentZoneView;
|
||||
QVBoxLayout *viewLayout;
|
||||
|
|
|
@ -368,33 +368,38 @@
|
|||
<translation>&Spieler:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="27"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="19"/>
|
||||
<source>&Spectators allowed</source>
|
||||
<translation>&Zuschauer zugelassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="31"/>
|
||||
<source>&OK</source>
|
||||
<translation>&OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="29"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="33"/>
|
||||
<source>&Cancel</source>
|
||||
<translation>&Abbruch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="42"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="46"/>
|
||||
<source>Create game</source>
|
||||
<translation>Spiel erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="54"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="71"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="58"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="75"/>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="54"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="58"/>
|
||||
<source>Invalid number of players.</source>
|
||||
<translation>Ungültige Anzahl an Spielern.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="71"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="75"/>
|
||||
<source>XXX</source>
|
||||
<translation>XXX</translation>
|
||||
</message>
|
||||
|
@ -691,12 +696,12 @@
|
|||
<translation>F10</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="390"/>
|
||||
<location filename="../src/game.cpp" line="408"/>
|
||||
<source>Set life</source>
|
||||
<translation>Setze Leben</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="390"/>
|
||||
<location filename="../src/game.cpp" line="408"/>
|
||||
<source>New life total:</source>
|
||||
<translation>Neues Leben insgesammt:</translation>
|
||||
</message>
|
||||
|
@ -705,7 +710,7 @@
|
|||
<translation type="obsolete">Würfeln</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="398"/>
|
||||
<location filename="../src/game.cpp" line="416"/>
|
||||
<source>Number of sides:</source>
|
||||
<translation>Anzahl der Seiten:</translation>
|
||||
</message>
|
||||
|
@ -714,12 +719,12 @@
|
|||
<translation type="obsolete">Karten ziehen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="469"/>
|
||||
<location filename="../src/game.cpp" line="487"/>
|
||||
<source>Number:</source>
|
||||
<translation>Anzahl:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="405"/>
|
||||
<location filename="../src/game.cpp" line="423"/>
|
||||
<source>Create token</source>
|
||||
<translation>Token erstellen</translation>
|
||||
</message>
|
||||
|
@ -729,17 +734,17 @@
|
|||
<translation>&Würfeln...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="398"/>
|
||||
<location filename="../src/game.cpp" line="416"/>
|
||||
<source>Roll die</source>
|
||||
<translation>Würfeln</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="405"/>
|
||||
<location filename="../src/game.cpp" line="423"/>
|
||||
<source>Name:</source>
|
||||
<translation>Name:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="469"/>
|
||||
<location filename="../src/game.cpp" line="487"/>
|
||||
<source>Set counters</source>
|
||||
<translation>Setze Zählmarke</translation>
|
||||
</message>
|
||||
|
@ -747,35 +752,40 @@
|
|||
<context>
|
||||
<name>GameSelector</name>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="100"/>
|
||||
<location filename="../src/gameselector.cpp" line="107"/>
|
||||
<source>C&reate</source>
|
||||
<translation>Spiel e&rstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="101"/>
|
||||
<location filename="../src/gameselector.cpp" line="108"/>
|
||||
<source>&Join</source>
|
||||
<translation>&Teilnehmen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<location filename="../src/gameselector.cpp" line="57"/>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<location filename="../src/gameselector.cpp" line="57"/>
|
||||
<source>XXX</source>
|
||||
<translation>XXX</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<source>Join game</source>
|
||||
<translation>Spiel beitreten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<source>Password:</source>
|
||||
<translation>Passwort:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="109"/>
|
||||
<source>J&oin as spectator</source>
|
||||
<translation>&Zuschauen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GamesModel</name>
|
||||
|
@ -973,37 +983,36 @@
|
|||
<translation>Verbinde zu %1...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="22"/>
|
||||
<source>Connected.</source>
|
||||
<translation>Verbunden.</translation>
|
||||
<translation type="obsolete">Verbunden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="31"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="27"/>
|
||||
<source>Disconnected from server.</source>
|
||||
<translation>Verbindung zum Server getrennt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="42"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="38"/>
|
||||
<source>Invalid password.</source>
|
||||
<translation>Ungültiges Passwort.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="50"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="51"/>
|
||||
<source>You have joined the game. Player list:</source>
|
||||
<translation>Du bist dem Spiel beigetreten. Spielerliste:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="58"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="59"/>
|
||||
<source>%1 has joined the game</source>
|
||||
<translation>%1 ist dem Spiel beigetreten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="63"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="64"/>
|
||||
<source>%1 has left the game</source>
|
||||
<translation>%1 hat das Spiel verlassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="68"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="79"/>
|
||||
<source>%1 is ready to start a new game.</source>
|
||||
<translation>%1 ist bereit ein neues Spiel zu starten.</translation>
|
||||
</message>
|
||||
|
@ -1028,7 +1037,7 @@
|
|||
<translation type="obsolete">%1 zieht %2 Karten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="159"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="170"/>
|
||||
<source>a card</source>
|
||||
<translation>eine Karte</translation>
|
||||
</message>
|
||||
|
@ -1085,12 +1094,12 @@
|
|||
<translation type="obsolete">%1s Sideboard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="73"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="84"/>
|
||||
<source>The game has started.</source>
|
||||
<translation>Das Spiel hat begonnen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="83"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="94"/>
|
||||
<source>%1 shuffles his library.</source>
|
||||
<translation>%1 mischt seine Bibliothek.</translation>
|
||||
</message>
|
||||
|
@ -1099,117 +1108,137 @@
|
|||
<translation type="obsolete">%1 würfelt eine %2 mit einem %3-seitigen Würfel.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="88"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="22"/>
|
||||
<source>Connected: %1</source>
|
||||
<translation>Verbunden: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="45"/>
|
||||
<source>Protocol version mismatch.</source>
|
||||
<translation>Protokollversion stimmt nicht überein.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="69"/>
|
||||
<source>%1 is now watching the game.</source>
|
||||
<translation>%1 schaut nun dem Spiel zu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="74"/>
|
||||
<source>%1 is not watching the game any more.</source>
|
||||
<translation>%1 schaut dem Spiel nicht mehr zu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="99"/>
|
||||
<source>%1 rolls a %2 with a %3-sided die.</source>
|
||||
<translation>%1 würfelt eine %2 mit einem %3-seitigen Würfel.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="94"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="105"/>
|
||||
<source>%1 draws a card.</source>
|
||||
<translation>%1 zieht eine Karte.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="96"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="107"/>
|
||||
<source>%1 draws %2 cards.</source>
|
||||
<translation>%1 zieht %2 Karten.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="109"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="120"/>
|
||||
<source> from table</source>
|
||||
<translation> vom Spielfeld</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="111"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="122"/>
|
||||
<source> from graveyard</source>
|
||||
<translation> aus dem Friedhof</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="113"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="124"/>
|
||||
<source> from exile</source>
|
||||
<translation> aus dem Exil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="115"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="126"/>
|
||||
<source> from hand</source>
|
||||
<translation> von der Hand</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="119"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="130"/>
|
||||
<source>the bottom card of his library</source>
|
||||
<translation>die unterste Karte seiner Bibliothek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="122"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="133"/>
|
||||
<source> from the bottom of his library</source>
|
||||
<translation>, die unterste Karte seiner Bibliothek,</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="125"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="136"/>
|
||||
<source>the top card of his library</source>
|
||||
<translation>die oberste Karte seiner Bibliothek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="128"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="139"/>
|
||||
<source> from the top of his library</source>
|
||||
<translation>, die oberste Karte seiner Bibliothek,</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="130"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="141"/>
|
||||
<source> from library</source>
|
||||
<translation> aus der Bibliothek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="132"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="143"/>
|
||||
<source> from sideboard</source>
|
||||
<translation> aus dem Sideboard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="136"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="147"/>
|
||||
<source>%1 puts %2 into play%3.</source>
|
||||
<translation>%1 bringt %2%3 ins Spiel.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="138"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="149"/>
|
||||
<source>%1 puts %2%3 into graveyard.</source>
|
||||
<translation>%1 legt %2%3 auf den Friedhof.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="140"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="151"/>
|
||||
<source>%1 exiles %2%3.</source>
|
||||
<translation>%1 schickt %2%3 ins Exil.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="142"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="153"/>
|
||||
<source>%1 moves %2%3 to hand.</source>
|
||||
<translation>%1 nimmt %2%3 auf die Hand.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="145"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="156"/>
|
||||
<source>%1 puts %2%3 into his library.</source>
|
||||
<translation>%1 legt %2%3 in seine Bibliothek.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="147"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="158"/>
|
||||
<source>%1 puts %2%3 on bottom of his library.</source>
|
||||
<translation>%1 legt %2%3 unter seine Bibliothek.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="149"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="160"/>
|
||||
<source>%1 puts %2%3 on top of his library.</source>
|
||||
<translation>%1 legt %2%3 auf die Bibliothek.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="151"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="162"/>
|
||||
<source>%1 puts %2%3 into his library at position %4.</source>
|
||||
<translation>%1 legt %2%3 in seine Bibliothek an %4. Stelle.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="153"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="164"/>
|
||||
<source>%1 moves %2%3 to sideboard.</source>
|
||||
<translation>%1 legt %2%3 in sein Sideboard.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="209"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="220"/>
|
||||
<source>%1 is looking at the top %2 cards %3.</source>
|
||||
<translation>%1 sieht sich die obersten %2 Karten %3 an.</translation>
|
||||
</message>
|
||||
|
@ -1294,27 +1323,27 @@
|
|||
<translation type="obsolete">%1 legt %2%3in sein Sideboard.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="168"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="179"/>
|
||||
<source>%1 creates token: %2.</source>
|
||||
<translation>%1 erstellt Token: %2.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="175"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="186"/>
|
||||
<source>%1 places %2 counters on %3 (now %4).</source>
|
||||
<translation>%1 legt %2 Zählmarken auf %3 (jetzt %4).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="177"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<source>%1 removes %2 counters from %3 (now %4).</source>
|
||||
<translation>%1 entfernt %2 Zählmarken von %3 (jetzt %4).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="199"/>
|
||||
<source>%1 %2 %3.</source>
|
||||
<translation>%1 %2 %3.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="193"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="204"/>
|
||||
<source>%1 sets counter "%2" to %3 (%4%5).</source>
|
||||
<translation>%1 setzt Zählmarke "%2" auf %3 (%4%5).</translation>
|
||||
</message>
|
||||
|
@ -1323,17 +1352,17 @@
|
|||
<translation type="obsolete">%1 sieht sich die obersten %2 Karten %3 an.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="211"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="222"/>
|
||||
<source>%1 is looking at %2.</source>
|
||||
<translation>%1 sieht sich %2 an.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="217"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="228"/>
|
||||
<source>%1 stops looking at %2.</source>
|
||||
<translation>%1 sieht sich %2 nicht mehr an.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="241"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="252"/>
|
||||
<source>ending phase</source>
|
||||
<translation>die Zugendphase</translation>
|
||||
</message>
|
||||
|
@ -1362,57 +1391,57 @@
|
|||
<translation type="obsolete">%1 sieht sich %2s %3 nicht mehr an</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="223"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="234"/>
|
||||
<source>It is now %1's turn.</source>
|
||||
<translation>%1 ist am Zug.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="231"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="242"/>
|
||||
<source>untap step</source>
|
||||
<translation>das Enttappsegment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="232"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="243"/>
|
||||
<source>upkeep step</source>
|
||||
<translation>das Versorgungssegment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="233"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="244"/>
|
||||
<source>draw step</source>
|
||||
<translation>das Ziehsegment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="234"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="245"/>
|
||||
<source>first main phase</source>
|
||||
<translation>die erste Hauptphase</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="235"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="246"/>
|
||||
<source>beginning of combat step</source>
|
||||
<translation>das Anfangssegment der Kampfphase</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="236"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="247"/>
|
||||
<source>declare attackers step</source>
|
||||
<translation>das Angreifer-Deklarieren-Segment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="237"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="248"/>
|
||||
<source>declare blockers step</source>
|
||||
<translation>das Blocker-Deklarieren-Segment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="238"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="249"/>
|
||||
<source>combat damage step</source>
|
||||
<translation>das Kampfschadenssegment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="239"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="250"/>
|
||||
<source>end of combat step</source>
|
||||
<translation>das Endsegment der Kampfphase</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="240"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="251"/>
|
||||
<source>second main phase</source>
|
||||
<translation>die zweite Hauptphase</translation>
|
||||
</message>
|
||||
|
@ -1421,7 +1450,7 @@
|
|||
<translation type="obsolete">das Ende-des-Zuges-Segment</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="243"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="254"/>
|
||||
<source>It is now the %1.</source>
|
||||
<translation>Es ist nun %1.</translation>
|
||||
</message>
|
||||
|
@ -1430,12 +1459,12 @@
|
|||
<translation type="obsolete">%1 bewegt %2 %3 nach %4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="199"/>
|
||||
<source>taps</source>
|
||||
<translation>tappt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="199"/>
|
||||
<source>untaps</source>
|
||||
<translation>enttappt</translation>
|
||||
</message>
|
||||
|
@ -1460,7 +1489,7 @@
|
|||
<translation type="obsolete">%1 entfernt %2 Zählmarken von %3 (jetzt %4)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="185"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="196"/>
|
||||
<source>his permanents</source>
|
||||
<translation>seine bleibenden Karten</translation>
|
||||
</message>
|
||||
|
@ -1473,12 +1502,12 @@
|
|||
<translation type="obsolete">%1 setzt Zähler "%2" auf %3 (%4%5)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="200"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="211"/>
|
||||
<source>%1 sets %2 to not untap normally.</source>
|
||||
<translation>%1 setzt %2 auf explizites Enttappen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="202"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="213"/>
|
||||
<source>%1 sets %2 to untap normally.</source>
|
||||
<translation>%1 setzt %2 auf normales Enttappen.</translation>
|
||||
</message>
|
||||
|
@ -1907,12 +1936,12 @@ Willst du die Änderungen speichern?</translation>
|
|||
<context>
|
||||
<name>ZoneViewWidget</name>
|
||||
<message>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="69"/>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="72"/>
|
||||
<source>sort alphabetically</source>
|
||||
<translation>alphabetisch sortieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="71"/>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="74"/>
|
||||
<source>shuffle when closing</source>
|
||||
<translation>beim Schließen mischen</translation>
|
||||
</message>
|
||||
|
|
|
@ -333,33 +333,38 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="27"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="19"/>
|
||||
<source>&Spectators allowed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="31"/>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="29"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="33"/>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="42"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="46"/>
|
||||
<source>Create game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="54"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="71"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="58"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="75"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="54"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="58"/>
|
||||
<source>Invalid number of players.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/dlg_creategame.cpp" line="71"/>
|
||||
<location filename="../src/dlg_creategame.cpp" line="75"/>
|
||||
<source>XXX</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -593,27 +598,27 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="390"/>
|
||||
<location filename="../src/game.cpp" line="408"/>
|
||||
<source>Set life</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="390"/>
|
||||
<location filename="../src/game.cpp" line="408"/>
|
||||
<source>New life total:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="398"/>
|
||||
<location filename="../src/game.cpp" line="416"/>
|
||||
<source>Number of sides:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="469"/>
|
||||
<location filename="../src/game.cpp" line="487"/>
|
||||
<source>Number:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="405"/>
|
||||
<location filename="../src/game.cpp" line="423"/>
|
||||
<source>Create token</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -623,17 +628,17 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="398"/>
|
||||
<location filename="../src/game.cpp" line="416"/>
|
||||
<source>Roll die</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="405"/>
|
||||
<location filename="../src/game.cpp" line="423"/>
|
||||
<source>Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/game.cpp" line="469"/>
|
||||
<location filename="../src/game.cpp" line="487"/>
|
||||
<source>Set counters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -641,35 +646,40 @@
|
|||
<context>
|
||||
<name>GameSelector</name>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="100"/>
|
||||
<location filename="../src/gameselector.cpp" line="107"/>
|
||||
<source>C&reate</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="101"/>
|
||||
<location filename="../src/gameselector.cpp" line="108"/>
|
||||
<source>&Join</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<location filename="../src/gameselector.cpp" line="57"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<location filename="../src/gameselector.cpp" line="57"/>
|
||||
<source>XXX</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<source>Join game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<source>Password:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="109"/>
|
||||
<source>J&oin as spectator</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GamesModel</name>
|
||||
|
@ -867,292 +877,307 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="22"/>
|
||||
<source>Connected.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="31"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="27"/>
|
||||
<source>Disconnected from server.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="42"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="38"/>
|
||||
<source>Invalid password.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="50"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="45"/>
|
||||
<source>Protocol version mismatch.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="51"/>
|
||||
<source>You have joined the game. Player list:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="58"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="59"/>
|
||||
<source>%1 has joined the game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="63"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="64"/>
|
||||
<source>%1 has left the game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="68"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="69"/>
|
||||
<source>%1 is now watching the game.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="74"/>
|
||||
<source>%1 is not watching the game any more.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="79"/>
|
||||
<source>%1 is ready to start a new game.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="88"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="99"/>
|
||||
<source>%1 rolls a %2 with a %3-sided die.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="109"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="120"/>
|
||||
<source> from table</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="111"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="122"/>
|
||||
<source> from graveyard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="113"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="124"/>
|
||||
<source> from exile</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="115"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="126"/>
|
||||
<source> from hand</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="119"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="130"/>
|
||||
<source>the bottom card of his library</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="122"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="133"/>
|
||||
<source> from the bottom of his library</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="125"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="136"/>
|
||||
<source>the top card of his library</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="128"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="139"/>
|
||||
<source> from the top of his library</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="130"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="141"/>
|
||||
<source> from library</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="132"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="143"/>
|
||||
<source> from sideboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="136"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="147"/>
|
||||
<source>%1 puts %2 into play%3.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="138"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="149"/>
|
||||
<source>%1 puts %2%3 into graveyard.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="140"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="151"/>
|
||||
<source>%1 exiles %2%3.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="142"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="153"/>
|
||||
<source>%1 moves %2%3 to hand.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="145"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="156"/>
|
||||
<source>%1 puts %2%3 into his library.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="147"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="158"/>
|
||||
<source>%1 puts %2%3 on bottom of his library.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="149"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="160"/>
|
||||
<source>%1 puts %2%3 on top of his library.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="151"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="162"/>
|
||||
<source>%1 puts %2%3 into his library at position %4.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="153"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="164"/>
|
||||
<source>%1 moves %2%3 to sideboard.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="159"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="170"/>
|
||||
<source>a card</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="209"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="220"/>
|
||||
<source>%1 is looking at the top %2 cards %3.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="73"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="84"/>
|
||||
<source>The game has started.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="94"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="105"/>
|
||||
<source>%1 draws a card.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="96"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="107"/>
|
||||
<source>%1 draws %2 cards.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="168"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="179"/>
|
||||
<source>%1 creates token: %2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="175"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="186"/>
|
||||
<source>%1 places %2 counters on %3 (now %4).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="177"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<source>%1 removes %2 counters from %3 (now %4).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="199"/>
|
||||
<source>%1 %2 %3.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="193"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="204"/>
|
||||
<source>%1 sets counter "%2" to %3 (%4%5).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="211"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="222"/>
|
||||
<source>%1 is looking at %2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="217"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="228"/>
|
||||
<source>%1 stops looking at %2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="241"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="252"/>
|
||||
<source>ending phase</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="223"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="234"/>
|
||||
<source>It is now %1's turn.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="83"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="22"/>
|
||||
<source>Connected: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="94"/>
|
||||
<source>%1 shuffles his library.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="231"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="242"/>
|
||||
<source>untap step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="232"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="243"/>
|
||||
<source>upkeep step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="233"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="244"/>
|
||||
<source>draw step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="234"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="245"/>
|
||||
<source>first main phase</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="235"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="246"/>
|
||||
<source>beginning of combat step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="236"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="247"/>
|
||||
<source>declare attackers step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="237"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="248"/>
|
||||
<source>declare blockers step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="238"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="249"/>
|
||||
<source>combat damage step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="239"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="250"/>
|
||||
<source>end of combat step</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="240"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="251"/>
|
||||
<source>second main phase</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="243"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="254"/>
|
||||
<source>It is now the %1.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="199"/>
|
||||
<source>taps</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="188"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="199"/>
|
||||
<source>untaps</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="200"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="211"/>
|
||||
<source>%1 sets %2 to not untap normally.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="202"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="213"/>
|
||||
<source>%1 sets %2 to untap normally.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/messagelogwidget.cpp" line="185"/>
|
||||
<location filename="../src/messagelogwidget.cpp" line="196"/>
|
||||
<source>his permanents</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1552,12 +1577,12 @@ Do you want to save the changes?</source>
|
|||
<context>
|
||||
<name>ZoneViewWidget</name>
|
||||
<message>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="69"/>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="72"/>
|
||||
<source>sort alphabetically</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="71"/>
|
||||
<location filename="../src/zoneviewwidget.cpp" line="74"/>
|
||||
<source>shuffle when closing</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -44,27 +44,16 @@ QString ServerGame::getGameListLine() const
|
|||
.arg(players.size())
|
||||
.arg(maxPlayers)
|
||||
.arg(creator->getPlayerName())
|
||||
.arg(spectatorsAllowed ? 0 : 1)
|
||||
.arg(spectatorsAllowed ? 1 : 0)
|
||||
.arg(spectators.size());
|
||||
}
|
||||
|
||||
QStringList ServerGame::getPlayerNames() const
|
||||
{
|
||||
QStringList result;
|
||||
QListIterator<ServerSocket *> i(players);
|
||||
while (i.hasNext()) {
|
||||
ServerSocket *tmp = i.next();
|
||||
result << QString("%1|%2").arg(tmp->getPlayerId()).arg(tmp->getPlayerName());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ServerSocket *ServerGame::getPlayer(int player_id)
|
||||
ServerSocket *ServerGame::getPlayer(int playerId)
|
||||
{
|
||||
QListIterator<ServerSocket *> i(players);
|
||||
while (i.hasNext()) {
|
||||
ServerSocket *tmp = i.next();
|
||||
if (tmp->getPlayerId() == player_id)
|
||||
if (tmp->getPlayerId() == playerId)
|
||||
return tmp;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -72,9 +61,10 @@ ServerSocket *ServerGame::getPlayer(int player_id)
|
|||
|
||||
void ServerGame::msg(const QString &s)
|
||||
{
|
||||
QListIterator<ServerSocket *> i(players);
|
||||
while (i.hasNext())
|
||||
i.next()->msg(s);
|
||||
for (int i = 0; i < players.size(); ++i)
|
||||
players[i]->msg(s);
|
||||
for (int i = 0; i < spectators.size(); ++i)
|
||||
spectators[i]->msg(s);
|
||||
}
|
||||
|
||||
void ServerGame::broadcastEvent(const QString &cmd, ServerSocket *player)
|
||||
|
@ -139,7 +129,6 @@ void ServerGame::addPlayer(ServerSocket *player, bool spectator)
|
|||
max = tmp;
|
||||
}
|
||||
player->setPlayerId(max + 1);
|
||||
player->msg(QString("private|||player_id|%1|%2").arg(max + 1).arg(player->getPlayerName()));
|
||||
} else
|
||||
player->setPlayerId(-1);
|
||||
|
||||
|
|
|
@ -48,14 +48,14 @@ public:
|
|||
ServerSocket *getCreator() const { return creator; }
|
||||
bool getGameStarted() const { return gameStarted; }
|
||||
int getPlayerCount() const { return players.size(); }
|
||||
const QList<ServerSocket *> &getPlayers() const { return players; }
|
||||
int getGameId() const { return gameId; }
|
||||
QString getDescription() const { return description; }
|
||||
QString getPassword() const { return password; }
|
||||
int getMaxPlayers() const { return maxPlayers; }
|
||||
bool getSpectatorsAllowed() const { return spectatorsAllowed; }
|
||||
QString getGameListLine() const;
|
||||
QStringList getPlayerNames() const;
|
||||
ServerSocket *getPlayer(int player_id);
|
||||
ServerSocket *getPlayer(int playerId);
|
||||
ReturnMessage::ReturnCode checkJoin(const QString &_password, bool spectator);
|
||||
void addPlayer(ServerSocket *player, bool spectator);
|
||||
void removePlayer(ServerSocket *player);
|
||||
|
|
|
@ -353,7 +353,12 @@ ReturnMessage::ReturnCode ServerSocket::cmdLeaveGame(const QList<QVariant> &/*pa
|
|||
|
||||
ReturnMessage::ReturnCode ServerSocket::cmdListPlayers(const QList<QVariant> &/*params*/)
|
||||
{
|
||||
remsg->sendList(game->getPlayerNames());
|
||||
QStringList result;
|
||||
const QList<ServerSocket *> &players = game->getPlayers();
|
||||
for (int i = 0; i < players.size(); ++i)
|
||||
result << QString("%1|%2|%3").arg(players[i]->getPlayerId()).arg(players[i]->getPlayerName()).arg(players[i] == this ? 1 : 0);
|
||||
|
||||
remsg->sendList(result);
|
||||
return ReturnMessage::ReturnOk;
|
||||
}
|
||||
|
||||
|
@ -398,7 +403,7 @@ ReturnMessage::ReturnCode ServerSocket::cmdDrawCards(const QList<QVariant> ¶
|
|||
Card *card = deck->cards.first();
|
||||
deck->cards.removeFirst();
|
||||
hand->cards.append(card);
|
||||
msg(QString("private|||draw|%1|%2").arg(card->getId()).arg(card->getName()));
|
||||
privateEvent(QString("draw|%1|%2").arg(card->getId()).arg(card->getName()));
|
||||
}
|
||||
|
||||
emit broadcastEvent(QString("draw|%1").arg(number), this);
|
||||
|
@ -467,7 +472,7 @@ ReturnMessage::ReturnCode ServerSocket::cmdMoveCard(const QList<QVariant> ¶m
|
|||
privateCardId = QString();
|
||||
privateCardName = QString();
|
||||
}
|
||||
msg(QString("private|||move_card|%1|%2|%3|%4|%5|%6|%7|%8").arg(privateCardId)
|
||||
privateEvent(QString("move_card|%1|%2|%3|%4|%5|%6|%7|%8").arg(privateCardId)
|
||||
.arg(privateCardName)
|
||||
.arg(startzone->getName())
|
||||
.arg(position)
|
||||
|
@ -773,14 +778,9 @@ bool ServerSocket::parseCommand(QString line)
|
|||
return remsg->send(ReturnMessage::ReturnSyntaxError);
|
||||
}
|
||||
|
||||
PlayerStatusEnum ServerSocket::getStatus()
|
||||
void ServerSocket::privateEvent(const QString &line)
|
||||
{
|
||||
return PlayerStatus;
|
||||
}
|
||||
|
||||
void ServerSocket::setStatus(PlayerStatusEnum status)
|
||||
{
|
||||
PlayerStatus = status;
|
||||
msg(QString("private|%1|%2|%3").arg(playerId).arg(playerName).arg(line));
|
||||
}
|
||||
|
||||
void ServerSocket::setGame(ServerGame *g)
|
||||
|
@ -812,7 +812,7 @@ QStringList ServerSocket::listZones() const
|
|||
|
||||
void ServerSocket::msg(const QString &s)
|
||||
{
|
||||
qDebug(QString(">>> %1").arg(s).toLatin1());
|
||||
qDebug(QString("OUT id=%1 name=%2 >>> %3").arg(playerId).arg(playerName).arg(s).toLatin1());
|
||||
QTextStream stream(this);
|
||||
stream.setCodec("UTF-8");
|
||||
stream << s << endl;
|
||||
|
|
|
@ -107,6 +107,7 @@ private:
|
|||
void clearZones();
|
||||
void leaveGame();
|
||||
bool parseCommand(QString line);
|
||||
void privateEvent(const QString &line);
|
||||
PlayerStatusEnum PlayerStatus;
|
||||
ReturnMessage *remsg;
|
||||
AuthenticationResult authState;
|
||||
|
@ -117,8 +118,8 @@ public:
|
|||
~ServerSocket();
|
||||
void msg(const QString &s);
|
||||
void setGame(ServerGame *g);
|
||||
PlayerStatusEnum getStatus();
|
||||
void setStatus(PlayerStatusEnum status);
|
||||
PlayerStatusEnum getStatus() { return PlayerStatus; }
|
||||
void setStatus(PlayerStatusEnum _status) { PlayerStatus = _status; }
|
||||
void initConnection();
|
||||
int getPlayerId() const { return playerId; }
|
||||
void setPlayerId(int _id) { playerId = _id; }
|
||||
|
|
Loading…
Reference in a new issue