diff --git a/include/courtroom.h b/include/courtroom.h index ea84122..6bca28e 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -332,6 +332,12 @@ private: //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms const int wtce_stay_time = 1500; + //characters we consider punctuation + const QString punctuation_chars = ".,?!:;"; + + //amount by which we multiply the delay when we parse punctuation chars + const int punctuation_modifier = 3; + static const int chatmessage_size = 30; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 0695fe7..f4f513a 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2638,6 +2638,7 @@ void Courtroom::chat_tick() } else { + int msg_delay = message_display_speed[current_display_speed]; //Do the colors, gradual showing, etc. in here ui_vp_message->setHtml(additive_previous + filter_ic_text(f_message, true, tick_pos, m_chatmessage[TEXT_COLOR].toInt())); @@ -2667,6 +2668,12 @@ void Courtroom::chat_tick() ++blip_ticker; } + //Punctuation delayer + if (punctuation_chars.contains(f_character)) + { + msg_delay *= punctuation_modifier; + } + //If this color is talking if (color_is_talking && anim_state != 2 && anim_state < 4) //Set it to talking as we're not on that already (though we have to avoid interrupting a non-interrupted preanim) { @@ -2681,7 +2688,7 @@ void Courtroom::chat_tick() anim_state = 3; } //Continue ticking - chat_tick_timer->start(message_display_speed[current_display_speed]); + chat_tick_timer->start(msg_delay); } }