4
4
using NitroxClient . GameLogic . ChatUI ;
5
5
using NitroxModel . Core ;
6
6
using UnityEngine ;
7
- using UnityEngine . EventSystems ;
8
7
using UnityEngine . UI ;
9
8
10
9
namespace NitroxClient . MonoBehaviours . Gui . Chat
@@ -16,29 +15,29 @@ public class PlayerChat : uGUI_InputGroup
16
15
private const float TOGGLED_TRANSPARENCY = 0.4f ;
17
16
public const float CHAT_VISIBILITY_TIME_LENGTH = 10f ;
18
17
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 ;
22
20
private CanvasGroup canvasGroup ;
23
- private HorizontalOrVerticalLayoutGroup [ ] layoutGroups ;
21
+ private InputField inputField ;
24
22
private GameObject logEntryPrefab ;
25
- private Image [ ] backgroundImages ;
23
+
24
+ private PlayerChatManager playerChatManager ;
26
25
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
29
30
{
30
31
get { return inputField . text ; }
31
32
set { inputField . text = value ; }
32
33
}
33
34
34
- private static readonly Queue < ChatLogEntry > entries = new Queue < ChatLogEntry > ( ) ;
35
-
36
35
public IEnumerator SetupChatComponents ( )
37
36
{
38
37
playerChatManager = NitroxServiceLocator . LocateService < PlayerChatManager > ( ) ;
39
38
40
39
canvasGroup = GetComponent < CanvasGroup > ( ) ;
41
- layoutGroups = GetComponentsInChildren < HorizontalOrVerticalLayoutGroup > ( ) ;
40
+ GetComponentsInChildren < HorizontalOrVerticalLayoutGroup > ( ) ;
42
41
43
42
logEntryPrefab = GameObject . Find ( "ChatLogEntryPrefab" ) ;
44
43
logEntryPrefab . AddComponent < PlayerChatLogItem > ( ) ;
@@ -51,10 +50,7 @@ public IEnumerator SetupChatComponents()
51
50
inputField . gameObject . AddComponent < PlayerChatInputField > ( ) . InputField = inputField ;
52
51
inputField . GetComponentInChildren < Button > ( ) . onClick . AddListener ( playerChatManager . SendMessage ) ;
53
52
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 > ( ) } ;
58
54
59
55
yield return new WaitForEndOfFrame ( ) ; //Needed so Select() works on initialization
60
56
IsReady = true ;
@@ -92,6 +88,7 @@ public void Show()
92
88
PlayerChatInputField . ResetTimer ( ) ;
93
89
StartCoroutine ( ToggleChatFade ( true ) ) ;
94
90
}
91
+
95
92
public void Hide ( )
96
93
{
97
94
StartCoroutine ( ToggleChatFade ( false ) ) ;
0 commit comments