aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/strategic_view.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 14:12:28 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 14:12:28 +0300
commite2887b0d24a751632cc6e9cc7cc77b50b8a35149 (patch)
tree82690c136dee0dea0e26bc5e27f45305de52a8ac /apps/fparkan-game/src/strategic_view.rs
parent98569dc5e8ee01b19ee82852a807f6a2b911dae4 (diff)
downloadfparkan-e2887b0d24a751632cc6e9cc7cc77b50b8a35149.tar.xz
fparkan-e2887b0d24a751632cc6e9cc7cc77b50b8a35149.zip
feat(ui): arm warbot self-destruction from the strategic card
Diffstat (limited to 'apps/fparkan-game/src/strategic_view.rs')
-rw-r--r--apps/fparkan-game/src/strategic_view.rs19
1 files changed, 18 insertions, 1 deletions
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
}
}