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
This commit is contained in:
parent
07763c5ac0
commit
eb014a9778
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user