From 9fcdb6a25fcc7ae42236d94eba64f10d27f3f574 Mon Sep 17 00:00:00 2001 From: neptune Date: Fri, 2 Oct 2026 21:00:33 -0400 Subject: [PATCH] Preview a camouflage as wide as the class panel lays it The camouflage picker showed its swatch in the square attachment preview; it now fills the weapon-wide preview, as the class panel shows it behind the weapon. Co-Authored-By: Claude Opus 5.5 --- crates/console/src/class_menu.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/console/src/class_menu.rs b/crates/console/src/class_menu.rs index fda701d..710baaa 100644 --- a/crates/console/src/class_menu.rs +++ b/crates/console/src/class_menu.rs @@ -716,16 +716,19 @@ pub(crate) fn route( } }) .unwrap_or_default(); - // IW4's class menu shows a camouflage by its swatch. - let image = match choices.get(state.page * PAGE_SIZE + state.hover) { - Some(camo) if state.camo && !camo.is_empty() => { - format!("iw4:material/weapon_camo_menu_{camo}") - } - _ => image, + // A camouflage previews as its swatch, as wide as the class panel + // lays it. + let image = if state.camo { + choices + .get(state.page * PAGE_SIZE + state.hover) + .filter(|camo| !camo.is_empty()) + .map(|camo| format!("iw4:material/weapon_camo_menu_{camo}")) + .unwrap_or_default() + } else { + image }; dvars.set("ui_class_preview", image); let square_preview = state.attachments - || state.camo || matches!( state.row, Some(