fade out text through color, not alpha, for performance reasons

This commit is contained in:
yuni 2024-04-15 23:21:15 +02:00
parent 45fbd4e2b5
commit 35d6937793

View file

@ -522,14 +522,13 @@ fn update_hud(
for msg in &messages { for msg in &messages {
chat.sections[row].value = msg.format(); chat.sections[row].value = msg.format();
let freshness = msg.get_freshness(); let freshness = msg.get_freshness();
let clr: f32 = (freshness.powf(1.5) as f32).clamp(0.1, 1.0); let brightness: f32 = (freshness.powf(1.5) as f32).clamp(0.1, 1.0);
freshest_line = freshest_line.max(freshness); freshest_line = freshest_line.max(freshness);
chat.sections[row].style.color = match msg.level { chat.sections[row].style.color = match msg.level {
LogLevel::Warning => settings.hud_color_console_warn, LogLevel::Warning => settings.hud_color_console_warn,
LogLevel::Info => settings.hud_color_console_system, LogLevel::Info => settings.hud_color_console_system,
_ => settings.hud_color_console, _ => settings.hud_color_console,
}; } * brightness;
chat.sections[row].style.color.set_a(clr);
row += 1; row += 1;
} }