Merge branch 'Visject-FixGroupFilterBreakingSmartFloats' of https://github.com/Chikinsupu/FlaxEngine into Chikinsupu-Visject-FixGroupFilterBreakingSmartFloats

This commit is contained in:
Wojtek Figat
2024-06-17 21:46:11 +02:00

View File

@@ -96,8 +96,12 @@ namespace FlaxEditor.Surface.ContextMenu
int dotIndex = filterText.IndexOf('.'); int dotIndex = filterText.IndexOf('.');
if (dotIndex != -1) if (dotIndex != -1)
{ {
// Early out and make the group invisible if it doesn't start with the specified string
string filterGroupName = filterText.Substring(0, dotIndex); string filterGroupName = filterText.Substring(0, dotIndex);
// If the string in front of the dot has the length of 0 or doesn't start with a letter we skip the filtering to make spawning floats work
if (filterGroupName.Length > 0 && char.IsLetter(filterGroupName[0]))
{
// Early out and make the group invisible if it doesn't start with the specified string
if (!Name.StartsWith(filterGroupName, StringComparison.InvariantCultureIgnoreCase)) if (!Name.StartsWith(filterGroupName, StringComparison.InvariantCultureIgnoreCase))
{ {
Visible = false; Visible = false;
@@ -107,6 +111,7 @@ namespace FlaxEditor.Surface.ContextMenu
filterText = filterText.Substring(dotIndex + 1); filterText = filterText.Substring(dotIndex + 1);
} }
} }
}
// Update items // Update items
bool isAnyVisible = false; bool isAnyVisible = false;