aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2022-07-31 19:33:10 +0300
committerGitHub <noreply@github.com>2022-07-31 11:33:10 -0500
commitdd8eee7eede02b71b86864b533eed4102f0c584e (patch)
tree48342cbaf1e1c94212d33342bb8ae33900566773 /include
parent4124a43674bdd9e85a55114158a725f61e139962 (diff)
Pending ghost messages (#736)
This feature allows text to be posted to the IC log as a "ghost" before it has been displayed in-game. When desync chat is enabled, it's common for the player to wait a little while before their messages are displayed. Ghosts only apply to the active player's messages, not all queued messages. They are also pinned at the end of the IC log until they are displayed. Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com> Co-authored-by: stonedDiscord <Tukz@gmx.de>
Diffstat (limited to 'include')
-rw-r--r--include/aoapplication.h4
-rw-r--r--include/courtroom.h15
-rw-r--r--include/datatypes.h2
3 files changed, 15 insertions, 6 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index 52b7673a..3b635410 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -107,8 +107,8 @@ public:
///////////////loading info///////////////////
- // player number, it's hardly used but might be needed for some old servers
- int s_pv = 0;
+ // client ID. Not useful, to be removed eventually
+ int client_id = 0;
QString server_software = "";
diff --git a/include/courtroom.h b/include/courtroom.h
index d981bffd..e8c4e004 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -245,10 +245,11 @@ public:
enum LogMode {
IO_ONLY,
DISPLAY_ONLY,
- DISPLAY_AND_IO
+ DISPLAY_AND_IO,
+ QUEUED,
};
// Log the message contents and information such as evidence presenting etc. into the log file, the IC log, or both.
- void log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", QString f_char = "", QString f_objection_mod = "", int f_evi_id = 0, int f_color = 0, LogMode f_log_mode=IO_ONLY);
+ void log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", QString f_char = "", QString f_objection_mod = "", int f_evi_id = 0, int f_color = 0, LogMode f_log_mode=IO_ONLY, bool sender = false);
// Log the message contents and information such as evidence presenting etc. into the IC logs
void handle_callwords();
@@ -292,7 +293,12 @@ public:
// 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, bool selfname = false, QDateTime timestamp = QDateTime::currentDateTime());
+ int color = 0, bool selfname = false, QDateTime timestamp = QDateTime::currentDateTime(),
+ bool ghost = false);
+
+ // clear sent messages that appear on the IC log but haven't been delivered
+ // yet to other players
+ void pop_ic_ghost();
// 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
@@ -485,6 +491,9 @@ private:
// amount by which we multiply the delay when we parse punctuation chars
const int punctuation_modifier = 3;
+ // amount of ghost blocks
+ int ghost_blocks = 0;
+
// Minumum and maximum number of parameters in the MS packet
static const int MS_MINIMUM = 15;
static const int MS_MAXIMUM = 30;
diff --git a/include/datatypes.h b/include/datatypes.h
index 3289bd86..d5d8551e 100644
--- a/include/datatypes.h
+++ b/include/datatypes.h
@@ -110,7 +110,7 @@ enum CHAT_MESSAGE {
FRAME_REALIZATION,
FRAME_SFX,
ADDITIVE,
- EFFECTS
+ EFFECTS,
};
enum EMOTE_MOD {