aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2022-03-24 08:10:51 -0500
committerGitHub <noreply@github.com>2022-03-24 08:10:51 -0500
commit9dd1407103323c78e7b88499cf54c7b5ee77b0f4 (patch)
tree10e5927d6bc6b9454eabf86f7cd18c7a83db69ca
parentc3fd82eaccf009fc683ddebad57b9938e29c607a (diff)
parentd424020f420c0ebe8abdce08ec17eef2a7ad59fd (diff)
Merge pull request #674 from AttorneyOnline/pausechar
Add \p for "pause", which lasts 0.1 seconds
-rw-r--r--src/courtroom.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 603b2230..0afbeb24 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -3093,7 +3093,7 @@ QString Courtroom::filter_ic_text(QString p_text, bool html, int target_pos,
check_pos_escaped += appendage.size();
skip = true;
}
- if (f_character == "s" || f_character == "f") // screenshake/flash
+ if (f_character == "s" || f_character == "f" || f_character == "p") // screenshake/flash/pause
skip = true;
parse_escape_seq = false;
@@ -3561,6 +3561,7 @@ void Courtroom::chat_tick()
QTextBoundaryFinder tbf(QTextBoundaryFinder::Grapheme, f_rest);
QString f_character;
int f_char_length;
+ int msg_delay = 0;
tbf.toNextBoundary();
@@ -3620,6 +3621,10 @@ void Courtroom::chat_tick()
this->do_flash();
formatting_char = true;
}
+ if (f_character == "p")
+ {
+ formatting_char = true;
+ }
next_character_is_not_special = false;
}
@@ -3629,14 +3634,19 @@ void Courtroom::chat_tick()
else if (current_display_speed > 6)
current_display_speed = 6;
- int msg_delay = text_crawl * message_display_mult[current_display_speed];
+ if (msg_delay == 0)
+ msg_delay = text_crawl * message_display_mult[current_display_speed];
+
if ((msg_delay <= 0 &&
tick_pos < f_message.size() - 1) ||
formatting_char) {
- chat_tick_timer->start(0); // Don't bother rendering anything out as we're
- // doing the SPEED. (there's latency otherwise)
+ if (f_character == "p")
+ chat_tick_timer->start(100); // wait the pause lol
+ else
+ chat_tick_timer->start(0); // Don't bother rendering anything out as we're
+ // doing the SPEED. (there's latency otherwise)
if (!formatting_char || f_character == "n" || f_character == "f" ||
- f_character == "s")
+ f_character == "s" || f_character == "p")
real_tick_pos += f_char_length; // Adjust the tick position for the
// scrollbar convenience
}