tab once selects builder, tab twice focuses builder

This commit is contained in:
Ian Woods 2026-07-16 20:49:13 -07:00
parent 826d7b5037
commit fe2c59d326
6 changed files with 28 additions and 6 deletions

View file

@ -1642,7 +1642,14 @@ namespace TD.UI
// WC3 / SC2 convention: clicking the portrait recenters the camera on
// whoever is selected. Zoom is preserved (CameraController.JumpTo only
// moves the pivot). No-op when nothing is selected or the camera isn't wired.
private void OnPortraitClicked(ClickEvent evt)
private void OnPortraitClicked(ClickEvent evt) => CenterCameraOnSelection();
/// <summary>
/// Recenters the camera on the current selection (same behavior as clicking the
/// portrait). No-op when nothing is selected or the camera isn't wired. Also used
/// by the Tab hotkey (select-builder-then-focus) in BuilderInputController.
/// </summary>
public void CenterCameraOnSelection()
{
var sel = SelectionState.Instance?.SelectedObject;
if (sel == null) return;