From 35fcbdeea8a8297f69e2bb7e92526f88233c7b4f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 20 Mar 2022 01:21:24 +0300 Subject: Add showname and selfname colors to courtroom_fonts.ini (#672) Co-authored-by: oldmud0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- include/chatlogpiece.h | 20 +++++++++++--------- include/courtroom.h | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h index da78d0d..df6ccd0 100644 --- a/include/chatlogpiece.h +++ b/include/chatlogpiece.h @@ -10,17 +10,18 @@ class chatlogpiece { public: chatlogpiece(); chatlogpiece(QString p_name, QString p_showname, QString p_message, - QString p_action,int color); + QString p_action,int color, bool selfname); chatlogpiece(QString p_name, QString p_showname, QString p_message, - QString p_action, int color, QDateTime p_datetime); + QString p_action, int color, bool selfname, QDateTime p_datetime); - QString get_name(); - QString get_showname(); - QString get_message(); - QString get_action(); - QDateTime get_datetime(); - QString get_datetime_as_string(); - int get_chat_color(); + QString get_name() { return name; }; + QString get_showname() { return showname; }; + QString get_message() { return message; }; + QString get_action() { return action; }; + bool get_selfname() const { return selfname; }; + QDateTime get_datetime() { return datetime; }; + QString get_datetime_as_string() { return datetime.toString(); }; + int get_chat_color() const { return color; }; QString get_full(); private: @@ -28,6 +29,7 @@ private: QString showname; QString message; QString action; + bool selfname; QDateTime datetime; int color; }; diff --git a/include/courtroom.h b/include/courtroom.h index f230b35..bf688b5 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -279,14 +279,14 @@ public: int default_color = 0); void log_ic_text(QString p_name, QString p_showname, QString p_message, - QString p_action = "", int p_color = 0); + QString p_action = "", int p_color = 0, bool p_selfname = false); // adds text to the IC chatlog. p_name first as bold then p_text then a newlin // this function keeps the chatlog scrolled to the top unless there's text // selected // or the user isn't already scrolled to the top void append_ic_text(QString p_text, QString p_name = "", QString action = "", - int color = 0, QDateTime timestamp = QDateTime::currentDateTime()); + int color = 0, bool selfname = false, QDateTime timestamp = QDateTime::currentDateTime()); // prints who played the song to IC chat and plays said song(if found on local // filesystem) takes in a list where the first element is the song name and -- cgit