- Moved convertible node file out of archetypes folder into surface folder to be more in line of the project structure (other special nodes like surfacecomment are also just in the surface folder)

- Cleanup
This commit is contained in:
Nils Hausfeld
2023-10-21 13:11:42 +02:00
parent 7cb4d27979
commit 571f8febf4

View File

@@ -1,12 +1,11 @@
using System;
using System.Linq;
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
using FlaxEditor.Surface.Elements;
using FlaxEditor.Surface.Undo;
using FlaxEngine;
namespace FlaxEditor.Surface.Archetypes
namespace FlaxEditor.Surface
{
/// <summary>
/// A special type of node that adds the functionality to convert nodes to parameters
@@ -52,7 +51,7 @@ namespace FlaxEditor.Surface.Archetypes
{
Window = window,
IsAdd = true,
Name = Utilities.Utils.IncrementNameNumber("New parameter", x => OnParameterRenameValidate(null, x)),
Name = Utilities.Utils.IncrementNameNumber("New parameter", x => OnParameterRenameValidate(x)),
Type = _type,
Index = paramIndex,
InitValue = initValue,
@@ -67,7 +66,7 @@ namespace FlaxEditor.Surface.Archetypes
SurfaceNode node = Surface.Context.SpawnNode(groupId, arch.TypeID, this.Location, new object[] { parameterGuid });
Surface.Undo.Enabled = undoEnabled;
if (node is not Parameters.SurfaceNodeParamsGet getNode)
if (node is not Archetypes.Parameters.SurfaceNodeParamsGet getNode)
throw new Exception("Node is not a ParamsGet node!");
// Recreate connections of constant node
@@ -98,7 +97,7 @@ namespace FlaxEditor.Surface.Archetypes
removeConstantAction.Do();
}
private bool OnParameterRenameValidate(RenamePopup popup, string value)
private bool OnParameterRenameValidate(string value)
{
if (Surface.Owner is not IVisjectSurfaceWindow window)
throw new Exception("Surface owner is not a Visject Surface Window");