From 9f442fa339371869dda44a32a9e0ec2f763d830c Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 19:05:52 +0400 Subject: 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. --- apps/fparkan-game/src/strategic_tooltip_hud.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps/fparkan-game/src/strategic_tooltip_hud.rs') diff --git a/apps/fparkan-game/src/strategic_tooltip_hud.rs b/apps/fparkan-game/src/strategic_tooltip_hud.rs index 0e8ee3af..812c6e06 100644 --- a/apps/fparkan-game/src/strategic_tooltip_hud.rs +++ b/apps/fparkan-game/src/strategic_tooltip_hud.rs @@ -4,6 +4,7 @@ use super::{ }; use fparkan_assets::{ game_font::{load_tool_font, TOOL_FONT_EXTENTS}, + strategic_buildings::COMMAND_TOOLTIP, strategic_factory, strategic_roster::{hit_test, CockpitControl, ListHit}, strategy_toolbar::{button_index_at, ToolbarLayout, TOOLTIP_IDS}, @@ -16,7 +17,8 @@ use std::{path::Path, time::Instant}; // In the order in which iron3d+0x82930 assigns the original texts to the buttons. const CARD_LABELS: [u32; 4] = [0x05de, 0x05ef, 0x05ee, 0x1864]; const FACTORY_OFFSET: usize = TOOLTIP_IDS.len() + CARD_LABELS.len(); -const LABEL_COUNT: usize = FACTORY_OFFSET + strategic_factory::TOOLTIP_IDS.len(); +const BUNKER_OFFSET: usize = FACTORY_OFFSET + strategic_factory::TOOLTIP_IDS.len(); +const LABEL_COUNT: usize = BUNKER_OFFSET + 1; #[derive(Clone, Copy, Default)] struct Frame { @@ -38,6 +40,7 @@ impl StrategicTooltipHud { .into_iter() .chain(CARD_LABELS) .chain(strategic_factory::TOOLTIP_IDS) + .chain([COMMAND_TOOLTIP]) .map(|id| { strings .get(id) @@ -101,19 +104,20 @@ impl StrategicTooltipHud { pointer: Option<[f32; 2]>, toolbar_layout: Option, card_rows: usize, - factory_tip: Option, + panel_tip: Option, ) -> Result<(), String> { let tooltip = pointer.and_then(|xy| { let toolbar_label = toolbar_layout .filter(|layout| layout.button_visible(xy[1])) .and_then(|_| button_index_at(xy)); - let factory_label = factory_tip.and_then(|id| { + let panel_label = panel_tip.and_then(|id| { strategic_factory::TOOLTIP_IDS .iter() .position(|&known| id == known) .map(|index| FACTORY_OFFSET + index) + .or_else(|| (id == COMMAND_TOOLTIP).then_some(BUNKER_OFFSET)) }); - let label = toolbar_label.or(factory_label).or_else(|| { + let label = toolbar_label.or(panel_label).or_else(|| { let card = match hit_test(xy, card_rows)? { ListHit::Cockpit(CockpitControl::Manual) => 0, ListHit::Cockpit(CockpitControl::AutoGunner) => 1, -- cgit v1.2.3