Add improved tooltips to Visual Script types with file name

This commit is contained in:
2026-09-30 20:51:05 +02:00
parent 6448ae8e37
commit 21e17c3d9b
@@ -50,6 +50,8 @@ namespace FlaxEditor.Modules.SourceCodeEditing
if (attributes == null)
attributes = type.GetAttributes(false);
text = type.TypeName;
if (type.IScriptType is Content.VisualScriptType visualScriptType && visualScriptType.Asset)
text = $"{System.IO.Path.GetFileNameWithoutExtension(visualScriptType.Asset.Path)}\n{text}";
var tooltip = (TooltipAttribute)attributes.FirstOrDefault(x => x is TooltipAttribute);
if (tooltip != null)
text += '\n' + tooltip.Text;