Visual scripting - Added pin disconnect with MMB

Visual scripting - Added min and max node
This commit is contained in:
Robert committed 2022-08-01 22:26:11 +02:00
1 parent b6e0c0fb66
commit dc17253518
15 files changed
+164 -21

No files matched your search

@@ -8,19 +8,19 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15"/>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15"/>
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14"/>
<PackageReference Include="Ninject" Version="3.3.4"/>
<PackageReference Include="NoStringEvaluating" Version="2.2.2"/>
<PackageReference Include="ReactiveUI" Version="17.1.50"/>
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1"/>
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.1"/>
<PackageReference Include="Avalonia" Version="0.10.15" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="NoStringEvaluating" Version="2.2.2" />
<PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj"/>
<ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj"/>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />
<ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj" />
</ItemGroup>
<ItemGroup>
@@ -0,0 +1,35 @@
using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Mathematics;
[Node("Max", "Outputs the largest of the connected numeric values.", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
public class MaxNumericsNode : Node
{
#region Constructors
public MaxNumericsNode()
: base("Max", "Outputs the largest of the connected numeric values.")
{
Values = CreateInputPinCollection<Numeric>("Values", 2);
Max = CreateOutputPin<Numeric>("Max");
}
#endregion
#region Methods
public override void Evaluate()
{
Max.Value = Values.Values.Max();
}
#endregion
#region Properties & Fields
public InputPinCollection<Numeric> Values { get; }
public OutputPin<Numeric> Max { get; }
#endregion
}
@@ -0,0 +1,35 @@
using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Mathematics;
[Node("Min", "Outputs the smallest of the connected numeric values.", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
public class MinNumericsNode : Node
{
#region Constructors
public MinNumericsNode()
: base("Min", "Outputs the smallest of the connected numeric values.")
{
Values = CreateInputPinCollection<Numeric>("Values", 2);
Min = CreateOutputPin<Numeric>("Min");
}
#endregion
#region Methods
public override void Evaluate()
{
Min.Value = Values.Values.Min();
}
#endregion
#region Properties & Fields
public InputPinCollection<Numeric> Values { get; }
public OutputPin<Numeric> Min { get; }
#endregion
}