aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/strategic_view.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 13:59:29 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 13:59:29 +0300
commit98569dc5e8ee01b19ee82852a807f6a2b911dae4 (patch)
tree71dce6e11eaef918fc817b9393c0e190f661dd1c /apps/fparkan-game/src/strategic_view.rs
parent05da53f0344416a5f14211a73f1f48d72c88b954 (diff)
downloadfparkan-98569dc5e8ee01b19ee82852a807f6a2b911dae4.tar.xz
fparkan-98569dc5e8ee01b19ee82852a807f6a2b911dae4.zip
feat(ui): watch a warbot on autopilot from its cockpit
Diffstat (limited to 'apps/fparkan-game/src/strategic_view.rs')
-rw-r--r--apps/fparkan-game/src/strategic_view.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/fparkan-game/src/strategic_view.rs b/apps/fparkan-game/src/strategic_view.rs
index 8dc0e57c..e5aa3633 100644
--- a/apps/fparkan-game/src/strategic_view.rs
+++ b/apps/fparkan-game/src/strategic_view.rs
@@ -2,7 +2,9 @@ use super::{
add3, player_movement_key, scale3, screen_ray_from_pixels, LegacyD3d7Projection,
PreviewCameraFrame, StaticVulkanApp,
};
-use fparkan_assets::strategic_roster::{covers_pointer, hit_test, order_at, ListHit, RosterOrder};
+use fparkan_assets::strategic_roster::{
+ covers_pointer, hit_test, order_at, CockpitControl, ListHit, RosterOrder,
+};
use fparkan_assets::strategy_cursor::StrategyCursor;
use fparkan_assets::strategy_toolbar::{command_button_at, ToolbarAction};
use fparkan_runtime::strategic_roster::{warbot_rows, WarbotRow};
@@ -389,12 +391,12 @@ impl StaticVulkanApp {
view.warbots_open = false;
return;
}
- Some(mode @ (ListHit::ManualControl | ListHit::AutoGunner)) => {
+ Some(ListHit::Cockpit(button)) => {
if let Some(row) = selected {
- let mode = if mode == ListHit::ManualControl {
- RemoteWarbotControl::Manual
- } else {
- RemoteWarbotControl::AutoGunner
+ let mode = match button {
+ CockpitControl::Manual => RemoteWarbotControl::Manual,
+ CockpitControl::AutoGunner => RemoteWarbotControl::AutoGunner,
+ CockpitControl::Autopilot => RemoteWarbotControl::Autopilot,
};
self.take_warbot_control(row.handle, mode);
}
@@ -469,7 +471,7 @@ impl StaticVulkanApp {
if let Some(view) = &mut self.remote_command_view {
view.order_input = None;
view.pointer = None;
- if mode == RemoteWarbotControl::AutoGunner {
+ if mode != RemoteWarbotControl::Manual {
view.warbots_open = false;
}
}