コード例 #1
0
        // Token: 0x06001327 RID: 4903 RVA: 0x0007A114 File Offset: 0x00078514
        private void refreshMessages()
        {
            for (int i = 0; i < this.logContainer.childCount; i++)
            {
                if (!(this.logContainer.GetChild(i).gameObject == this.logTemplate))
                {
                    UnityEngine.Object.Destroy(this.logContainer.GetChild(i).gameObject);
                }
            }
            this.logMessages.Clear();
            IList <TerminalLogCategory> logs = Terminal.getLogs();

            for (int j = 0; j < logs.Count; j++)
            {
                TerminalLogCategory terminalLogCategory = logs[j];
                if (terminalLogCategory.isVisible)
                {
                    for (int k = 0; k < terminalLogCategory.messages.Count; k++)
                    {
                        TerminalLogMessage item = terminalLogCategory.messages[k];
                        int num = this.logMessages.BinarySearch(item, this.logMessageTimestampComparer);
                        if (num < 0)
                        {
                            num = ~num;
                        }
                        this.logMessages.Insert(num, item);
                    }
                }
            }
            for (int l = 0; l < this.logMessages.Count; l++)
            {
                TerminalLogMessage message = this.logMessages[l];
                this.addMessage(message);
            }
        }
コード例 #2
0
 // Token: 0x0600132C RID: 4908 RVA: 0x0007A288 File Offset: 0x00078688
 private void onMessageAdded(TerminalLogMessage message, TerminalLogCategory category)
 {
     if (!category.isVisible)
     {
         return;
     }
     this.addMessage(message);
 }
コード例 #3
0
 // Token: 0x0600132A RID: 4906 RVA: 0x0007A26C File Offset: 0x0007866C
 private void onCategoryCleared(TerminalLogCategory category)
 {
     if (!category.isVisible)
     {
         return;
     }
     this.refreshMessages();
 }
コード例 #4
0
ファイル: CommandWindow.cs プロジェクト: sky-xk-nge/Unturned
 private void onMessageAdded(TerminalLogMessage message, TerminalLogCategory category)
 {
     if (string.IsNullOrEmpty(message.internalText))
     {
         return;
     }
     CommandWindow.Log(category.internalName + ": " + message.internalText);
 }
コード例 #5
0
        // Token: 0x06001326 RID: 4902 RVA: 0x0007A020 File Offset: 0x00078420
        private void refreshCategories()
        {
            for (int i = 0; i < this.filterToggles.Count; i++)
            {
                this.filterToggles[i].onTerminalFilterChanged -= this.onTerminalFilterChanged;
                this.filterToggles[i].onTerminalFilterCleared -= this.onTerminalFilterCleared;
            }
            this.filterToggles.Clear();
            for (int j = 0; j < this.filterContainer.childCount; j++)
            {
                if (!(this.filterContainer.GetChild(j).gameObject == this.filterTemplate))
                {
                    UnityEngine.Object.Destroy(this.filterContainer.GetChild(j).gameObject);
                }
            }
            IList <TerminalLogCategory> logs = Terminal.getLogs();

            for (int k = 0; k < logs.Count; k++)
            {
                TerminalLogCategory category = logs[k];
                this.addCategory(category);
            }
        }
コード例 #6
0
ファイル: Logs.cs プロジェクト: sky-xk-nge/Unturned
        private void onMessageAdded(TerminalLogMessage message, TerminalLogCategory category)
        {
            if (this.stream == null || this.writer == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(message.internalText))
            {
                return;
            }
            DateTime dateTime = new DateTime(message.timestamp);
            string   text     = dateTime.ToString("HH:mm:ss - dd/MM/yyyy");

            this.writer.WriteLine(string.Concat(new string[]
            {
                "[",
                text,
                "] ",
                category.internalName,
                ": ",
                message.internalText
            }));
        }
コード例 #7
0
        // Token: 0x06001324 RID: 4900 RVA: 0x00079E7C File Offset: 0x0007827C
        private void addCategory(TerminalLogCategory category)
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.filterTemplate);

            gameObject.name = "Category";
            gameObject.SetActive(true);
            Toggle component = gameObject.transform.FindChild("Toggle").GetComponent <Toggle>();

            component.isOn = category.isVisible;
            Text component2 = gameObject.transform.FindChild("Label").GetComponent <Text>();

            component2.text = category.displayName;
            Button        component3    = gameObject.transform.FindChild("Clear_Button").GetComponent <Button>();
            RectTransform rectTransform = gameObject.transform as RectTransform;

            rectTransform.SetParent(this.filterContainer, false);
            rectTransform.offsetMin = new Vector2(5f, (float)this.filterToggles.Count * -50f - 45f);
            rectTransform.offsetMax = new Vector2(-5f, (float)this.filterToggles.Count * -50f - 5f);
            TerminalFilterToggle terminalFilterToggle = new TerminalFilterToggle(category.internalName, component, component3);

            terminalFilterToggle.onTerminalFilterChanged += this.onTerminalFilterChanged;
            terminalFilterToggle.onTerminalFilterCleared += this.onTerminalFilterCleared;
            this.filterToggles.Add(terminalFilterToggle);
        }
コード例 #8
0
 // Token: 0x0600132B RID: 4907 RVA: 0x0007A280 File Offset: 0x00078680
 private void onCategoryAdded(TerminalLogCategory category)
 {
     this.refreshCategories();
 }
コード例 #9
0
 // Token: 0x06001328 RID: 4904 RVA: 0x0007A250 File Offset: 0x00078650
 private void onCategoryVisibilityChanged(TerminalLogCategory category)
 {
     this.refreshCategories();
     this.refreshMessages();
 }