BROKEN
This commit is contained in:
@@ -20,12 +20,13 @@
|
||||
#include "chattools.h"
|
||||
#include "session.h"
|
||||
#include "configfile.h"
|
||||
#include "sdlplayer.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode, QTextBrowser *b, QTreeWidget *t) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myNotifyMode(notifyMode), myConfig(c)
|
||||
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode, QTextBrowser *b, QTreeWidget *t, SDLPlayer *s, QDialog *p) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myNotifyMode(notifyMode), myConfig(c), mySDLPlayer(s), myParentDialog(p)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -64,7 +65,6 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
}
|
||||
else {
|
||||
switch (myNotifyMode) {
|
||||
@@ -75,9 +75,13 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
|
||||
case 2: tempMsg = QString("<span style=\"color:#FFFFFF;\">"+message+"</span>");
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
}
|
||||
}
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
}
|
||||
if(myParentDialog) {
|
||||
if(myParentDialog->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification"))
|
||||
mySDLPlayer->playSound("lobbychatnotify",0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,13 +26,14 @@
|
||||
|
||||
class Session;
|
||||
class ConfigFile;
|
||||
class SDLPlayer;
|
||||
|
||||
class ChatTools : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode = 0, QTextBrowser *b = NULL, QTreeWidget *t = NULL );
|
||||
ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode = 0, QTextBrowser *b = NULL, QTreeWidget *t = NULL, SDLPlayer *s = NULL, QDialog *p = NULL );
|
||||
|
||||
~ChatTools();
|
||||
|
||||
@@ -67,6 +68,8 @@ private:
|
||||
Session *mySession;
|
||||
int myNotifyMode; // 0 == no notification, 1 == bold notification, 2 == yellow notification
|
||||
ConfigFile *myConfig;
|
||||
SDLPlayer *mySDLPlayer;
|
||||
QDialog *myParentDialog; //needed for visible check for audio-nick-notification
|
||||
|
||||
|
||||
// friend class GuiWrapper;
|
||||
|
||||
@@ -32,7 +32,7 @@ using namespace std;
|
||||
|
||||
LobbyChat::LobbyChat(gameLobbyDialogImpl* l, ConfigFile *c) : myLobby(l), myConfig(c)
|
||||
{
|
||||
myChatTools = new ChatTools(myLobby->lineEdit_ChatInput, myConfig, 1, myLobby->textBrowser_ChatDisplay, myLobby->treeWidget_NickList);
|
||||
myChatTools = new ChatTools(myLobby->lineEdit_ChatInput, myConfig, 1, myLobby->textBrowser_ChatDisplay, myLobby->treeWidget_NickList, myLobby->getMyW()->getMySDLPlayer(), myLobby);
|
||||
}
|
||||
|
||||
LobbyChat::~LobbyChat()
|
||||
@@ -128,16 +128,7 @@ void LobbyChat::playerLeft(QString playerName)
|
||||
|
||||
void LobbyChat::displayMessage(QString playerName, QString message) {
|
||||
|
||||
QString tempMsg;
|
||||
if(message.contains(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()), Qt::CaseInsensitive)) {
|
||||
tempMsg = QString("<b>"+message+"</b>");
|
||||
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification"))
|
||||
myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0);
|
||||
}
|
||||
else {
|
||||
tempMsg = message;
|
||||
}
|
||||
myLobby->textBrowser_ChatDisplay->append(playerName + ": " + tempMsg);
|
||||
myChatTools->receiveMessage(playerName, message);
|
||||
}
|
||||
|
||||
void LobbyChat::checkInputLength(QString string) {
|
||||
|
||||
@@ -78,6 +78,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||
|
||||
setupUi(this);
|
||||
|
||||
//Sound
|
||||
mySDLPlayer = new SDLPlayer(myConfig);
|
||||
|
||||
//Player0 pixmapCardsLabel needs Myw
|
||||
pixmapLabel_card0b->setMyW(this);
|
||||
pixmapLabel_card0a->setMyW(this);
|
||||
@@ -648,9 +651,6 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||
connect(this, SIGNAL(signalIrcError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatError(int)));
|
||||
connect(this, SIGNAL(signalIrcServerError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatServerError(int)));
|
||||
|
||||
//Sound
|
||||
mySDLPlayer = new SDLPlayer(myConfig);
|
||||
|
||||
}
|
||||
|
||||
mainWindowImpl::~mainWindowImpl() {
|
||||
|
||||
@@ -52,9 +52,9 @@ class changeHumanPlayerNameDialogImpl;
|
||||
class gameLobbyDialogImpl;
|
||||
|
||||
class QColor;
|
||||
|
||||
class SDLPlayer;
|
||||
|
||||
|
||||
class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user