Add ability to note predictions on the side

This commit is contained in:
WillJeynes
2026-08-27 19:10:41 +01:00
parent abe7a12244
commit 387b04f79c
5 changed files with 116 additions and 6 deletions
+10 -4
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using Utils;
public class StatusManager : Singleton<StatusManager>
@@ -32,12 +33,11 @@ public class StatusManager : Singleton<StatusManager>
PopulatePanel(doorPanelThoughts, doorPrefab, LevelLoader.Instance.Doors.Cast<IDescribable>().ToList(),true, LevelLoader.Instance.GlobalModifier == "HIDE");
PopulatePanel(guardPanelThoughts, guardPrefab, LevelLoader.Instance.Guards.Cast<IDescribable>().ToList(), true, false);
//hide side pannel if cup global mod, or if only one guard
//add fallback to getdescribename
//actually implement the setting of predictions
}
private Color[] colors = new Color[] { Color.white, Color.green, Color.red };
private Dictionary<GameObject, int> cycles = new Dictionary<GameObject, int>();
private void PopulatePanel(Transform panel, GameObject template, List<IDescribable> items, bool interactableType, bool hide)
{
foreach (Transform child in panel)
@@ -70,6 +70,12 @@ public class StatusManager : Singleton<StatusManager>
{
titleMesh.text = item.GetDescribeName();
descMesh.text = "Click to set prediction";
cycles[obj] = 0;
obj.GetComponentInChildren<Button>().onClick.AddListener(() =>
{
obj.GetComponent<Image>().color = colors[++cycles[obj]%3];
});
}
}
}