From 6d714c972b19db01f206272c88a95e40b2753c40 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Sat, 2 Dec 2023 00:30:55 +0800 Subject: [PATCH] Add hung color to input dialog entry. --- Assets/Cryville/Crtr/Config/UI/InputDialogEntry.cs | 10 ++++++++++ Assets/Interface2/Prefabs/InputDialogEntry.prefab | 1 + 2 files changed, 11 insertions(+) diff --git a/Assets/Cryville/Crtr/Config/UI/InputDialogEntry.cs b/Assets/Cryville/Crtr/Config/UI/InputDialogEntry.cs index 50fd93c..8ccefd1 100644 --- a/Assets/Cryville/Crtr/Config/UI/InputDialogEntry.cs +++ b/Assets/Cryville/Crtr/Config/UI/InputDialogEntry.cs @@ -17,6 +17,7 @@ namespace Cryville.Crtr.Config.UI { [SerializeField] Graphic m_iW; [SerializeField] Color m_invalidColor; [SerializeField] Color m_inactiveColor; + [SerializeField] Color m_hungColor; [SerializeField] Color m_activeColor; [SerializeField] Color m_restColor; [SerializeField] Color m_motionColor; @@ -61,6 +62,14 @@ namespace Cryville.Crtr.Config.UI { Clicked?.Invoke(); } + bool _hung; + void Update() { + if (_activeInputs.Count > 0) { + if (_hung) m_iNull.color = m_hungColor; + else _hung = true; + } + } + float _maxScalar; Dictionary _activeInputs; public void OnInputEvent(InputEvent ev) { @@ -91,6 +100,7 @@ namespace Cryville.Crtr.Config.UI { _activeInputs[id] = vec; } m_iNull.color = _activeInputs.Count > 0 ? m_activeColor : m_inactiveColor; + _hung = false; } void UpdateVectorIndicator(Graphic i, float v) { float a = MathF.Abs(v); diff --git a/Assets/Interface2/Prefabs/InputDialogEntry.prefab b/Assets/Interface2/Prefabs/InputDialogEntry.prefab index 334ac61..24aee85 100644 --- a/Assets/Interface2/Prefabs/InputDialogEntry.prefab +++ b/Assets/Interface2/Prefabs/InputDialogEntry.prefab @@ -866,6 +866,7 @@ MonoBehaviour: m_iW: {fileID: 2244049687317785014} m_invalidColor: {r: 0.25, g: 0.25, b: 0.25, a: 1} m_inactiveColor: {r: 0.125, g: 0.25, b: 0.125, a: 1} + m_hungColor: {r: 0.6, g: 0.6, b: 0.30294117, a: 1} m_activeColor: {r: 0.5, g: 1, b: 0.5, a: 1} m_restColor: {r: 0.125, g: 0.1875, b: 0.25, a: 1} m_motionColor: {r: 0.5, g: 0.75, b: 1, a: 1}