diff --git a/src/chat.rs b/src/chat.rs index b0b804c..1e6d93c 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -775,6 +775,9 @@ pub fn handle_chat_events( chat.talker.name.clone().unwrap_or("".to_string()), ); } + hud::LogLevel::Send => { + log.send(message.into()); + } hud::LogLevel::Info => { log.info(message.into()); } @@ -851,6 +854,7 @@ pub fn handle_chat_events( fn handle_reply_keys( keyboard_input: Res>, settings: Res, + mut log: ResMut, q_choices: Query<&Choice>, mut q_chats: Query<&mut Chat>, mut ew_sfx: EventWriter, @@ -871,6 +875,9 @@ fn handle_reply_keys( if let Ok(mut chat) = q_chats.get_single_mut() { // Advance the chat. ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click)); + if choice.text != TEXT_CONTINUE { + log.send(choice.text.clone()); + } chat.timer = time.elapsed_seconds_f64(); chat.position = choice.goto.clone(); chat.message_open = false; diff --git a/src/hud.rs b/src/hud.rs index 35e7b34..ac922bc 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -228,6 +228,7 @@ pub enum LogLevel { Info, //Debug, Chat, + Send, //Ping, } @@ -295,6 +296,10 @@ impl Log { self.add(message, sender, LogLevel::Chat); } + pub fn send(&mut self, message: String) { + self.add(message, "Me".to_string(), LogLevel::Send); + } + pub fn warning(&mut self, message: String) { self.add(message, "WARNING".to_string(), LogLevel::Warning); } @@ -1040,6 +1045,7 @@ fn update_hud( LogLevel::Achievement => settings.hud_color_console_achievement, LogLevel::Warning => settings.hud_color_console_warn, LogLevel::Info => settings.hud_color_console_system, + LogLevel::Send => settings.hud_color_console_send, _ => settings.hud_color_console, }; chat.sections[row].style.color.set_alpha(opacity); diff --git a/src/var.rs b/src/var.rs index 2063b99..1a147ca 100644 --- a/src/var.rs +++ b/src/var.rs @@ -69,6 +69,7 @@ pub struct Settings { pub hud_color: Color, pub hud_color_fps: Color, pub hud_color_console: Color, + pub hud_color_console_send: Color, pub hud_color_console_warn: Color, pub hud_color_console_system: Color, pub hud_color_console_achievement: Color, @@ -213,6 +214,7 @@ impl Default for Settings { hud_color: Srgba::hex(COLOR_PRIMARY).unwrap().into(), hud_color_fps: Srgba::hex("#181818").unwrap().into(), hud_color_console: Srgba::hex(COLOR_PRIMARY).unwrap().into(), + hud_color_console_send: Srgba::hex(COLOR_SECONDARY).unwrap().into(), hud_color_console_achievement: Srgba::hex(COLOR_SUCCESS).unwrap().into(), hud_color_console_warn: Srgba::hex(COLOR_WARNING).unwrap().into(), hud_color_console_system: Srgba::hex(COLOR_SECONDARY).unwrap().into(),