diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 91a90eb36..5b68f8e94 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -209,7 +209,7 @@ pub(super) struct Remote { placing: Option<([i32; 3], u64)>, /// `CommonPlayerSpawnInfo.isFlat`: the level is a superflat one. pub(super) flat: bool, - death_message: Option, + death_message: Option, /// `LocalPlayer.showDeathScreen`: off with `immediate_respawn`. show_death_screen: bool, player_type: Option>, @@ -2469,7 +2469,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); @@ -5763,8 +5763,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, + ); } } /// Shared flag 6 of an entity on a server's client (`None` without a server).