aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-assets/src/strategic_roster.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 11:12:06 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 11:12:06 +0300
commit733f9d92e0d4e40ed40db42fa6cd11294e49eb7b (patch)
tree824dde369c5fbb7b3180c42899c4f0555929ca4b /crates/fparkan-assets/src/strategic_roster.rs
parent61208d874cb3d9bf93e9f7c60aceebc287454b62 (diff)
downloadfparkan-733f9d92e0d4e40ed40db42fa6cd11294e49eb7b.tar.xz
fparkan-733f9d92e0d4e40ed40db42fa6cd11294e49eb7b.zip
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.
Diffstat (limited to 'crates/fparkan-assets/src/strategic_roster.rs')
-rw-r--r--crates/fparkan-assets/src/strategic_roster.rs10
1 files changed, 10 insertions, 0 deletions
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<ListHit> {
(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,