update forge
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 27s
Create tag and build when new code gets to main / Export (push) Successful in 7m25s

This commit is contained in:
2026-05-17 00:06:44 +02:00
parent 8b54f00814
commit e09714cf83
473 changed files with 13577 additions and 767 deletions

View File

@@ -36,19 +36,61 @@ internal static class StatescriptResolverRegistry
/// <returns>A list of compatible resolver editor factories.</returns>
public static List<Func<NodeEditorProperty>> GetCompatibleFactories(Type expectedType)
{
var result = new List<Func<NodeEditorProperty>>();
return [.. _factories.Where(factory => IsCompatibleFactory(factory, expectedType))];
}
foreach (Func<NodeEditorProperty> factory in _factories)
public static int GetDefaultFactoryIndex(List<Func<NodeEditorProperty>> factories, bool isArray)
{
for (int i = 0; i < factories.Count; i++)
{
using NodeEditorProperty temp = factory();
if (temp.IsCompatibleWith(expectedType))
if (isArray)
{
result.Add(factory);
if (GetResolverTypeId(factories[i]) == "ArrayVariable")
{
return i;
}
}
else if (GetResolverTypeId(factories[i]) == "Variant")
{
return i;
}
}
return result;
return 0;
}
public static string GetDisplayName(Func<NodeEditorProperty> factory)
{
return UseTemporaryEditor(factory, static editor => editor.DisplayName);
}
public static string GetResolverTypeId(Func<NodeEditorProperty> factory)
{
return UseTemporaryEditor(factory, static editor => editor.ResolverTypeId);
}
public static bool IsCompatibleFactory(Func<NodeEditorProperty> factory, Type expectedType)
{
return UseTemporaryEditor(factory, editor => editor.IsCompatibleWith(expectedType));
}
private static TResult UseTemporaryEditor<TResult>(
Func<NodeEditorProperty> factory,
Func<NodeEditorProperty, TResult> selector)
{
NodeEditorProperty editor = factory();
try
{
return selector(editor);
}
finally
{
if (global::Godot.GodotObject.IsInstanceValid(editor))
{
editor.Free();
}
}
}
}
#endif