BTS-150: Programmed Movements UI - timeline, config panel, Run button fixes

- Timeline blocks aligned with second markers (Blocks rect full width)
- Config panel: Angle/Direction sections, Save/Back/Delete
- DC module support: Fwd/Bwd, degrees input
- Run button: re-wire on completion, periodic re-wire when idle
- Fix AngleInput path (ConfigRow2/AngleSection/AngleInput) for correct angle save
- Default module None for new blocks, Run text 'Running'

Made-with: Cursor
This commit is contained in:
Leo Qu
2026-02-28 21:54:56 -05:00
parent a0fe0f713f
commit 6d01c8c532
28 changed files with 10181 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// Attach to a track's Blocks rect. On click, invokes callback with the clicked time (0-10).
/// </summary>
public class TrackClickHandler : MonoBehaviour, IPointerClickHandler
{
public System.Action<int, float> OnTrackClicked;
public void OnPointerClick(PointerEventData eventData)
{
if (OnTrackClicked == null) return;
var rect = GetComponent<RectTransform>();
if (rect == null) return;
RectTransformUtility.ScreenPointToLocalPointInRectangle(rect, eventData.position, eventData.pressEventCamera, out var localPoint);
float normalizedX = Mathf.InverseLerp(rect.rect.xMin, rect.rect.xMax, localPoint.x);
float second = Mathf.Clamp(normalizedX * ProgrammedMovementsController.TimelineDurationSeconds, 0f, ProgrammedMovementsController.TimelineDurationSeconds - 0.1f);
int trackIndex = transform.parent.GetSiblingIndex();
OnTrackClicked.Invoke(trackIndex, second);
}
}