fix(uxassist): restore tech-tree arrows across save changes

Grow missing connection arrows when Peace-mode filtering is restored, preserving existing controls and native connection updates. Record the fix in UXAssist 1.7.0 and synchronize the manifest and bilingual documentation.
This commit is contained in:
soarqin committed 2026-11-02 20:59:58 +08:00
1 parent 8fbb244ba2
commit 6d4953fc29
5 files changed
+20 -3

No files matched your search

+12 -1
View File
@@ -222,11 +222,22 @@ public static class TechPatch
foreach (var item in nodes)
{
var node = item.Value;
var postTechArray = node.techProto.postTechArray;
// A new session can initialize nodes while the peace-mode graph is still filtered.
var arrowCount = node.arrows.Length;
if (arrowCount < postTechArray.Length)
{
System.Array.Resize(ref node.arrows, postTechArray.Length);
for (var i = arrowCount; i < postTechArray.Length; i++)
{
node.arrows[i] = UnityEngine.Object.Instantiate(node.arrowPrefab, node.arrowPrefab.parent);
node.arrows[i].SetAsFirstSibling();
}
}
foreach (var arrow in node.arrows)
{
arrow.gameObject.SetActive(false);
}
var postTechArray = node.techProto.postTechArray;
var active = postTechArray.Length > 0;
node.connGroup.gameObject.SetActive(active);
node.connImages = active ? node.connGroup.GetComponentsInChildren<Image>(true) : [];