show achievements in golden color in the log

This commit is contained in:
yuni 2024-05-14 07:27:43 +02:00
parent ac38a248fa
commit f1725fcab5
4 changed files with 10 additions and 1 deletions

View file

@ -705,6 +705,9 @@ pub fn handle_chat_events(
hud::LogLevel::Info => {
log.info(message.into());
}
hud::LogLevel::Achievement => {
log.add(message.into(), "".into(), hud::LogLevel::Achievement);
}
hud::LogLevel::Warning => {
log.warning(message.into());
}

View file

@ -148,7 +148,8 @@ pub fn handle_game_event(
}
GameEvent::Achievement(name) => {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Achieve));
log.info(format!("Achievement accomplished: {name}!"));
log.add(format!("Achievement accomplished: {name}!"),
"".to_string(), hud::LogLevel::Achievement);
}
}
}

View file

@ -117,6 +117,7 @@ pub struct AugmentedRealityOverlay {
struct FPSUpdateTimer(Timer);
pub enum LogLevel {
Achievement,
Always,
Warning,
//Error,
@ -847,6 +848,7 @@ fn update_hud(
} else {
|msg: &&Message| { match msg.level {
LogLevel::Always => true,
LogLevel::Achievement => true,
_ => false
}}
};
@ -862,6 +864,7 @@ fn update_hud(
let opacity: f32 = (freshness.powf(1.5) as f32).clamp(0.0, 1.0);
freshest_line = freshest_line.max(freshness);
chat.sections[row].style.color = match msg.level {
LogLevel::Achievement => settings.hud_color_console_achievement,
LogLevel::Warning => settings.hud_color_console_warn,
LogLevel::Info => settings.hud_color_console_system,
_ => settings.hud_color_console,

View file

@ -64,6 +64,7 @@ pub struct Settings {
pub hud_color_console: Color,
pub hud_color_console_warn: Color,
pub hud_color_console_system: Color,
pub hud_color_console_achievement: Color,
pub hud_color_alert: Color,
pub hud_color_subtitles: Color,
pub hud_color_choices: Color,
@ -183,6 +184,7 @@ impl Default for Settings {
hud_color: Color::hex("#BE1251").unwrap(),
hud_color_fps: Color::hex("#181818").unwrap(),
hud_color_console: Color::hex("#BE1251").unwrap(),
hud_color_console_achievement: Color::hex("#F0D50C").unwrap(),
hud_color_console_warn: Color::hex("#CCCCCC").unwrap(),
hud_color_console_system: Color::hex("#7F7F7F").unwrap(),
hud_color_alert: Color::hex("#CCCCCC").unwrap(),