add comment around asset from which asset reference graph originates
This commit is contained in:
@@ -140,8 +140,9 @@ namespace FlaxEditor.Windows
|
|||||||
}
|
}
|
||||||
|
|
||||||
private string _cacheFolder;
|
private string _cacheFolder;
|
||||||
private Guid _assetId;
|
private AssetItem _item;
|
||||||
private Surface _surface;
|
private Surface _surface;
|
||||||
|
private AssetNode _rootAssetNode;
|
||||||
private Label _loadingLabel;
|
private Label _loadingLabel;
|
||||||
private CancellationTokenSource _token;
|
private CancellationTokenSource _token;
|
||||||
private Task _task;
|
private Task _task;
|
||||||
@@ -163,13 +164,13 @@ namespace FlaxEditor.Windows
|
|||||||
public AssetReferencesGraphWindow(Editor editor, AssetItem assetItem)
|
public AssetReferencesGraphWindow(Editor editor, AssetItem assetItem)
|
||||||
: base(editor, false, ScrollBars.None)
|
: base(editor, false, ScrollBars.None)
|
||||||
{
|
{
|
||||||
Title = assetItem.ShortName + " References";
|
_item = assetItem;
|
||||||
|
Title = _item.ShortName + " References";
|
||||||
|
|
||||||
_tempFolder = StringUtils.NormalizePath(Path.GetDirectoryName(Globals.TemporaryFolder));
|
_tempFolder = StringUtils.NormalizePath(Path.GetDirectoryName(Globals.TemporaryFolder));
|
||||||
_cacheFolder = Path.Combine(Globals.ProjectCacheFolder, "References");
|
_cacheFolder = Path.Combine(Globals.ProjectCacheFolder, "References");
|
||||||
if (!Directory.Exists(_cacheFolder))
|
if (!Directory.Exists(_cacheFolder))
|
||||||
Directory.CreateDirectory(_cacheFolder);
|
Directory.CreateDirectory(_cacheFolder);
|
||||||
_assetId = assetItem.ID;
|
|
||||||
_surface = new Surface(this)
|
_surface = new Surface(this)
|
||||||
{
|
{
|
||||||
AnchorPreset = AnchorPresets.StretchAll,
|
AnchorPreset = AnchorPresets.StretchAll,
|
||||||
@@ -194,6 +195,10 @@ namespace FlaxEditor.Windows
|
|||||||
_nodesAssets.Add(assetId);
|
_nodesAssets.Add(assetId);
|
||||||
var node = new AssetNode((uint)_nodes.Count + 1, _surface.Context, GraphNodes[0], GraphGroups[0], assetId);
|
var node = new AssetNode((uint)_nodes.Count + 1, _surface.Context, GraphNodes[0], GraphGroups[0], assetId);
|
||||||
_nodes.Add(node);
|
_nodes.Add(node);
|
||||||
|
|
||||||
|
if (assetId == _item.ID)
|
||||||
|
_rootAssetNode = node;
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,8 +397,7 @@ namespace FlaxEditor.Windows
|
|||||||
_nodesAssets = new HashSet<Guid>();
|
_nodesAssets = new HashSet<Guid>();
|
||||||
var searchLevel = 4; // TODO: make it as an option (somewhere in window UI)
|
var searchLevel = 4; // TODO: make it as an option (somewhere in window UI)
|
||||||
// TODO: add option to filter assets by type (eg. show only textures as leaf nodes)
|
// TODO: add option to filter assets by type (eg. show only textures as leaf nodes)
|
||||||
var assetNode = SpawnNode(_assetId);
|
var assetNode = SpawnNode(_item.ID);
|
||||||
// TODO: add some outline or tint color to the main node
|
|
||||||
BuildGraph(assetNode, searchLevel, false);
|
BuildGraph(assetNode, searchLevel, false);
|
||||||
ArrangeGraph(assetNode, false);
|
ArrangeGraph(assetNode, false);
|
||||||
BuildGraph(assetNode, searchLevel, true);
|
BuildGraph(assetNode, searchLevel, true);
|
||||||
@@ -402,6 +406,13 @@ namespace FlaxEditor.Windows
|
|||||||
return;
|
return;
|
||||||
_progress = 100.0f;
|
_progress = 100.0f;
|
||||||
|
|
||||||
|
if (_rootAssetNode != null)
|
||||||
|
{
|
||||||
|
var commentRect = _rootAssetNode.EditorBounds;
|
||||||
|
commentRect.Expand(80f);
|
||||||
|
_surface.Context.CreateComment(ref commentRect, _item.ShortName, Color.Green);
|
||||||
|
}
|
||||||
|
|
||||||
// Update UI
|
// Update UI
|
||||||
FlaxEngine.Scripting.InvokeOnUpdate(() =>
|
FlaxEngine.Scripting.InvokeOnUpdate(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user