diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro index 5e988c8..0c9ed9d 100644 --- a/Attorney_Online_remake.pro +++ b/Attorney_Online_remake.pro @@ -43,7 +43,8 @@ SOURCES += main.cpp\ aoblipplayer.cpp \ evidence.cpp \ aoevidencebutton.cpp \ - charselect.cpp + charselect.cpp \ + aotextarea.cpp HEADERS += lobby.h \ aoimage.h \ @@ -68,7 +69,8 @@ HEADERS += lobby.h \ aosfxplayer.h \ aomusicplayer.h \ aoblipplayer.h \ - aoevidencebutton.h + aoevidencebutton.h \ + aotextarea.h unix:LIBS += -L$$PWD -lbass win32:LIBS += "$$PWD/bass.dll" diff --git a/aotextarea.cpp b/aotextarea.cpp new file mode 100644 index 0000000..1cffd25 --- /dev/null +++ b/aotextarea.cpp @@ -0,0 +1,6 @@ +#include "aotextarea.h" + +AOTextArea::AOTextArea() +{ + +} diff --git a/aotextarea.h b/aotextarea.h new file mode 100644 index 0000000..b5a2e0d --- /dev/null +++ b/aotextarea.h @@ -0,0 +1,14 @@ +#ifndef AOTEXTAREA_H +#define AOTEXTAREA_H + +#include + +class AOTextArea : public QTextBrowser +{ +public: + AOTextArea(); + + append_text(); +}; + +#endif // AOTEXTAREA_H diff --git a/courtroom.cpp b/courtroom.cpp index 1a2eb7c..db2ab06 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -9,6 +9,7 @@ #include #include +#include Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() { @@ -774,13 +775,14 @@ void Courtroom::append_server_chatmessage(QString f_name, QString f_message) ui_server_chatlog->insertPlainText(f_name + ": "); - QStringList word_list = f_message.split(" "); + QRegExp split_rx("(\\ |\\n)"); + QStringList word_list = f_message.split(split_rx); for (QString i_word : word_list) { if (i_word.startsWith("http")) { - i_word.replace("\n", "").replace("\r", ""); + i_word.replace("\r", ""); ui_server_chatlog->insertHtml("" + i_word + " "); } else