aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/aoapplication.h11
-rw-r--r--include/aooptionsdialog.h6
-rw-r--r--include/courtroom.h59
3 files changed, 69 insertions, 7 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index a0121f28..0e003a81 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -166,6 +166,14 @@ public:
// Returns the value of default_blip in config.ini
int get_default_blip();
+ // Returns the value if objections interrupt and skip the message queue
+ // from the config.ini.
+ bool is_instant_objection_enabled();
+
+ // returns if log will show messages as-received, while viewport will parse according to the queue (Text Stay Time)
+ // from the config.ini
+ bool is_desyncrhonized_logs_enabled();
+
// Returns the value of whether Discord should be enabled on startup
// from the config.ini.
bool is_discord_enabled();
@@ -208,6 +216,9 @@ public:
// may contain, from config.ini.
int get_max_log_size();
+ // Current wait time between messages for the queue system
+ int stay_time();
+
// Returns whether the log should go upwards (new behaviour)
// or downwards (vanilla behaviour).
bool get_log_goes_downwards();
diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h
index 2e2d7b8a..93b66779 100644
--- a/include/aooptionsdialog.h
+++ b/include/aooptionsdialog.h
@@ -52,6 +52,12 @@ private:
QSpinBox *ui_log_margin_spinbox;
QLabel *ui_log_timestamp_lbl;
QCheckBox *ui_log_timestamp_cb;
+ QLabel *ui_stay_time_lbl;
+ QSpinBox *ui_stay_time_spinbox;
+ QLabel *ui_desync_logs_lbl;
+ QCheckBox *ui_desync_logs_cb;
+ QLabel *ui_instant_objection_lbl;
+ QCheckBox *ui_instant_objection_cb;
QLabel *ui_log_ic_actions_lbl;
QCheckBox *ui_log_ic_actions_cb;
QFrame *ui_log_names_divider;
diff --git a/include/courtroom.h b/include/courtroom.h
index a4245a7d..92b5a03c 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -41,6 +41,7 @@
#include <QTextBrowser>
#include <QTreeWidget>
#include <QVector>
+#include <QQueue>
#include <QBrush>
#include <QDebug>
@@ -217,12 +218,46 @@ public:
void append_server_chatmessage(QString p_name, QString p_message,
QString p_color);
- // these functions handle chatmessages sequentially.
- // The process itself is very convoluted and merits separate documentation
- // But the general idea is objection animation->pre animation->talking->idle
- void handle_chatmessage(QStringList *p_contents);
- void handle_chatmessage_2();
- void handle_chatmessage_3();
+ // Add the message packet to the stack
+ void chatmessage_enqueue(QStringList p_contents);
+
+ // Parse the chat message packet and unpack it into the m_chatmessage[ITEM] format
+ void unpack_chatmessage(QStringList p_contents);
+
+ // Log the message contents and information such as evidence presenting etc. into the log file
+ void log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", int f_color = 0);
+
+ // Display the message contents and information such as evidence presenting etc. in the IC logs
+ void display_log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", int f_color = 0);
+
+ // Log the message contents and information such as evidence presenting etc. into the IC logs
+ void handle_callwords();
+
+ // Handle the objection logic, if it's interrupting the currently parsing message.
+ // Returns true if this message has an objection, otherwise returns false. The result decides when to call handle_ic_message()
+ bool handle_objection();
+
+ // Display the evidence image box when presenting evidence in IC
+ void display_evidence_image();
+
+ // Handle the stuff that comes when the character appears on screen and starts animating (preanims etc.)
+ void handle_ic_message();
+
+ // Display the character.
+ void display_character();
+
+ // Display the character's pair if present.
+ void display_pair_character(QString other_charid, QString other_offset);
+
+ // Handle the emote modifier value and proceed through the logic accordingly.
+ void handle_emote_mod(int emote_mod, bool p_immediate);
+
+ // Initialize the chatbox image, showname shenanigans, custom chatboxes, etc.
+ void initialize_chatbox();
+
+ // Finally start displaying the chatbox we initialized, display the evidence, and play the talking or idle emote for the character.
+ // Callwords are also handled here.
+ void handle_ic_speaking();
// This function filters out the common CC inline text trickery, for appending
// to the IC chatlog.
@@ -315,6 +350,8 @@ private:
QVector<chatlogpiece> ic_chatlog_history;
+ QQueue<QStringList> chatmessage_queue;
+
// triggers ping_server() every 60 seconds
QTimer *keepalive_timer;
@@ -354,8 +391,14 @@ private:
// True, if the log should have a timestamp.
bool log_timestamp = false;
+ // How long in miliseconds should the objection wait before appearing.
+ int objection_threshold = 1500;
+
// delay before chat messages starts ticking
QTimer *text_delay_timer;
+
+ // delay before the next queue entry is going to be processed
+ QTimer *text_queue_timer;
// delay before sfx plays
QTimer *sfx_delay_timer;
@@ -701,7 +744,6 @@ private:
void refresh_evidence();
void set_evidence_page();
- void reset_ic();
void reset_ui();
void regenerate_ic_chatlog();
@@ -871,6 +913,9 @@ private slots:
void on_casing_clicked();
void ping_server();
+
+ // Proceed to parse the oldest chatmessage and remove it from the stack
+ void chatmessage_dequeue();
};
#endif // COURTROOM_H