From ffad9e1f0acbde0e338cc8f89c8dda5a1790d588 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 06:25:21 +0100 Subject: [PATCH] Keep the styling of the death message on the death screen --- crates/horizon-client/src/game/remote.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 77e143f9a..57e5c7c59 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -191,7 +191,7 @@ pub(super) struct Remote { input: horizon_client::interaction_input::InteractionInput, stop_mining: bool, placing: Option<([i32; 3], u64)>, - death_message: Option, + death_message: Option, player_type: Option>, /// Inventory as last synchronised, for creative-mode slot updates. synced: Vec>, @@ -2233,7 +2233,7 @@ impl Game<'_> { // The component resolves in the client's current language, as // the chat line does, not in the language the session joined // with (`Remote.lang` is the vanilla server-language table). - let message = remote_text(&p.message).plain(); + let message = remote_text(&p.message); let me = self.remote.as_ref().is_some_and(|r| r.entity_id == p.id); if let Some(r) = self.remote.as_mut() { r.death_message = Some(message); @@ -5225,8 +5225,16 @@ impl Game<'_> { if self.screen == Screen::Dead && let Some(message) = &r.death_message { - let tw = HudBatch::text_width(atlas, message); - batch.text(atlas, message, (w - tw) / 2.0, 85.0, u32::MAX, true); + // DeathScreen draws the styled cause component. + let tw = atlas.font.width_text(message); + batch.text_styled( + atlas, + message, + ((w - tw) / 2.0).floor(), + 85.0, + u32::MAX, + true, + ); } } /// Status for `horizon-ctl status`.