From ecfe6f2542d73e9559b75a502f6eebffe63a76cf Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 25 Dec 2021 19:17:27 -0600 Subject: Change master chat in courtroom to debug log Since the MS chat has been disabled for quite some time now (and we aren't planning on bringing it back since Discord, Guilded etc. have better chat features), I decided to go ahead and change the pane into a debug log to keep it useful and avoid creating a gaping hole in themes. Though, maybe it is worth removing the whole switcher and keeping the debug log hidden away where it can't scare people. --- src/aotextarea.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/aotextarea.cpp') diff --git a/src/aotextarea.cpp b/src/aotextarea.cpp index 52e32f55..3513d221 100644 --- a/src/aotextarea.cpp +++ b/src/aotextarea.cpp @@ -11,7 +11,7 @@ void AOTextArea::append_linked(QString p_message) } void AOTextArea::append_chatmessage(QString p_name, QString p_message, - QString p_colour) + QString p_name_colour, QString p_color) { const QTextCursor old_cursor = this->textCursor(); const int old_scrollbar_value = this->verticalScrollBar()->value(); @@ -21,15 +21,22 @@ void AOTextArea::append_chatmessage(QString p_name, QString p_message, this->moveCursor(QTextCursor::End); this->append(""); - this->insertHtml("" + p_name.toHtmlEscaped() + - ": "); + if (!p_name.isEmpty()) { + this->insertHtml("" + p_name.toHtmlEscaped() + + ": "); + + // cheap workarounds ahoy + p_message += " "; + } - // cheap workarounds ahoy - p_message += " "; QString result = p_message.toHtmlEscaped() .replace("\n", "
") .replace(url_parser_regex, "\\1"); + if (!p_color.isEmpty()) { + result = "" + result + ""; + } + this->insertHtml(result); this->auto_scroll(old_cursor, old_scrollbar_value, is_scrolled_down); -- cgit