44using NitroxClient . GameLogic . ChatUI ;
55using NitroxModel . Core ;
66using UnityEngine ;
7- using UnityEngine . EventSystems ;
87using UnityEngine . UI ;
98
109namespace NitroxClient . MonoBehaviours . Gui . Chat
@@ -16,29 +15,29 @@ public class PlayerChat : uGUI_InputGroup
1615 private const float TOGGLED_TRANSPARENCY = 0.4f ;
1716 public const float CHAT_VISIBILITY_TIME_LENGTH = 10f ;
1817
19- public static bool IsReady { get ; private set ; }
20-
21- private PlayerChatManager playerChatManager ;
18+ private static readonly Queue < ChatLogEntry > entries = new Queue < ChatLogEntry > ( ) ;
19+ private Image [ ] backgroundImages ;
2220 private CanvasGroup canvasGroup ;
23- private HorizontalOrVerticalLayoutGroup [ ] layoutGroups ;
21+ private InputField inputField ;
2422 private GameObject logEntryPrefab ;
25- private Image [ ] backgroundImages ;
23+
24+ private PlayerChatManager playerChatManager ;
2625 private bool transparent ;
27- private InputField inputField ;
28- public string inputText
26+
27+ public static bool IsReady { get ; private set ; }
28+
29+ public string InputText
2930 {
3031 get { return inputField . text ; }
3132 set { inputField . text = value ; }
3233 }
3334
34- private static readonly Queue < ChatLogEntry > entries = new Queue < ChatLogEntry > ( ) ;
35-
3635 public IEnumerator SetupChatComponents ( )
3736 {
3837 playerChatManager = NitroxServiceLocator . LocateService < PlayerChatManager > ( ) ;
3938
4039 canvasGroup = GetComponent < CanvasGroup > ( ) ;
41- layoutGroups = GetComponentsInChildren < HorizontalOrVerticalLayoutGroup > ( ) ;
40+ GetComponentsInChildren < HorizontalOrVerticalLayoutGroup > ( ) ;
4241
4342 logEntryPrefab = GameObject . Find ( "ChatLogEntryPrefab" ) ;
4443 logEntryPrefab . AddComponent < PlayerChatLogItem > ( ) ;
@@ -51,10 +50,7 @@ public IEnumerator SetupChatComponents()
5150 inputField . gameObject . AddComponent < PlayerChatInputField > ( ) . InputField = inputField ;
5251 inputField . GetComponentInChildren < Button > ( ) . onClick . AddListener ( playerChatManager . SendMessage ) ;
5352
54- backgroundImages = new [ ]
55- {
56- transform . GetChild ( 0 ) . GetComponent < Image > ( ) , transform . GetChild ( 1 ) . GetComponent < Image > ( ) , transform . GetChild ( 3 ) . GetComponent < Image > ( )
57- } ;
53+ backgroundImages = new [ ] { transform . GetChild ( 0 ) . GetComponent < Image > ( ) , transform . GetChild ( 1 ) . GetComponent < Image > ( ) , transform . GetChild ( 3 ) . GetComponent < Image > ( ) } ;
5854
5955 yield return new WaitForEndOfFrame ( ) ; //Needed so Select() works on initialization
6056 IsReady = true ;
@@ -92,6 +88,7 @@ public void Show()
9288 PlayerChatInputField . ResetTimer ( ) ;
9389 StartCoroutine ( ToggleChatFade ( true ) ) ;
9490 }
91+
9592 public void Hide ( )
9693 {
9794 StartCoroutine ( ToggleChatFade ( false ) ) ;
0 commit comments