Пример #1
0
 public virtual void OnEnable()
 {
     if (adminTools == null)
     {
         adminTools = FindObjectOfType <GUI_AdminTools>();
     }
     RefreshPage();
 }
Пример #2
0
 public virtual void OnEnable()
 {
     if (adminTools == null)
     {
         adminTools = FindObjectOfType <GUI_AdminTools>();                // TODO This causes a ~80ms frame hitch when the page is opened.
     }
     RefreshPage();
 }
Пример #3
0
        public void UpdateButton(AdminPlayerEntryData playerEntryData, GUI_AdminTools adminTools)
        {
            pendingMessages.AddRange(playerEntryData.newMessages);
            this.adminTools  = adminTools;
            PlayerData       = playerEntryData;
            displayName.text = $"{playerEntryData.name} - {playerEntryData.currentJob}. ACC: {playerEntryData.accountName} {playerEntryData.ipAddress}";

            if (PlayerData.newMessages.Count > 0)
            {
                msgPendingNot.SetActive(true);
                msgPendingCount.text = PlayerData.newMessages.Count.ToString();
            }
            else
            {
                msgPendingNot.SetActive(false);
            }

            if (PlayerData.isAntag)
            {
                displayName.color = antagTextColor;
            }
            else
            {
                displayName.color = Color.white;
            }

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

            if (adminTools.SelectedPlayer == playerEntryData.uid)
            {
                adminTools.AddPendingMessagesToLogs(playerEntryData.uid, GetPendingMessage());
            }
        }