Modify texts in input config panel.

This commit is contained in:
2023-02-09 18:09:40 +08:00
parent 3dd25b51a8
commit 3e525842cb
2 changed files with 21 additions and 3 deletions

View File

@@ -69,8 +69,7 @@ namespace Cryville.Crtr.Config {
}
void OnProxyChanged(object sender, ProxyChangedEventArgs e) {
_entries[e.Name].SetEnabled(!e.Used);
_entries[e.Name].SetValue(e.Proxy == null ? "None" : e.Proxy.Value.Handler.GetTypeName(e.Proxy.Value.Type));
_entries[e.Name].OnProxyChanged(e);
}
readonly List<InputSource?> _recvsrcs = new List<InputSource?>();
@@ -86,7 +85,7 @@ namespace Cryville.Crtr.Config {
if (_recvsrcs.Contains(src)) return;
_recvsrcs.Add(src);
var obj = Instantiate(m_prefabListItem, m_deviceList);
obj.transform.Find("Text").GetComponent<Text>().text = src == null ? "None" : src.Value.Handler.GetTypeName(src.Value.Type);
obj.transform.Find("Text").GetComponent<Text>().text = src == null ? "(None)" : src.Value.Handler.GetTypeName(src.Value.Type);
var btn = obj.GetComponent<Button>();
if (src != null) btn.interactable = !proxy.IsUsed(src.Value);
btn.onClick.AddListener(() => {