Wire subsystem selection and reveal into player input and the HUD

A new "Cycle Target Item" action (hand-authored into Aetheria.inputactions;
no Unity editor here to regenerate AetheriaInput.cs, so ActionGameManager
looks it up by name through Input.asset.FindAction instead of a typed
accessor) cycles the local player's aim point among the current target's
revealed items via TrySelectTargetItem. SchematicDisplay's enemy view now
filters to what FireControl.IsRevealed actually resolves for the viewer,
and marks whichever row is the current ResolvedTargetItem through a new
SchematicListElement.SelectedIndicator (unwired in any prefab yet -- a
no-op until an editor pass assigns one).

Presentation only; decides nothing. Unverified here -- Unity batchmode
is unavailable in this environment.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-19 13:02:54 +02:00
commit 04c0943fa0
4 changed files with 62 additions and 2 deletions

View file

@ -400,7 +400,27 @@ public class ActionGameManager : MonoBehaviour
var currentTargetIndex = Array.IndexOf(targets, CurrentEntity.Target.Value);
CurrentEntity.Target.Value = targets[(currentTargetIndex + targets.Length - 1) % targets.Length];
};
// Cut 2 (docs/fire-control-cut.md): cycles the aim point among the current target's revealed
// subsystems -- decides nothing itself, only calls the one writer (TrySelectTargetItem), same
// predicate (FireControl.IsRevealed) the AI path uses. No generated typed accessor exists for this
// action yet (it was hand-authored into Aetheria.inputactions rather than regenerated through the
// Unity Input Actions editor, unavailable here), so it is looked up by name instead of through
// Input.Player.
Input.asset.FindAction("Player/Cycle Target Item").performed += context =>
{
var target = CurrentEntity.Target.Value;
if (target == null) return;
var revealed = target.Equipment.Where(x => FireControl.IsRevealed(CurrentEntity, x)).ToArray();
if (revealed.Length == 0)
{
CurrentEntity.TrySelectTargetItem(null);
return;
}
var currentItemIndex = Array.IndexOf(revealed, CurrentEntity.ResolvedTargetItem);
CurrentEntity.TrySelectTargetItem(revealed[(currentItemIndex + 1) % revealed.Length]);
};
#endregion