public void AppendConsoleText(MelonLog logLine) { if (_latestLogObject == null || !_latestLogObject.AppendText(logLine)) { _latestLogObject = new LogObject(_contentTransform); } if (!_menuParentRoot.active) { NotificationTab.NotifyNewLog(logLine); } }
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); }
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); }
public static void OnLog(MelonLog log) => AwaitingLogs.Add(log);