Пример #1
0
        public void UpdateButton(AdminPlayerEntryData playerEntryData, Action <AdminPlayerEntry> onClickEvent, GUI_Notification masterNotification = null,
                                 bool disableInteract = false, bool hideSensitiveFields = false)
        {
            parentNotification = masterNotification;
            OnClickEvent       = onClickEvent;
            PlayerData         = playerEntryData;
            if (!hideSensitiveFields)
            {
                displayName.text = $"{playerEntryData.name} - {playerEntryData.currentJob}. ACC: {playerEntryData.accountName} {playerEntryData.ipAddress} UUID { playerEntryData.uid}";
            }
            else
            {
                displayName.text = $"{playerEntryData.accountName}";
            }
            if (PlayerData.isAntag && !hideSensitiveFields)
            {
                displayName.color = antagTextColor;
            }
            else
            {
                displayName.color = Color.white;
            }

            if (PlayerData.isAdmin)
            {
                displayName.fontStyle = FontStyle.Bold;
            }
            else
            {
                displayName.fontStyle = FontStyle.Normal;
            }

            if (PlayerData.ipAddress == "")
            {
                offlineNot.SetActive(true);
            }
            else
            {
                offlineNot.SetActive(false);
            }

            if (disableInteract)
            {
                button.interactable = false;
                bg.color            = selectedColor;
            }
            else
            {
                button.interactable = true;
            }

            RefreshNotification();
        }