aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Attorney_Online_remake.pro6
-rw-r--r--aotextarea.cpp6
-rw-r--r--aotextarea.h14
-rw-r--r--courtroom.cpp6
4 files changed, 28 insertions, 4 deletions
diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro
index 5e988c8c..0c9ed9d1 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 00000000..1cffd258
--- /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 00000000..b5a2e0df
--- /dev/null
+++ b/aotextarea.h
@@ -0,0 +1,14 @@
+#ifndef AOTEXTAREA_H
+#define AOTEXTAREA_H
+
+#include <QTextBrowser>
+
+class AOTextArea : public QTextBrowser
+{
+public:
+ AOTextArea();
+
+ append_text();
+};
+
+#endif // AOTEXTAREA_H
diff --git a/courtroom.cpp b/courtroom.cpp
index 1a2eb7c0..db2ab069 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -9,6 +9,7 @@
#include <QDebug>
#include <QScrollBar>
+#include <QRegExp>
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("<a href=\"" + i_word + "\">" + i_word + "</a> ");
}
else