using System; using System.Collections; using System.Collections.Generic; using System.Linq; using NitroxClient.GameLogic.ChatUI; using NitroxClient.GameLogic.Settings; using NitroxModel.Core; using UnityEngine; using UnityEngine.UI; namespace NitroxClient.MonoBehaviours.Gui.Chat { public class PlayerChat : uGUI_InputGroup { private const int LINE_CHAR_LIMIT = 255; private const int MESSAGES_LIMIT = 64; private const float TOGGLED_TRANSPARENCY = 0.4f; public const float CHAT_VISIBILITY_TIME_LENGTH = 6f; private static readonly Queue entries = new Queue(); private Image[] backgroundImages; private CanvasGroup canvasGroup; private InputField inputField; private GameObject logEntryPrefab; private PlayerChatManager playerChatManager; private bool transparent; public static bool IsReady { get; private set; } public string InputText { get => inputField.text; set => inputField.text = value; } public IEnumerator SetupChatComponents() { playerChatManager = NitroxServiceLocator.LocateService(); canvasGroup = GetComponent(); logEntryPrefab = GameObject.Find("ChatLogEntryPrefab"); logEntryPrefab.AddComponent(); logEntryPrefab.SetActive(false); GetComponentsInChildren