mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
removed the need to refresh the game list
This commit is contained in:
parent
197bf0dc64
commit
c00027f988
21 changed files with 211 additions and 215 deletions
|
|
@ -9,20 +9,32 @@ CardInfoWidget::CardInfoWidget(CardDatabase *_db, QWidget *parent)
|
|||
cardPicture = new QLabel();
|
||||
cardPicture->setAlignment(Qt::AlignCenter);
|
||||
|
||||
QFont f;
|
||||
f.setPointSize(9);
|
||||
|
||||
nameLabel1 = new QLabel(tr("Name:"));
|
||||
nameLabel1->setFont(f);
|
||||
nameLabel2 = new QLabel();
|
||||
nameLabel2->setWordWrap(true);
|
||||
nameLabel2->setFont(f);
|
||||
manacostLabel1 = new QLabel(tr("Mana cost:"));
|
||||
manacostLabel1->setFont(f);
|
||||
manacostLabel2 = new QLabel();
|
||||
manacostLabel2->setFont(f);
|
||||
manacostLabel2->setWordWrap(true);
|
||||
cardtypeLabel1 = new QLabel(tr("Card type:"));
|
||||
cardtypeLabel1->setFont(f);
|
||||
cardtypeLabel2 = new QLabel();
|
||||
cardtypeLabel2->setFont(f);
|
||||
cardtypeLabel2->setWordWrap(true);
|
||||
powtoughLabel1 = new QLabel(tr("P / T:"));
|
||||
powtoughLabel1->setFont(f);
|
||||
powtoughLabel2 = new QLabel();
|
||||
powtoughLabel2->setFont(f);
|
||||
|
||||
textLabel = new QTextEdit();
|
||||
textLabel->setReadOnly(true);
|
||||
textLabel->setFont(f);
|
||||
|
||||
QGridLayout *grid = new QGridLayout(this);
|
||||
grid->addWidget(cardPicture, 0, 0, 1, 2);
|
||||
|
|
@ -36,8 +48,11 @@ CardInfoWidget::CardInfoWidget(CardDatabase *_db, QWidget *parent)
|
|||
grid->addWidget(powtoughLabel2, 4, 1);
|
||||
grid->addWidget(textLabel, 5, 0, -1, 2);
|
||||
grid->setRowStretch(5, 1);
|
||||
grid->setColumnStretch(1, 1);
|
||||
|
||||
setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||
setCard(db->getCard());
|
||||
setFixedSize(sizeHint());
|
||||
}
|
||||
|
||||
void CardInfoWidget::setCard(CardInfo *card)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void Client::readLine()
|
|||
QStringList values = line.split("|");
|
||||
QString prefix = values.takeFirst();
|
||||
// prefix is one of {welcome, private, public, resp, list_games, list_players, list_counters, list_zones, dump_zone}
|
||||
if (!(prefix.compare("private") && prefix.compare("public"))) {
|
||||
if ((prefix == "private") || (prefix == "public")) {
|
||||
ServerEventData event(line);
|
||||
if (event.getEventType() == eventPlayerId) {
|
||||
QStringList data = event.getEventData();
|
||||
|
|
@ -76,7 +76,7 @@ void Client::readLine()
|
|||
emit playerIdReceived(id, data[1]);
|
||||
} else
|
||||
emit gameEvent(event);
|
||||
} else if (!prefix.compare("resp")) {
|
||||
} else if (prefix == "resp") {
|
||||
bool ok;
|
||||
int msgid = values.takeFirst().toInt(&ok);
|
||||
if (!ok) {
|
||||
|
|
@ -110,16 +110,12 @@ void Client::readLine()
|
|||
qDebug(QString("msgid unknown: %1").arg(msgid).toLatin1());
|
||||
|
||||
emit responseReceived(new ServerResponse(msgid, ok, message));
|
||||
} else if (!(prefix.compare("list_games")
|
||||
&& prefix.compare("list_players")
|
||||
&& prefix.compare("list_counters")
|
||||
&& prefix.compare("list_zones")
|
||||
&& prefix.compare("dump_zone")
|
||||
&& prefix.compare("welcome"))) {
|
||||
} else if (prefix == "list_games") {
|
||||
emit gameListEvent(new ServerGame(values[0].toInt(), values[5], values[1], values[2].toInt(), values[3].toInt(), values[4].toInt()));
|
||||
} else if ((prefix == "list_players") || (prefix == "list_counters") || (prefix == "list_zones") || (prefix == "dump_zone") || (prefix == "welcome")) {
|
||||
int cmdid = values.takeFirst().toInt();
|
||||
if (!values[0].compare(".")) {
|
||||
if (values[0] == ".") {
|
||||
QListIterator<QStringList> i(msgbuf);
|
||||
QList<ServerGame *> gamelist;
|
||||
QList<ServerPlayer *> playerlist;
|
||||
QList<ServerZone *> zonelist;
|
||||
QList<ServerZoneCard *> zonedump;
|
||||
|
|
@ -128,9 +124,7 @@ void Client::readLine()
|
|||
QStringList val = i.next();
|
||||
|
||||
// XXX Parametergültigkeit überprüfen
|
||||
if (!prefix.compare("list_games"))
|
||||
gamelist << new ServerGame(val[0].toInt(), val[5], val[1], val[2].toInt(), val[3].toInt(), val[4].toInt());
|
||||
else if (!prefix.compare("list_players"))
|
||||
if (!prefix.compare("list_players"))
|
||||
playerlist << new ServerPlayer(val[0].toInt(), val[1]);
|
||||
else if (!prefix.compare("list_counters"))
|
||||
{ }
|
||||
|
|
@ -141,9 +135,7 @@ void Client::readLine()
|
|||
else if (!prefix.compare("welcome"))
|
||||
welcomemsg << val[0];
|
||||
}
|
||||
if (!prefix.compare("list_games"))
|
||||
emit gameListReceived(gamelist);
|
||||
else if (!prefix.compare("list_players"))
|
||||
if (!prefix.compare("list_players"))
|
||||
emit playerListReceived(playerlist);
|
||||
else if (!prefix.compare("list_counters"))
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Client : public QObject {
|
|||
signals:
|
||||
void statusChanged(ProtocolStatus _status);
|
||||
void welcomeMsgReceived(QStringList welcomeMsg);
|
||||
void gameListReceived(QList<ServerGame *> games);
|
||||
void gameListEvent(ServerGame *game);
|
||||
void playerListReceived(QList<ServerPlayer *> players);
|
||||
void zoneListReceived(int commandId, QList<ServerZone *> zones);
|
||||
void zoneDumpReceived(int commandId, QList<ServerZoneCard *> cards);
|
||||
|
|
|
|||
|
|
@ -5,34 +5,29 @@
|
|||
DlgGames::DlgGames(Client *_client, QWidget *parent)
|
||||
: QDialog(parent), client(_client), msgid(0)
|
||||
{
|
||||
tableView = new QTreeView;
|
||||
tableModel = new GamesModel(this);
|
||||
tableView->setModel(tableModel);
|
||||
gameListView = new QTreeView;
|
||||
gameListModel = new GamesModel(this);
|
||||
gameListView->setModel(gameListModel);
|
||||
|
||||
createButton = new QPushButton(tr("&Create"));
|
||||
refreshButton = new QPushButton(tr("&Refresh"));
|
||||
joinButton = new QPushButton(tr("&Join"));
|
||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||
buttonLayout->addStretch();
|
||||
buttonLayout->addWidget(createButton);
|
||||
buttonLayout->addStretch();
|
||||
buttonLayout->addWidget(refreshButton);
|
||||
buttonLayout->addStretch();
|
||||
buttonLayout->addWidget(joinButton);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(tableView);
|
||||
mainLayout->addWidget(gameListView);
|
||||
mainLayout->addLayout(buttonLayout);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
setWindowTitle(tr("Games"));
|
||||
|
||||
setMinimumWidth(tableView->columnWidth(0) * tableModel->columnCount());
|
||||
setMinimumWidth(gameListView->columnWidth(0) * gameListModel->columnCount());
|
||||
connect(createButton, SIGNAL(clicked()), this, SLOT(actCreate()));
|
||||
connect(refreshButton, SIGNAL(clicked()), this, SLOT(actRefresh()));
|
||||
connect(joinButton, SIGNAL(clicked()), this, SLOT(actJoin()));
|
||||
|
||||
connect(client, SIGNAL(gameListReceived(QList<ServerGame *>)), this, SLOT(gameListReceived(QList<ServerGame *>)));
|
||||
connect(client, SIGNAL(gameListEvent(ServerGame *)), gameListModel, SLOT(updateGameList(ServerGame *)));
|
||||
client->listGames();
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +61,7 @@ void DlgGames::actJoin()
|
|||
if (msgid)
|
||||
return;
|
||||
|
||||
ServerGame *game = tableModel->getGame(tableView->currentIndex().row());
|
||||
ServerGame *game = gameListModel->getGame(gameListView->currentIndex().row());
|
||||
QString password;
|
||||
if (game->getHasPassword()) {
|
||||
bool ok;
|
||||
|
|
@ -78,8 +73,3 @@ void DlgGames::actJoin()
|
|||
connect(client, SIGNAL(responseReceived(ServerResponse *)), this, SLOT(checkResponse(ServerResponse *)));
|
||||
msgid = client->joinGame(game->getGameId(), password);
|
||||
}
|
||||
|
||||
void DlgGames::gameListReceived(QList<ServerGame *> _gameList)
|
||||
{
|
||||
tableModel->setGameList(_gameList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@ private slots:
|
|||
void actCreate();
|
||||
void actRefresh();
|
||||
void actJoin();
|
||||
void gameListReceived(QList<ServerGame *> _gameList);
|
||||
void checkResponse(ServerResponse *response);
|
||||
private:
|
||||
Client *client;
|
||||
int msgid;
|
||||
|
||||
QTreeView *tableView;
|
||||
GamesModel *tableModel;
|
||||
QTreeView *gameListView;
|
||||
GamesModel *gameListModel;
|
||||
QPushButton *refreshButton, *createButton, *joinButton;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a
|
|||
connect(aDraw, SIGNAL(triggered()), this, SLOT(actDrawCard()));
|
||||
aDrawCards = new QAction(tr("D&raw cards..."), this);
|
||||
connect(aDrawCards, SIGNAL(triggered()), this, SLOT(actDrawCards()));
|
||||
aDrawCards->setShortcut(tr("Ctrl+C"));
|
||||
aDrawCards->setShortcut(tr("Ctrl+E"));
|
||||
aRollDice = new QAction(tr("R&oll dice..."), this);
|
||||
aRollDice->setShortcut(tr("Ctrl+I"));
|
||||
connect(aRollDice, SIGNAL(triggered()), this, SLOT(actRollDice()));
|
||||
|
|
|
|||
|
|
@ -6,32 +6,19 @@ GamesModel::~GamesModel()
|
|||
cleanList();
|
||||
}
|
||||
|
||||
int GamesModel::rowCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return gameList.size();
|
||||
}
|
||||
|
||||
int GamesModel::columnCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
QVariant GamesModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
if ((role != Qt::DisplayRole) || !index.isValid())
|
||||
return QVariant();
|
||||
if ((index.row() >= gameList.size()) || (index.column() >= columnCount()))
|
||||
return QVariant();
|
||||
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
ServerGame *g = gameList.at(index.row());
|
||||
switch (index.column()) {
|
||||
case 0: return g->getGameId();
|
||||
case 1: return g->getCreator();
|
||||
case 2: return g->getDescription();
|
||||
case 3: return QString(g->getHasPassword() ? "yes" : "no");
|
||||
case 3: return QString(g->getHasPassword() ? tr("yes") : tr("no"));
|
||||
case 4: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers());
|
||||
default: return QVariant();
|
||||
}
|
||||
|
|
@ -39,16 +26,14 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
|
|||
|
||||
QVariant GamesModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
if (orientation != Qt::Horizontal)
|
||||
if ((role != Qt::DisplayRole) || (orientation != Qt::Horizontal))
|
||||
return QVariant();
|
||||
switch (section) {
|
||||
case 0: return QString("Game ID");
|
||||
case 1: return QString("Creator");
|
||||
case 2: return QString("Description");
|
||||
case 3: return QString("Password");
|
||||
case 4: return QString("Players");
|
||||
case 0: return tr("Game ID");
|
||||
case 1: return tr("Creator");
|
||||
case 2: return tr("Description");
|
||||
case 3: return tr("Password");
|
||||
case 4: return tr("Players");
|
||||
default: return QVariant();
|
||||
}
|
||||
}
|
||||
|
|
@ -60,11 +45,26 @@ ServerGame *GamesModel::getGame(int row)
|
|||
return gameList[row];
|
||||
}
|
||||
|
||||
void GamesModel::setGameList(const QList<ServerGame *> &_gameList)
|
||||
void GamesModel::updateGameList(ServerGame *game)
|
||||
{
|
||||
cleanList();
|
||||
gameList = _gameList;
|
||||
reset();
|
||||
for (int i = 0; i < gameList.size(); i++)
|
||||
if (gameList[i]->getGameId() == game->getGameId()) {
|
||||
if ((game->getPlayerCount() == 0) || (game->getPlayerCount() == game->getMaxPlayers())) {
|
||||
beginRemoveRows(QModelIndex(), i, i);
|
||||
delete gameList.takeAt(i);
|
||||
endRemoveRows();
|
||||
} else {
|
||||
delete gameList[i];
|
||||
gameList[i] = game;
|
||||
emit dataChanged(index(i, 0), index(i, 4));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((game->getPlayerCount() == 0) || (game->getPlayerCount() == game->getMaxPlayers()))
|
||||
return;
|
||||
beginInsertRows(QModelIndex(), gameList.size(), gameList.size());
|
||||
gameList << game;
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
void GamesModel::cleanList()
|
||||
|
|
|
|||
|
|
@ -5,19 +5,19 @@
|
|||
#include <QList>
|
||||
#include "servergame.h"
|
||||
|
||||
class GamesModel : public QAbstractListModel {
|
||||
class GamesModel : public QAbstractTableModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
GamesModel(QObject *parent = 0)
|
||||
: QAbstractListModel(parent) { }
|
||||
GamesModel(QObject *parent = 0) : QAbstractTableModel(parent) { }
|
||||
~GamesModel();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const { return parent.isValid() ? 0 : gameList.size(); }
|
||||
int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return 5; }
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void setGameList(const QList<ServerGame *> &_gameList);
|
||||
ServerGame *getGame(int row);
|
||||
public slots:
|
||||
void updateGameList(ServerGame *game);
|
||||
private:
|
||||
QList<ServerGame *> gameList;
|
||||
void cleanList();
|
||||
|
|
|
|||
|
|
@ -2,34 +2,28 @@
|
|||
#include "game.h"
|
||||
#include <QScrollBar>
|
||||
|
||||
void MessageLogWidget::appendAndScroll(const QString &s)
|
||||
{
|
||||
append(s);
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
void MessageLogWidget::logConnecting(QString hostname)
|
||||
{
|
||||
appendAndScroll(tr("Connecting to %1...").arg(hostname));
|
||||
append(tr("Connecting to %1...").arg(hostname));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logConnected(const QStringList WelcomeMsg)
|
||||
{
|
||||
appendAndScroll(tr("Connected."));
|
||||
append(tr("Connected."));
|
||||
|
||||
QStringListIterator i(WelcomeMsg);
|
||||
while (i.hasNext())
|
||||
appendAndScroll(i.next());
|
||||
append(i.next());
|
||||
}
|
||||
|
||||
void MessageLogWidget::logDisconnected()
|
||||
{
|
||||
appendAndScroll(tr("Disconnected from server."));
|
||||
append(tr("Disconnected from server."));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSocketError(const QString &errorString)
|
||||
{
|
||||
appendAndScroll(errorString);
|
||||
append(errorString);
|
||||
}
|
||||
|
||||
void MessageLogWidget::logPlayerListReceived(QStringList players)
|
||||
|
|
@ -38,96 +32,96 @@ void MessageLogWidget::logPlayerListReceived(QStringList players)
|
|||
append(tr("You have joined the game. Player list:"));
|
||||
for (int i = 0; i < players.size(); i++)
|
||||
append(players.at(i));
|
||||
appendAndScroll("---");
|
||||
append("---");
|
||||
}
|
||||
|
||||
void MessageLogWidget::logJoin(QString playerName)
|
||||
{
|
||||
appendAndScroll(tr("%1 has joined the game").arg(playerName));
|
||||
append(tr("%1 has joined the game").arg(playerName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logLeave(QString playerName)
|
||||
{
|
||||
appendAndScroll(tr("%1 has left the game").arg(playerName));
|
||||
append(tr("%1 has left the game").arg(playerName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logReadyStart(QString playerName)
|
||||
{
|
||||
appendAndScroll(tr("%1 is ready to start a new game.").arg(playerName));
|
||||
append(tr("%1 is ready to start a new game.").arg(playerName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logGameStart()
|
||||
{
|
||||
appendAndScroll(tr("Game has started."));
|
||||
append(tr("Game has started."));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSay(QString playerName, QString message)
|
||||
{
|
||||
appendAndScroll(QString("<font color=\"red\">%1:</font> %2").arg(playerName).arg(message));
|
||||
append(QString("<font color=\"red\">%1:</font> %2").arg(playerName).arg(message));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logShuffle(QString playerName)
|
||||
{
|
||||
appendAndScroll(tr("%1 shuffles his/her library").arg(playerName));
|
||||
append(tr("%1 shuffles his/her library").arg(playerName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logRollDice(QString playerName, int sides, int roll)
|
||||
{
|
||||
appendAndScroll(tr("%1 rolled a %2 with a %3-sided dice").arg(playerName).arg(roll).arg(sides));
|
||||
append(tr("%1 rolled a %2 with a %3-sided dice").arg(playerName).arg(roll).arg(sides));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logDraw(QString playerName, int number)
|
||||
{
|
||||
if (number == 1)
|
||||
appendAndScroll(tr("%1 draws a card").arg(playerName));
|
||||
append(tr("%1 draws a card").arg(playerName));
|
||||
else
|
||||
appendAndScroll(tr("%1 draws %2 cards").arg(playerName).arg(number));
|
||||
append(tr("%1 draws %2 cards").arg(playerName).arg(number));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logMoveCard(QString playerName, QString cardName, QString startZone, QString targetZone)
|
||||
{
|
||||
appendAndScroll(tr("%1 moves %2 from %3 to %4").arg(playerName).arg(cardName).arg(startZone).arg(targetZone));
|
||||
append(tr("%1 moves %2 from %3 to %4").arg(playerName).arg(cardName).arg(startZone).arg(targetZone));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logCreateToken(QString playerName, QString cardName)
|
||||
{
|
||||
appendAndScroll(tr("%1 creates token: %2").arg(playerName).arg(cardName));
|
||||
append(tr("%1 creates token: %2").arg(playerName).arg(cardName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSetCardCounters(QString playerName, QString cardName, int value, int oldValue)
|
||||
{
|
||||
if (value > oldValue)
|
||||
appendAndScroll(tr("%1 places %2 counters on %3 (now %4)").arg(playerName).arg(value - oldValue).arg(cardName).arg(value));
|
||||
append(tr("%1 places %2 counters on %3 (now %4)").arg(playerName).arg(value - oldValue).arg(cardName).arg(value));
|
||||
else
|
||||
appendAndScroll(tr("%1 removes %2 counters from %3 (now %4)").arg(playerName).arg(oldValue - value).arg(cardName).arg(value));
|
||||
append(tr("%1 removes %2 counters from %3 (now %4)").arg(playerName).arg(oldValue - value).arg(cardName).arg(value));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSetTapped(QString playerName, QString cardName, bool tapped)
|
||||
{
|
||||
if (cardName == "-1")
|
||||
cardName = tr("his permanents");
|
||||
appendAndScroll(tr("%1 %2 %3").arg(playerName).arg(tapped ? "taps" : "untaps").arg(cardName));
|
||||
append(tr("%1 %2 %3").arg(playerName).arg(tapped ? "taps" : "untaps").arg(cardName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSetCounter(QString playerName, QString counterName, int value, int oldValue)
|
||||
{
|
||||
appendAndScroll(tr("%1 sets counter \"%2\" to %3 (%4%5)").arg(playerName).arg(counterName).arg(value).arg(value > oldValue ? "+" : "").arg(value - oldValue));
|
||||
append(tr("%1 sets counter \"%2\" to %3 (%4%5)").arg(playerName).arg(counterName).arg(value).arg(value > oldValue ? "+" : "").arg(value - oldValue));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSetDoesntUntap(QString playerName, QString cardName, bool doesntUntap)
|
||||
{
|
||||
if (doesntUntap)
|
||||
appendAndScroll(tr("%1 sets %2 to not untap normally.").arg(playerName).arg(cardName));
|
||||
append(tr("%1 sets %2 to not untap normally.").arg(playerName).arg(cardName));
|
||||
else
|
||||
appendAndScroll(tr("%1 sets %2 to untap normally.").arg(playerName).arg(cardName));
|
||||
append(tr("%1 sets %2 to untap normally.").arg(playerName).arg(cardName));
|
||||
}
|
||||
|
||||
void MessageLogWidget::logDumpZone(QString playerName, QString zoneName, QString zoneOwner, int numberCards)
|
||||
{
|
||||
if (numberCards)
|
||||
appendAndScroll(tr("%1 is looking at the top %2 cards of %3's %4").arg(playerName).arg(numberCards).arg(zoneOwner).arg(zoneName));
|
||||
append(tr("%1 is looking at the top %2 cards of %3's %4").arg(playerName).arg(numberCards).arg(zoneOwner).arg(zoneName));
|
||||
else
|
||||
appendAndScroll(tr("%1 is looking at %2's %3").arg(playerName).arg(zoneOwner).arg(zoneName));
|
||||
append(tr("%1 is looking at %2's %3").arg(playerName).arg(zoneOwner).arg(zoneName));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -155,4 +149,7 @@ MessageLogWidget::MessageLogWidget(QWidget *parent)
|
|||
: QTextEdit(parent)
|
||||
{
|
||||
setReadOnly(true);
|
||||
QFont f;
|
||||
f.setPointSize(9);
|
||||
setFont(f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ private slots:
|
|||
void logSetCounter(QString playerName, QString counterName, int value, int oldValue);
|
||||
void logSetDoesntUntap(QString playerName, QString cardName, bool doesntUntap);
|
||||
void logDumpZone(QString playerName, QString zoneName, QString zoneOwner, int numberCards);
|
||||
private:
|
||||
void appendAndScroll(const QString &s);
|
||||
public:
|
||||
void connectToGame(Game *game);
|
||||
MessageLogWidget(QWidget *parent = 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue