예제 #1
0
        public void AppendConsoleText(MelonLog logLine)
        {
            if (_latestLogObject == null || !_latestLogObject.AppendText(logLine))
            {
                _latestLogObject = new LogObject(_contentTransform);
            }

            if (!_menuParentRoot.active)
            {
                NotificationTab.NotifyNewLog(logLine);
            }
        }
예제 #2
0
        public bool AppendText(MelonLog logLine)
        {
            if (ConsoleTextPrefab == null || _textComponent == null || _textComponent.text.Length > 50000)
            {
                return(false);
            }

            if (_textComponent.text.Length > 0)
            {
                _textComponent.text += "\n";                                    // Only add a newline when there's text above
            }
            _textComponent.text += logLine;
            return(true);
        }
예제 #3
0
        public void NotifyNewLog(MelonLog log)
        {
            if (_pendingLogNotifs.ContainsKey(log.LogType))
            {
                _pendingLogNotifs[log.LogType] += 1;
            }
            else
            {
                _pendingLogNotifs.Add(log.LogType, 1);
            }

            if (!_pendingLogNotifs.ContainsKey(MelonLogType.Error))
            {
                return;
            }

            _tabImage.color = Color.red;
            _tabText.text   = _pendingLogNotifs[MelonLogType.Error].ToString();
            _badgeObject.SetActive(true);
        }
예제 #4
0
 public static void OnLog(MelonLog log) => AwaitingLogs.Add(log);