diff --git a/src/chat.rs b/src/chat.rs index 8c21c10..ce29041 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -48,6 +48,7 @@ pub const TOKEN_IF_INLINE: &str = "if "; // for lines like `- if foo:` pub const DEFAULT_SOUND: &str = "chat"; pub const MAX_BRANCH_DEPTH: usize = 64; +pub const ENABLE_CHOICE_TIMER: bool = false; pub const CHOICE_TIMER: f64 = 40.0 * var::DEFAULT_CHAT_SPEED as f64; pub const LETTERS_PER_SECOND: f32 = 17.0; pub const TALKER_SPEED_FACTOR: f32 = var::DEFAULT_CHAT_SPEED / LETTERS_PER_SECOND; @@ -770,11 +771,15 @@ pub fn handle_chat_events( ); } } - chat.timer = now - + ((message.len() as f32).max(CHAT_SPEED_MIN_LEN) - * TALKER_SPEED_FACTOR - * chat.talker.talking_speed - / settings.chat_speed) as f64; + if ENABLE_CHOICE_TIMER { + chat.timer = now + + ((message.len() as f32).max(CHAT_SPEED_MIN_LEN) + * TALKER_SPEED_FACTOR + * chat.talker.talking_speed + / settings.chat_speed) as f64; + } else { + chat.timer = f64::INFINITY; + } let sfx = audio::str2sfx(sound); ew_sfx.send(audio::PlaySfxEvent(sfx)); @@ -794,7 +799,7 @@ pub fn handle_chat_events( }, )); choice_key += 1; - if !nowait { + if ENABLE_CHOICE_TIMER && !nowait { chat.timer = now + CHOICE_TIMER / settings.chat_speed as f64; } }