aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/courtroom.h3
-rw-r--r--src/courtroom.cpp12
2 files changed, 9 insertions, 6 deletions
diff --git a/include/courtroom.h b/include/courtroom.h
index bf335814..d20c580b 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -336,7 +336,8 @@ private:
bool message_is_centered = false;
int current_display_speed = 3;
- int message_display_speed[7] = {5, 10, 25, 40, 50, 70, 90};
+ int base_display_speed = 40;
+ double message_display_mult[7] = {0.125, 0.25, 0.65, 1, 1.25, 1.75, 2.25};
// The character ID of the character this user wants to appear alongside with.
int other_charid = -1;
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index dcc3175c..0b42dae9 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -3415,7 +3415,8 @@ void Courtroom::chat_tick()
else if (current_display_speed > 6)
current_display_speed = 6;
- if ((message_display_speed[current_display_speed] <= 0 &&
+ int msg_delay = base_display_speed * 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
@@ -3459,7 +3460,7 @@ void Courtroom::chat_tick()
// And if it's faster than that:
// 40/10 = 4
b_rate =
- qMax(b_rate, qRound(static_cast<float>(message_display_speed[3]) /
+ qMax(b_rate, qRound(static_cast<float>(base_display_speed) /
msg_delay));
}
if (blip_ticker % b_rate == 0) {
@@ -3478,9 +3479,10 @@ void Courtroom::chat_tick()
// Punctuation delayer, only kicks in on speed ticks less than }}
if (current_display_speed > 1 && punctuation_chars.contains(f_character)) {
- // Making the user have to wait any longer than 150ms per letter is
- // downright unreasonable
- msg_delay = qMin(150, msg_delay * punctuation_modifier);
+ // Making the user have to wait any longer than 1.5 of the slowest speed
+ // is downright unreasonable
+ int max_delay = base_display_speed * message_display_mult[6] * 1.5;
+ msg_delay = qMin(max_delay, msg_delay * punctuation_modifier);
}
// If this color is talking