atrooney-online-2/include/chatlogpiece.h
Crystalwarrior cef0ebc6eb
IC log rewrite (#259)
* Rewrite the IC Log code to drastically reduce code duplication and have both downward and upward mode in the same function
Regenerate the IC Log in set_widgets() function, making sure the maximum_blocks is accounted for and clearing the log to prepare for different log mode (upwards/downwards) if it's different from previous
Add placeholder text telling the user the direction in which the log will go
Remove useless first_message_sent global boolean, a remnant from a   w e a k e r   c o d e r m a n

* Add log_colors boolean to reduce color I/O happening in append_ic_text (optimization meme)
Clear the IC log when log_colors setting changes and reload theme is pressed
Fix https://github.com/AttorneyOnline/AO2-Client/issues/221

* Add configurable margin between IC log entries
Add configurable newline/singleline log mode
Options in settings for these

* Add optional timestamps

* Un-hardcode "played music" from the chatlogpiece and introduce the "action" argument so that "presented evidence" is fully supported now
Translate "has presented evidence"
Regenerate IC chatlog instead of clearing it, properly updating every element with the new configurations

* Go away *temp, code duplication making me shid and cry rn
Why is this not done in append_ic_text, or why isn't there a dedicated ic logging func aAAAaaaaAAAaa
Fix presenting evidence not being properly logged
Fix timestamp being UTC instead of local time (local time will not be as confusing)

* okok it was a joke a big ol bamboozle you got gnomed haha rick rolled beaned stickbugged
I did NOT copy paste code, no, I actually intended to fix copy pasted code all along. log_ic_text was always planned.

(Fix copypasted code for ic_chatlog_history and consolidate it into a single log_ic_text func)
2020-08-19 11:16:41 -05:00

36 lines
816 B
C++

#ifndef CHATLOGPIECE_H
#define CHATLOGPIECE_H
#include <QtWidgets/QApplication>
#include <QDateTime>
#include <QString>
class chatlogpiece {
Q_DECLARE_TR_FUNCTIONS(chatlogpiece)
public:
chatlogpiece();
chatlogpiece(QString p_name, QString p_showname, QString p_message,
QString p_action,int color);
chatlogpiece(QString p_name, QString p_showname, QString p_message,
QString p_action, int color, 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_full();
private:
QString name;
QString showname;
QString message;
QString action;
QDateTime datetime;
int color;
};
#endif // CHATLOGPIECE_H