BROKEN
This commit is contained in:
@@ -20,12 +20,13 @@
|
|||||||
#include "chattools.h"
|
#include "chattools.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
#include "sdlplayer.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
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;
|
break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (myNotifyMode) {
|
switch (myNotifyMode) {
|
||||||
@@ -76,8 +76,12 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
|
|||||||
break;
|
break;
|
||||||
default:;
|
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 Session;
|
||||||
class ConfigFile;
|
class ConfigFile;
|
||||||
|
class SDLPlayer;
|
||||||
|
|
||||||
class ChatTools : public QObject
|
class ChatTools : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
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();
|
~ChatTools();
|
||||||
|
|
||||||
@@ -67,6 +68,8 @@ private:
|
|||||||
Session *mySession;
|
Session *mySession;
|
||||||
int myNotifyMode; // 0 == no notification, 1 == bold notification, 2 == yellow notification
|
int myNotifyMode; // 0 == no notification, 1 == bold notification, 2 == yellow notification
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
|
SDLPlayer *mySDLPlayer;
|
||||||
|
QDialog *myParentDialog; //needed for visible check for audio-nick-notification
|
||||||
|
|
||||||
|
|
||||||
// friend class GuiWrapper;
|
// friend class GuiWrapper;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ using namespace std;
|
|||||||
|
|
||||||
LobbyChat::LobbyChat(gameLobbyDialogImpl* l, ConfigFile *c) : myLobby(l), myConfig(c)
|
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()
|
LobbyChat::~LobbyChat()
|
||||||
@@ -128,16 +128,7 @@ void LobbyChat::playerLeft(QString playerName)
|
|||||||
|
|
||||||
void LobbyChat::displayMessage(QString playerName, QString message) {
|
void LobbyChat::displayMessage(QString playerName, QString message) {
|
||||||
|
|
||||||
QString tempMsg;
|
myChatTools->receiveMessage(playerName, message);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LobbyChat::checkInputLength(QString string) {
|
void LobbyChat::checkInputLength(QString string) {
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
//Sound
|
||||||
|
mySDLPlayer = new SDLPlayer(myConfig);
|
||||||
|
|
||||||
//Player0 pixmapCardsLabel needs Myw
|
//Player0 pixmapCardsLabel needs Myw
|
||||||
pixmapLabel_card0b->setMyW(this);
|
pixmapLabel_card0b->setMyW(this);
|
||||||
pixmapLabel_card0a->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(signalIrcError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatError(int)));
|
||||||
connect(this, SIGNAL(signalIrcServerError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatServerError(int)));
|
connect(this, SIGNAL(signalIrcServerError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatServerError(int)));
|
||||||
|
|
||||||
//Sound
|
|
||||||
mySDLPlayer = new SDLPlayer(myConfig);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindowImpl::~mainWindowImpl() {
|
mainWindowImpl::~mainWindowImpl() {
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ class changeHumanPlayerNameDialogImpl;
|
|||||||
class gameLobbyDialogImpl;
|
class gameLobbyDialogImpl;
|
||||||
|
|
||||||
class QColor;
|
class QColor;
|
||||||
|
|
||||||
class SDLPlayer;
|
class SDLPlayer;
|
||||||
|
|
||||||
|
|
||||||
class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
|
class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user