Add Visject per-node custom search and use it for Multi Blend nodes to filter animations used
This commit is contained in:
@@ -937,6 +937,22 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
|
|
||||||
UpdateUI();
|
UpdateUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override bool Search(string text)
|
||||||
|
{
|
||||||
|
FlaxEngine.Json.JsonSerializer.ParseID(text, out var id);
|
||||||
|
if (id != Guid.Empty)
|
||||||
|
{
|
||||||
|
for (int i = 5; i < Values.Length; i += 2)
|
||||||
|
{
|
||||||
|
if ((Guid)Values[i] == id)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.Search(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -862,6 +862,16 @@ namespace FlaxEditor.Surface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Custom function to check if node matches a given search query.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text">Text to check.</param>
|
||||||
|
/// <returns>True if node contains a given value.</returns>
|
||||||
|
public virtual bool Search(string text)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private string GetTooltip()
|
private string GetTooltip()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ namespace FlaxEngine.Windows.Search
|
|||||||
}
|
}
|
||||||
var nodeSearchText = node.ContentSearchText;
|
var nodeSearchText = node.ContentSearchText;
|
||||||
|
|
||||||
if (newTreeNodes.Count != 0 || (nodeSearchText != null && IsSearchMatch(ref nodeSearchText)))
|
if (newTreeNodes.Count != 0 || (nodeSearchText != null && IsSearchMatch(ref nodeSearchText)) || node.Search(_searchText))
|
||||||
{
|
{
|
||||||
AddAssetSearchResult(ref assetTreeNode, asset);
|
AddAssetSearchResult(ref assetTreeNode, asset);
|
||||||
var nodeTreeNode = new SearchResultTreeNode
|
var nodeTreeNode = new SearchResultTreeNode
|
||||||
|
|||||||
Reference in New Issue
Block a user