From e2887b0d24a751632cc6e9cc7cc77b50b8a35149 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 15:12:28 +0400 Subject: feat(ui): arm warbot self-destruction from the strategic card --- apps/fparkan-game/src/strategic_view.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'apps/fparkan-game/src/strategic_view.rs') diff --git a/apps/fparkan-game/src/strategic_view.rs b/apps/fparkan-game/src/strategic_view.rs index e5aa3633..8787aeff 100644 --- a/apps/fparkan-game/src/strategic_view.rs +++ b/apps/fparkan-game/src/strategic_view.rs @@ -402,6 +402,21 @@ impl StaticVulkanApp { } return; } + Some(ListHit::SelfDestruct) => { + if let Some(row) = selected { + let now_ms = if self.control_clock_target_ms.is_some() { + self.simulation_time_ms + } else { + self.simulation_elapsed + .saturating_add(self.simulation_last_tick.elapsed()) + .as_millis() as u32 + }; + fparkan_runtime::arm_warbot_self_destruct( + engine, cockpit, row.handle, now_ms, + ); + } + return; + } Some(ListHit::Row(index)) => { let row = rows[index]; if view.select_warbot(row) { @@ -627,7 +642,9 @@ impl StaticVulkanApp { .as_ref() .zip(self.cockpit) .map_or_else(Vec::new, |(engine, cockpit)| warbot_rows(engine, cockpit)); - view.refresh_warbots(&rows); + if let Some(row) = view.refresh_warbots(&rows) { + self.play_warbot_selection(row); + } rows } } -- cgit v1.2.3