mirror of
https://github.com/vladtrc/iw4L
synced 2026-10-26 02:11:39 -04:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user