diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 18:05:52 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 18:05:52 +0300 |
| commit | 9f442fa339371869dda44a32a9e0ec2f763d830c (patch) | |
| tree | bec91edfe30d42a278502561af155c11a32de764 /apps/fparkan-game/src/strategic_toolbar_hud.rs | |
| parent | 3b5a8aa4e6465ca56763cb96b4100bb1ff1c0ccf (diff) | |
| download | fparkan-9f442fa339371869dda44a32a9e0ec2f763d830c.tar.xz fparkan-9f442fa339371869dda44a32a9e0ec2f763d830c.zip | |
feat(ui): connect the bunker list to the strategic camera
Show clan bunkers with the original compound controls and map selection. The strategic command button switches the camera anchor and preserves a view already bound to that bunker. Check the stock Two Fortresses window with Vulkan validation and exercise retargeting and the ownership guard with the licensed runtime test.
Diffstat (limited to 'apps/fparkan-game/src/strategic_toolbar_hud.rs')
| -rw-r--r-- | apps/fparkan-game/src/strategic_toolbar_hud.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/fparkan-game/src/strategic_toolbar_hud.rs b/apps/fparkan-game/src/strategic_toolbar_hud.rs index 2ad93a59..74f313ac 100644 --- a/apps/fparkan-game/src/strategic_toolbar_hud.rs +++ b/apps/fparkan-game/src/strategic_toolbar_hud.rs @@ -5,6 +5,7 @@ use super::{ use fparkan_assets::strategy_toolbar::{ ButtonVisual, ToolbarHover, ToolbarImages, ToolbarLayout, CONTROL_COUNT, EXTENT, }; +use fparkan_runtime::strategic_buildings::BuildingSection; use std::path::Path; pub(super) struct StrategicToolbarHud { @@ -69,8 +70,14 @@ impl StrategicToolbarHud { if frame.factories_open && frame.sections[4] { visuals[5] = ButtonVisual::Lit; } - if frame.other_buildings_open && frame.sections[7] { - visuals[8] = ButtonVisual::Lit; + if let Some(section) = frame.building_section { + let index = match section { + BuildingSection::Bunkers => 7, + BuildingSection::Other => 8, + }; + if frame.sections[index - 1] { + visuals[index] = ButtonVisual::Lit; + } } // The chat button is disabled in a local mission. visuals[9] = ButtonVisual::Disabled; @@ -101,7 +108,7 @@ pub(super) struct ToolbarFrame { pub sections: [bool; 8], pub warbots_open: bool, pub factories_open: bool, - pub other_buildings_open: bool, + pub building_section: Option<BuildingSection>, pub map_open: bool, pub pointer: Option<[f32; 2]>, pub now_ms: u32, |
