Files
bluflame/intromat/Intromat/ViewModels/CodeGenInputViewModel.cs
2026-04-18 22:31:51 +02:00

40 lines
1.0 KiB
C#

using NodeNetwork.Toolkit.ValueNode;
using NodeNetwork.ViewModels;
using NodeNetwork.Views;
using ReactiveUI;
using Splat;
namespace Intromat.ViewModels
{
public class CodeGenInputViewModel<T> : ValueNodeInputViewModel<T>
{
private bool _isMouseOver;
static CodeGenInputViewModel()
{
Locator.CurrentMutable.Register(() => new NodeInputView(), typeof(IViewFor<CodeGenInputViewModel<T>>));
}
public CodeGenInputViewModel(EPortType type)
{
var port = new CodeGenPortViewModel { PortType = type };
Port = port;
if (type == EPortType.Execution)
{
port.IsPortVisible = true;
PortPosition = PortPosition.Right;
}
else if (type == EPortType.Texture)
{
port.IsPortVisible = true;
}
}
public bool IsMouseOver
{
get => _isMouseOver;
set => this.RaiseAndSetIfChanged(ref _isMouseOver, value);
}
}
}