Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## Unreleased
- Improved performance
- Color animations no longer update all materials when they haven't changed.
- Fixed the heat-loop list scroll content not expanding when a vessel has more loops than fit in the viewport.

## 0.9.1 - 2026-05-12
- Fixed memory leaks from dangling event handlers.
Expand Down
14 changes: 14 additions & 0 deletions Source/UI/ToolbarUI/ToolbarLoops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ void PollLoopWidgets(SystemHeatSimulator simulator)
RecalculatePanelPositionData();
}
}

// Heat loops are discovered by walking vessel parts, so their creation
// order is not guaranteed to match their numeric IDs. Keep the content
// order stable and predictable for the player.
loopPanelWidgets.Sort((left, right) => left.TrackedLoopID.CompareTo(right.TrackedLoopID));
for (int i = 0; i < loopPanelWidgets.Count; i++)
{
loopPanelWidgets[i].transform.SetSiblingIndex(i);
}
}
protected void RecalculatePanelPositionData()
{
Expand All @@ -135,6 +144,11 @@ protected void RecalculatePanelPositionData()
Utils.Log($"Source data: buttonYOffsetFromTop={buttonYOffsetFromTop }, loopPanelMaxHeight={loopPanelMaxHeight} widgetTotalHeight={widgetTotalHeight}", LogType.UI);
//loopPanelWidgets.Count * 68f + vlg.padding.top+vlg.padding.bottom+ 3f+7.5f*(loopPanelWidgets.Count-1);
loopPanelRootRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, loopPanelMaxHeight);
// The ScrollRect content must contain the complete list. Previously only
// the viewport was resized, leaving the content at its prefab height when
// more loops were added than could be shown at once. That made some loop
// widgets unreachable or appear to be missing from the list.
loopPanelScrollRootRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, widgetTotalHeight);
loopPanelScrollViewportRect.anchorMin = loopPanelScrollBackground.anchorMin = new Vector2(0, 0);
loopPanelScrollViewportRect.anchorMax = loopPanelScrollBackground.anchorMax = new Vector2(1, 0);
loopPanelScrollCarat.anchorMin = new Vector2(0, 1);
Expand Down