From b9494af9765e7993a8eaef6071adb333b30b5cb3 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 28 Oct 2026 11:14:14 +0300 Subject: [PATCH] Server list: build each row's sprite key once The row made the short sprite name (format! or to_owned) and then wrapped it in format!("gui/sprites/{sprite}") for the atlas. Build the full key in the match arm and hand it straight to sprite_scaled. Co-Authored-By: Hermes Agent (Nous Research) --- crates/horizon-client/src/multiplayer.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/crates/horizon-client/src/multiplayer.rs b/crates/horizon-client/src/multiplayer.rs index 39ea26502..c3e29d92d 100644 --- a/crates/horizon-client/src/multiplayer.rs +++ b/crates/horizon-client/src/multiplayer.rs @@ -734,7 +734,7 @@ impl Screen { motd.resolve_legacy(), Ping::player_count(*players), format!( - "server_list/ping_{}", + "gui/sprites/server_list/ping_{}", match ms { 0..150 => 5, 150..300 => 4, @@ -748,7 +748,7 @@ impl Screen { Text::translate("multiplayer.status.cannot_connect", &[]) .with_color(0xFF0000), Text::empty(), - "server_list/unreachable".to_owned(), + "gui/sprites/server_list/unreachable".to_owned(), ), _ => { // The pinging bars bounce, offset by the row. @@ -757,7 +757,7 @@ impl Screen { ( Text::translate("multiplayer.status.pinging", &[]), Text::empty(), - format!("server_list/pinging_{}", frame + 1), + format!("gui/sprites/server_list/pinging_{}", frame + 1), ) } }; @@ -778,15 +778,7 @@ impl Screen { ); } let icon_x = cx + ROW_WIDTH - 4.0 - 15.0; - batch.sprite_scaled( - atlas, - &format!("gui/sprites/{sprite}"), - icon_x, - cy, - 10.0, - 8.0, - u32::MAX, - ); + batch.sprite_scaled(atlas, &sprite, icon_x, cy, 10.0, 8.0, u32::MAX); let sw = atlas.font.width_text(&status).ceil(); batch.text_styled( atlas,