From eb014a97785db4a196d41fb38ee61612a54e0f6e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 5 Dec 2019 22:46:26 +0300 Subject: Add a message delay modifier when punctuation is reached to simulate Ace Attorney 1 chat parsing (replicating the effect where characters would make a short pause, as if saying the line out loud) TODO: Make this a configurable thing --- src/courtroom.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/courtroom.cpp') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 0695fe7c..f4f513a2 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); } } -- cgit