- Now removing <see cref> tags from tooltips

- Capitalizing the first character of inputs/outpus
- Removing & chars from input/output types to make it easier to read
- Moving description signature down to make items without a description look less ugly
This commit is contained in:
Nils Hausfeld
2024-06-19 20:56:25 +02:00
parent a808ac5dc8
commit cb1324fc2d
2 changed files with 17 additions and 4 deletions

View File

@@ -316,7 +316,9 @@ namespace FlaxEditor.Modules.SourceCodeEditing
var memberReader = xmlReader.ReadSubtree();
if (memberReader.ReadToDescendant("summary"))
{
result[rawName] = memberReader.ReadInnerXml().Replace('\n', ' ').Trim();
// Remove <see cref=""/> and replace them with the captured group (the content of the cref). Additionally, getting rid of prefixes
const string crefPattern = @"<see\s+cref=""(?:[A-Z]:FlaxEngine\.)?([^""]+)""\s*\/>";
result[rawName] = Regex.Replace(memberReader.ReadInnerXml(), crefPattern, "$1").Replace('\n', ' ').Trim();
}
}
}

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.GUI.Input;
using FlaxEditor.Scripting;
@@ -897,8 +898,17 @@ namespace FlaxEditor.Surface.ContextMenu
float panelHeight = _descriptionSignatureLabel.Height;
_descriptionLabel.Y = _descriptionSignatureLabel.Bounds.Bottom + 6f;
_descriptionLabel.Text = archetype.Description;
if (string.IsNullOrEmpty(archetype.Description))
{
_descriptionSignatureLabel.Y = 15;
_descriptionLabel.Text = "";
}
else
{
_descriptionSignatureLabel.Y = 8;
_descriptionLabel.Y = _descriptionSignatureLabel.Bounds.Bottom + 6f;
_descriptionLabel.Text = Regex.Replace(archetype.Description, @"\s{2,}", "\n");
}
_descriptionPanelSeparator.Y = _descriptionLabel.Bounds.Bottom + 8f;
@@ -938,7 +948,8 @@ namespace FlaxEditor.Surface.ContextMenu
MouseOverColor = typeColor,
AutoFocus = false,
}).SetAnchorPreset(AnchorPresets.TopLeft, true);
text = (char.ToUpper(text[0]) + text.Substring(1)).Replace("&", "");
var elementText = new Label(16, 0, Width * 0.5f - 32, 16)
{
Text = text,