diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
| commit | 1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4 (patch) | |
| tree | 9ef8276c399e238a2a692862de09f54bf5dcee65 /apps/fparkan-game/src/strategic_view.rs | |
| parent | 077bead07a76908ac4e0e2b84de3940256cf6fd1 (diff) | |
| download | fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.tar.xz fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.zip | |
feat(ui): enable manual control from the bunker list
Use the active Control camera record and its separate CPT origin and direction for the fixed turret. The original hand control opens the cockpit, its two weapon slots and aim tracks while leaving the operator at the command post.
Verified from the stock Two Fortresses start against the GOG cockpit with Vulkan validation. The licensed tests cover the native camera pose, mounted weapon selection and stationary bunker and operator.
Diffstat (limited to 'apps/fparkan-game/src/strategic_view.rs')
| -rw-r--r-- | apps/fparkan-game/src/strategic_view.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/fparkan-game/src/strategic_view.rs b/apps/fparkan-game/src/strategic_view.rs index a6719c84..2d6d86a5 100644 --- a/apps/fparkan-game/src/strategic_view.rs +++ b/apps/fparkan-game/src/strategic_view.rs @@ -652,6 +652,23 @@ impl StaticVulkanApp { view.focus_bunker(engine, cockpit, row.handle); Some(row) } + Some(BuildingHit::Manual(index)) => { + let row = rows[index]; + let selected = view.select_building(row); + if let Some(vehicle) = fparkan_runtime::bunker_control::enter( + engine, cockpit, row.handle, + ) { + self.enter_remote_cockpit( + cockpit, + vehicle, + RemoteWarbotControl::Manual, + ); + } + if let Some(row) = selected { + self.play_building_selection(row); + } + return; + } Some(BuildingHit::Row(index)) => rows.get(index).copied(), None => rows.into_iter().find(|row| Some(row.handle) == map_hit), }; @@ -833,6 +850,15 @@ impl StaticVulkanApp { else { return; }; + self.enter_remote_cockpit(hero, vehicle, mode); + } + + fn enter_remote_cockpit( + &mut self, + hero: super::StartingCockpit, + vehicle: super::StartingCockpit, + mode: RemoteWarbotControl, + ) { self.remote_command_view = self.command_view.take(); if let Some(view) = &mut self.remote_command_view { view.order_input = None; |
