From 733f9d92e0d4e40ed40db42fa6cd11294e49eb7b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 12:12:06 +0400 Subject: feat(ui): show native strategic waypoint cursors Read the animated cursor strips and their hotspots from the installed UI atlas. Use the native Land.map areal flag and chassis selector for both the preview cursor and waypoint input. In stock Two Fortresses, compared one accepted and one rejected map point against the original and checked the return to the cockpit with Vulkan validation. --- crates/fparkan-assets/src/strategic_roster.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/fparkan-assets/src/strategic_roster.rs') diff --git a/crates/fparkan-assets/src/strategic_roster.rs b/crates/fparkan-assets/src/strategic_roster.rs index 440ead26..64c819a1 100644 --- a/crates/fparkan-assets/src/strategic_roster.rs +++ b/crates/fparkan-assets/src/strategic_roster.rs @@ -46,6 +46,16 @@ pub fn hit_test([x, y]: [f32; 2], row_count: usize) -> Option { (row < row_count && y % ROW_PITCH < ROW_HEIGHT).then_some(ListHit::Row(row)) } +/// Whether the roster or its supported order panel covers the pointer. +pub fn covers_pointer([x, y]: [f32; 2], rows: usize) -> bool { + let row_end = ROW_TOP + ROW_PITCH * rows.min(19) as u32; + let [x, y] = [x.round_ties_even(), y.round_ties_even()]; + rows != 0 + && ((ORIGIN[0] as f32..(ORIGIN[0] + EXTENT[0] - 1) as f32).contains(&x) + && (0.0..row_end as f32).contains(&y) + || orders::covers_pointer([x, y], rows)) +} + /// A localized row with the native icon selectors. pub struct Row<'a> { pub label: &'a str, -- cgit v1.2.3