aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/strategic_view.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 17:33:49 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 17:33:49 +0300
commitbd7811533a348e56d2be9c7281d0533fc8c46024 (patch)
treefee2ca08f873d7eef94d26c2cabd51b3cd2e4ce6 /apps/fparkan-game/src/strategic_view.rs
parentda16b075618b792458bbb9ca19e856e9c4189c66 (diff)
downloadfparkan-bd7811533a348e56d2be9c7281d0533fc8c46024.tar.xz
fparkan-bd7811533a348e56d2be9c7281d0533fc8c46024.zip
feat(ui): follow mobile command posts with the strategic camera
Connect captured command vehicles and follow their native orbit. Verify the sweep and acceleration against the original DLL. In a Teleport debug copy, verify Enter, edge rotation and Esc with Vulkan validation enabled. The stock start opens cleanly. The stock route and the original window comparison remain pending.
Diffstat (limited to 'apps/fparkan-game/src/strategic_view.rs')
-rw-r--r--apps/fparkan-game/src/strategic_view.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/fparkan-game/src/strategic_view.rs b/apps/fparkan-game/src/strategic_view.rs
index de854e54..ffb806ab 100644
--- a/apps/fparkan-game/src/strategic_view.rs
+++ b/apps/fparkan-game/src/strategic_view.rs
@@ -13,7 +13,7 @@ use fparkan_assets::strategy_toolbar::{
};
use fparkan_runtime::strategic_roster::{warbot_rows, WarbotRow};
use fparkan_runtime::strategic_view::{
- command_post, CommandCamera, CommandCameraInput, COMMAND_FOV,
+ command_post, mobile_command_post, CommandCamera, CommandCameraInput, COMMAND_FOV,
};
use fparkan_runtime::{
projectile_unit_hit, satellite_contacts,
@@ -21,12 +21,21 @@ use fparkan_runtime::{
RemoteWarbotControl,
};
use fparkan_terrain::{FullSurfaceMask, SurfaceHit, SurfaceQuery};
-use fparkan_world::ObjectHandle;
+use fparkan_world::{ObjectHandle, OriginalObjectId};
use winit::{
event::{ElementState, KeyEvent, MouseButton, WindowEvent},
keyboard::{KeyCode, PhysicalKey},
};
+pub(super) fn captured_command_target(
+ engine: &super::Engine,
+ hero: super::StartingCockpit,
+ id: OriginalObjectId,
+) -> Option<ObjectHandle> {
+ let target = fparkan_runtime::mission_object_handle(engine, id)?;
+ mobile_command_post(engine, hero, target).map(|_| target)
+}
+
pub(super) struct ActiveCommandView {
camera: CommandCamera,
pointer: Option<[f32; 2]>,
@@ -197,7 +206,9 @@ impl StaticVulkanApp {
let Some((engine, cockpit)) = self.mission_engine.as_ref().zip(self.cockpit) else {
return false;
};
- let Some(post) = command_post(engine, cockpit) else {
+ let Some(post) = command_post(engine, cockpit)
+ .or_else(|| mobile_command_post(engine, cockpit, self.boarding_target?))
+ else {
return false;
};
let Some(camera) = CommandCamera::new(engine, post) else {