1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Visual Scripting: Improved cable creation

This commit is contained in:
Darth Affe 2021-07-16 16:17:15 +02:00
parent d27ce2bdf9
commit 1e67c1c567
2 changed files with 7 additions and 4 deletions

View File

@ -177,7 +177,9 @@ namespace Artemis.VisualScripting.Editor.Controls
args.Handled = true;
}
private bool IsTypeCompatible(Type type) => ((Pin.Pin.Direction == PinDirection.Input) && (Pin.Pin.Type == typeof(object))) || (Pin.Pin.Type == type);
private bool IsTypeCompatible(Type type) => (Pin.Pin.Type == type)
|| ((Pin.Pin.Direction == PinDirection.Input) && (Pin.Pin.Type == typeof(object)))
|| ((Pin.Pin.Direction == PinDirection.Output) && (type == typeof(object)));
#endregion
}

View File

@ -8,17 +8,18 @@ namespace Artemis.VisualScripting.Internal
#region Properties & Fields
public override PinDirection Direction { get; }
public override Type Type { get; } = typeof(object);
public override Type Type { get; }
public override object PinValue => null;
#endregion
#region Constructors
public IsConnectingPin(PinDirection direction)
public IsConnectingPin(PinDirection direction, Type type)
: base(null, null)
{
this.Direction = direction;
this.Type = type;
}
#endregion