atrooney-online-2/include/aotextarea.h
oldmud0 ecfe6f2542 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.
2021-12-25 19:17:27 -06:00

27 lines
685 B
C++

#ifndef AOTEXTAREA_H
#define AOTEXTAREA_H
#include <QDebug>
#include <QRegExp>
#include <QScrollBar>
#include <QTextBrowser>
#include <QTextCursor>
class AOTextArea : public QTextBrowser {
public:
AOTextArea(QWidget *p_parent = nullptr);
void append_linked(QString p_message);
void append_chatmessage(QString p_name, QString p_message,
QString p_name_colour, QString p_color = QString());
void append_error(QString p_message);
private:
const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b");
void auto_scroll(QTextCursor old_cursor, int scrollbar_value,
bool is_scrolled_down);
};
#endif // AOTEXTAREA_H