diff --git a/src/chat.rs b/src/chat.rs index ce7637a..ccaf18c 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1,7 +1,7 @@ extern crate yaml_rust; use bevy::prelude::*; use yaml_rust::{Yaml, YamlLoader}; -use crate::{audio, hud, world}; +use crate::{audio, hud, settings, world}; pub const CHATS: &[&str] = &[ include_str!("chats/serenity.yaml"), @@ -9,7 +9,8 @@ pub const CHATS: &[&str] = &[ ]; pub const TOKEN_CHAT: &str = "chat"; -pub const TALKER_SPEED_FACTOR: f32 = 1.0 / 17.0; +pub const LETTERS_PER_SECOND: f32 = 17.0; +pub const TALKER_SPEED_FACTOR: f32 = settings::DEFAULT_CHAT_SPEED / LETTERS_PER_SECOND; pub const CHAT_SPEED_MIN_LEN: f32 = 40.0; pub const NAME_FALLBACK: &str = "Unknown"; @@ -176,6 +177,7 @@ pub fn handle_chat_events( q_choices: Query>, mut q_chats: Query<(Entity, &mut Chat)>, time: Res