tab once selects builder, tab twice focuses builder
This commit is contained in:
parent
826d7b5037
commit
fe2c59d326
6 changed files with 28 additions and 6 deletions
|
|
@ -156,7 +156,22 @@ namespace TD.Gameplay
|
|||
{
|
||||
HUDController.Instance?.ToggleBuffMenu();
|
||||
}
|
||||
|
||||
|
||||
// Tab: select the builder, or (if already selected) recenter the camera on it.
|
||||
if (keyboard != null && keyboard.tabKey.wasPressedThisFrame
|
||||
&& !HUDController.IsTextInputActive)
|
||||
{
|
||||
var selection = SelectionState.Instance;
|
||||
if (selection != null && selection.IsSelected(builder))
|
||||
{
|
||||
HUDController.Instance?.CenterCameraOnSelection();
|
||||
}
|
||||
else
|
||||
{
|
||||
selection?.Select(builder);
|
||||
}
|
||||
}
|
||||
|
||||
if (pointerOverHud) return;
|
||||
if (!mouse.rightButton.wasPressedThisFrame) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue