improved banning; added [url] and [card] tags for chat

This commit is contained in:
Max-Wilhelm Bruker 2011-06-25 21:21:19 +02:00
parent 4b84168bda
commit 05ebb83ba4
36 changed files with 2501 additions and 2073 deletions

View file

@ -5,8 +5,6 @@
#include <QAction>
#include <QMessageBox>
#include <QFileDialog>
#include <QApplication>
#include <QDesktopWidget>
#include "tab_game.h"
#include "cardinfowidget.h"
#include "playerlistwidget.h"
@ -160,8 +158,8 @@ void DeckViewContainer::setDeck(DeckList *deck)
readyStartButton->setEnabled(true);
}
TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_clients, int _gameId, const QString &_gameDescription, int _localPlayerId, bool _spectator, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, bool _resuming)
: Tab(_tabSupervisor), clients(_clients), gameId(_gameId), gameDescription(_gameDescription), localPlayerId(_localPlayerId), spectator(_spectator), spectatorsCanTalk(_spectatorsCanTalk), spectatorsSeeEverything(_spectatorsSeeEverything), started(false), resuming(_resuming), currentPhase(-1), infoPopup(0)
TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_clients, int _gameId, const QString &_gameDescription, int _localPlayerId, const QString &_userName, bool _spectator, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, bool _resuming)
: Tab(_tabSupervisor), clients(_clients), gameId(_gameId), gameDescription(_gameDescription), localPlayerId(_localPlayerId), spectator(_spectator), spectatorsCanTalk(_spectatorsCanTalk), spectatorsSeeEverything(_spectatorsSeeEverything), started(false), resuming(_resuming), currentPhase(-1)
{
phasesToolbar = new PhasesToolbar;
phasesToolbar->hide();
@ -178,7 +176,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
timeElapsedLabel = new QLabel;
timeElapsedLabel->setAlignment(Qt::AlignCenter);
messageLog = new MessageLogWidget;
messageLog = new MessageLogWidget(_userName);
connect(messageLog, SIGNAL(cardNameHovered(QString)), cardInfo, SLOT(setCard(QString)));
connect(messageLog, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString)));
connect(messageLog, SIGNAL(deleteCardInfoPopup()), this, SLOT(deleteCardInfoPopup()));
@ -779,24 +777,3 @@ Player *TabGame::getActiveLocalPlayer() const
return 0;
}
void TabGame::showCardInfoPopup(const QPoint &pos, const QString &cardName)
{
infoPopup = new CardInfoWidget(CardInfoWidget::ModePopUp, 0, Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
infoPopup->setAttribute(Qt::WA_TransparentForMouseEvents);
infoPopup->setCard(cardName);
QRect screenRect = qApp->desktop()->screenGeometry(this);
infoPopup->move(
qMax(screenRect.left(), qMin(pos.x() - infoPopup->width() / 2, screenRect.left() + screenRect.width() - infoPopup->width())),
qMax(screenRect.top(), qMin(pos.y() - infoPopup->height() / 2, screenRect.top() + screenRect.height() - infoPopup->height()))
);
infoPopup->show();
}
void TabGame::deleteCardInfoPopup()
{
if (infoPopup) {
infoPopup->deleteLater();
infoPopup = 0;
}
}