Ejemplo n.º 1
0
        public void AppendConsoleText(MelonLog logLine)
        {
            if (_latestLogObject == null || !_latestLogObject.AppendText(logLine))
            {
                _latestLogObject = new LogObject(_contentTransform);
            }

            if (!_menuParentRoot.active)
            {
                NotificationTab.NotifyNewLog(logLine);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public static void OnLog(MelonLog log) => AwaitingLogs.Add(log);