Validator: Skipping render pipeline check on shader, fi no RenderPipeline tag is found
Validator: Skipping textures in material, if marked as PerRendererData, HideInInspector or NonModifiableTextureData Validator: Fixed issue, where arrays weren't iterated correctly, which resulted in an exception Window: Added warning and error count
This commit is contained in:
parent
9dd45f536e
commit
eb46c22ffc
7 changed files with 93 additions and 12 deletions
|
|
@ -8,12 +8,18 @@ namespace Module.ProjectValidator.Editor
|
|||
{
|
||||
internal sealed class EditorProjectValidatorWindow : EditorWindow
|
||||
{
|
||||
private VisualElement _groupWarnings;
|
||||
private Label _labelWarnings;
|
||||
|
||||
private VisualElement _groupErrors;
|
||||
private Label _labelErrors;
|
||||
|
||||
private MultiColumnTreeView _treeView;
|
||||
private string _searchFilter;
|
||||
|
||||
|
||||
private readonly List<TreeViewItemData<Report.Entry>> _list = new();
|
||||
private readonly List<TreeViewItemData<Report.Entry>> _filteredList = new();
|
||||
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
|
|
@ -21,6 +27,15 @@ namespace Module.ProjectValidator.Editor
|
|||
root.styleSheets.Add(EditorAssetUtility.LoadFirstAsset<StyleSheet>("StyleSheetEditorProjectValidatorWindow"));
|
||||
root.Add(asset.Instantiate());
|
||||
|
||||
_groupWarnings = root.Q<VisualElement>("status-warnings");
|
||||
_labelWarnings = _groupWarnings.Q<Label>("label-warnings");
|
||||
|
||||
_groupErrors = root.Q<VisualElement>("status-errors");
|
||||
_labelErrors = _groupErrors.Q<Label>("label-errors");
|
||||
|
||||
_groupWarnings.style.display = DisplayStyle.None;
|
||||
_groupErrors.style.display = DisplayStyle.None;
|
||||
|
||||
root.Q<ToolbarButton>("button-run").clicked += OnToolbarButtonRunClicked;
|
||||
root.Q<ToolbarButton>("button-clear").clicked += OnToolbarButtonClearClicked;
|
||||
root.Q<ToolbarSearchField>().RegisterValueChangedCallback(OnToolbarSearchFieldChanged);
|
||||
|
|
@ -61,11 +76,26 @@ namespace Module.ProjectValidator.Editor
|
|||
|
||||
_list.Clear();
|
||||
|
||||
for (var i = 0; i < Report.Active.Entries.Count; i++)
|
||||
var entries = Report.Active.Entries;
|
||||
var warningCount = 0;
|
||||
var errorCount = 0;
|
||||
|
||||
for (var i = 0; i < entries.Count; i++)
|
||||
{
|
||||
_list.Add(new TreeViewItemData<Report.Entry>(i, Report.Active.Entries[i]));
|
||||
_list.Add(new TreeViewItemData<Report.Entry>(i, entries[i]));
|
||||
|
||||
if (entries[i].Severity == EValidatorSeverity.Warning)
|
||||
warningCount++;
|
||||
if (entries[i].Severity == EValidatorSeverity.Error)
|
||||
errorCount++;
|
||||
}
|
||||
|
||||
_groupWarnings.style.display = warningCount > 0 ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
_labelWarnings.text = warningCount.ToString();
|
||||
|
||||
_groupErrors.style.display = errorCount > 0 ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
_labelErrors.text = errorCount.ToString();
|
||||
|
||||
Filter();
|
||||
}
|
||||
|
||||
|
|
@ -124,6 +154,8 @@ namespace Module.ProjectValidator.Editor
|
|||
|
||||
private void OnToolbarButtonClearClicked()
|
||||
{
|
||||
_groupWarnings.style.display = DisplayStyle.None;
|
||||
_groupErrors.style.display = DisplayStyle.None;
|
||||
ValidatorRunner.Clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue