- Fixed some tooltip regressions

- Defined signatures where necessary
This commit is contained in:
Nils Hausfeld
2024-06-16 13:37:03 +02:00
parent 62778fc1e9
commit 4abe8587f3
5 changed files with 32 additions and 9 deletions

View File

@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlaxEditor.Scripting;
using FlaxEditor.Surface.Elements;
using FlaxEditor.Utilities;
@@ -62,7 +63,7 @@ namespace FlaxEditor.Surface.ContextMenu
Group = group;
_groupArchetype = groupArchetype;
_archetype = archetype;
TooltipText = $"{_archetype.Signature}\n{_archetype.Description}";
TooltipText = GetTooltip();
}
/// <summary>
@@ -323,6 +324,15 @@ namespace FlaxEditor.Surface.ContextMenu
Group.ContextMenu.SetDescriptionPanelArchetype(_archetype);
}
private string GetTooltip()
{
StringBuilder sb = new StringBuilder();
if (!string.IsNullOrEmpty(_archetype.Signature))
sb.Append(_archetype.Signature + "\n");
sb.Append(_archetype.Description);
return sb.ToString();
}
/// <inheritdoc />
public override bool OnMouseDown(Float2 location, MouseButton button)
{