/// <summary> /// Shows a small panel with a summary of errors. Intended for inclusion at the top of /// each GUI panel. /// </summary> private void ShowStatusSummaryGUI() { int totalOKCount = Validations.CountOK; int notIgnoredOKCount = Validations.GetOKs(ignoredTests).Count(); int totalWarningCount = Validations.CountWarning; int notIgnoredWarningCount = Validations.GetWarnings(ignoredTests).Count(); int totalErrorCount = Validations.CountError; int notIgnoredErrorCount = Validations.GetErrors(ignoredTests).Count(); string title = "Errors: " + notIgnoredErrorCount + " + (" + (totalErrorCount - notIgnoredErrorCount) + " ignored)\n"; title += "Warnings: " + notIgnoredWarningCount + " + (" + (totalWarningCount - notIgnoredWarningCount) + " ignored)\n"; title += "OK: " + totalOKCount; MessageType type = MessageType.Info; ValidationResult result; if (notIgnoredErrorCount > 0) { type = MessageType.Error; result = Validations.GetHighestPriorityErrorOrWarning(ignoredTests); titleContent.image = iconError; } else if (notIgnoredWarningCount > 0) { type = MessageType.Warning; result = Validations.GetHighestPriorityErrorOrWarning(ignoredTests); titleContent.image = iconWarning; } else { title = "Everything looks to be set up correctly.\n"; title += (totalErrorCount - notIgnoredErrorCount) + " ignored errors.\n"; title += (totalWarningCount - notIgnoredWarningCount) + " ignored warnings.\n"; titleContent.image = iconOK; result = null; } EditorGUILayout.HelpBox(title, type); if (result != null) { ValidationResultGUI(result); } }