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

Merge branch 'master' into feature/gh-actions

This commit is contained in:
Robert 2023-01-15 12:28:26 +01:00
commit 3246505cc0
21 changed files with 111 additions and 27 deletions

View File

@ -44,9 +44,9 @@
<PackageReference Include="Ninject" Version="3.3.6" /> <PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="Ninject.Extensions.ChildKernel" Version="3.3.0" /> <PackageReference Include="Ninject.Extensions.ChildKernel" Version="3.3.0" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" /> <PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Layout" Version="1.0.0" />
<PackageReference Include="RGB.NET.Presets" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Presets" Version="1.0.0" />
<PackageReference Include="Serilog" Version="2.11.0" /> <PackageReference Include="Serilog" Version="2.11.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" /> <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" /> <PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />

View File

@ -62,8 +62,8 @@ public static class Constants
/// <summary> /// <summary>
/// The current API version for plugins /// The current API version for plugins
/// </summary> /// </summary>
public static readonly int PluginApiVersion = int.Parse(CoreAssembly.GetCustomAttributes<AssemblyMetadataAttribute>() public static readonly int PluginApiVersion = int.Parse(CoreAssembly.GetCustomAttributes<AssemblyMetadataAttribute>().First(a => a.Key == "PluginApiVersion").Value ??
.First(a => a.Key == "PluginApiVersion").Value); throw new InvalidOperationException("Cannot find PluginApiVersion metadata in assembly"));
/// <summary> /// <summary>
/// The plugin info used by core components of Artemis /// The plugin info used by core components of Artemis

View File

@ -10,9 +10,9 @@ namespace Artemis.Core.JsonConverters
/// </summary> /// </summary>
internal class ForgivingVersionConverter : VersionConverter internal class ForgivingVersionConverter : VersionConverter
{ {
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{ {
object obj = base.ReadJson(reader, objectType, existingValue, serializer); object? obj = base.ReadJson(reader, objectType, existingValue, serializer);
if (obj is not Version v) if (obj is not Version v)
return obj; return obj;

View File

@ -24,6 +24,8 @@ public sealed class Profile : ProfileElement
_scripts = new ObservableCollection<ProfileScript>(); _scripts = new ObservableCollection<ProfileScript>();
_scriptConfigurations = new ObservableCollection<ScriptConfiguration>(); _scriptConfigurations = new ObservableCollection<ScriptConfiguration>();
Opacity = 0d;
ShouldDisplay = true;
Configuration = configuration; Configuration = configuration;
Profile = this; Profile = this;
ProfileEntity = profileEntity; ProfileEntity = profileEntity;
@ -81,6 +83,10 @@ public sealed class Profile : ProfileElement
internal List<Exception> Exceptions { get; } internal List<Exception> Exceptions { get; }
internal bool ShouldDisplay { get; set; }
internal double Opacity { get; private set; }
/// <inheritdoc /> /// <inheritdoc />
public override void Update(double deltaTime) public override void Update(double deltaTime)
{ {
@ -97,6 +103,13 @@ public sealed class Profile : ProfileElement
foreach (ProfileScript profileScript in Scripts) foreach (ProfileScript profileScript in Scripts)
profileScript.OnProfileUpdated(deltaTime); profileScript.OnProfileUpdated(deltaTime);
const double OPACITY_PER_SECOND = 1;
if (ShouldDisplay && Opacity < 1)
Opacity = Math.Clamp(Opacity + OPACITY_PER_SECOND * deltaTime, 0d, 1d);
if (!ShouldDisplay && Opacity > 0)
Opacity = Math.Clamp(Opacity - OPACITY_PER_SECOND * deltaTime, 0d, 1d);
} }
} }
@ -111,9 +124,25 @@ public sealed class Profile : ProfileElement
foreach (ProfileScript profileScript in Scripts) foreach (ProfileScript profileScript in Scripts)
profileScript.OnProfileRendering(canvas, canvas.LocalClipBounds); profileScript.OnProfileRendering(canvas, canvas.LocalClipBounds);
SKPaint? opacityPaint = null;
bool applyOpacityLayer = Configuration.FadeInAndOut && Opacity < 1;
if (applyOpacityLayer)
{
opacityPaint = new SKPaint();
opacityPaint.Color = new SKColor(0, 0, 0, (byte)(255d * Easings.CubicEaseInOut(Opacity)));
canvas.SaveLayer(opacityPaint);
}
foreach (ProfileElement profileElement in Children) foreach (ProfileElement profileElement in Children)
profileElement.Render(canvas, basePosition, editorFocus); profileElement.Render(canvas, basePosition, editorFocus);
if (applyOpacityLayer)
{
canvas.Restore();
opacityPaint?.Dispose();
}
foreach (ProfileScript profileScript in Scripts) foreach (ProfileScript profileScript in Scripts)
profileScript.OnProfileRendered(canvas, canvas.LocalClipBounds); profileScript.OnProfileRendered(canvas, canvas.LocalClipBounds);

View File

@ -21,6 +21,7 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable
private bool _isBeingEdited; private bool _isBeingEdited;
private bool _isMissingModule; private bool _isMissingModule;
private bool _isSuspended; private bool _isSuspended;
private bool _fadeInAndOut;
private Module? _module; private Module? _module;
private string _name; private string _name;
@ -160,6 +161,15 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable
internal set => SetAndNotify(ref _profile, value); internal set => SetAndNotify(ref _profile, value);
} }
/// <summary>
/// Gets or sets a boolean indicating whether this profile should fade in and out when enabling or disabling
/// </summary>
public bool FadeInAndOut
{
get => _fadeInAndOut;
set => SetAndNotify(ref _fadeInAndOut, value);
}
/// <summary> /// <summary>
/// Gets or sets the module this profile uses /// Gets or sets the module this profile uses
/// </summary> /// </summary>
@ -272,6 +282,7 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable
IsSuspended = Entity.IsSuspended; IsSuspended = Entity.IsSuspended;
ActivationBehaviour = (ActivationBehaviour) Entity.ActivationBehaviour; ActivationBehaviour = (ActivationBehaviour) Entity.ActivationBehaviour;
HotkeyMode = (ProfileConfigurationHotkeyMode) Entity.HotkeyMode; HotkeyMode = (ProfileConfigurationHotkeyMode) Entity.HotkeyMode;
FadeInAndOut = Entity.FadeInAndOut;
Order = Entity.Order; Order = Entity.Order;
Icon.Load(); Icon.Load();
@ -294,6 +305,7 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable
Entity.ActivationBehaviour = (int) ActivationBehaviour; Entity.ActivationBehaviour = (int) ActivationBehaviour;
Entity.HotkeyMode = (int) HotkeyMode; Entity.HotkeyMode = (int) HotkeyMode;
Entity.ProfileCategoryId = Category.Entity.Id; Entity.ProfileCategoryId = Category.Entity.Id;
Entity.FadeInAndOut = FadeInAndOut;
Entity.Order = Order; Entity.Order = Order;
Icon.Save(); Icon.Save();

View File

@ -18,7 +18,6 @@ namespace Artemis.Core;
public class PluginFeatureInfo : CorePropertyChanged, IPrerequisitesSubject public class PluginFeatureInfo : CorePropertyChanged, IPrerequisitesSubject
{ {
private string? _description; private string? _description;
private string? _icon;
private PluginFeature? _instance; private PluginFeature? _instance;
private Exception? _loadException; private Exception? _loadException;
private string _name = null!; private string _name = null!;

View File

@ -8,7 +8,10 @@ namespace Artemis.Core.Services;
/// </summary> /// </summary>
public abstract class InputProvider : IDisposable public abstract class InputProvider : IDisposable
{ {
public InputProvider() /// <summary>
/// Creates a new instance of the <see cref="InputProvider"/> class.
/// </summary>
protected InputProvider()
{ {
ProviderName = GetType().FullName ?? throw new InvalidOperationException("Input provider must have a type with a name"); ProviderName = GetType().FullName ?? throw new InvalidOperationException("Input provider must have a type with a name");
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO; using System.IO;
@ -213,8 +213,17 @@ internal class ProfileService : IProfileService
// Make sure the profile is active or inactive according to the parameters above // Make sure the profile is active or inactive according to the parameters above
if (shouldBeActive && profileConfiguration.Profile == null && profileConfiguration.BrokenState != "Failed to activate profile") if (shouldBeActive && profileConfiguration.Profile == null && profileConfiguration.BrokenState != "Failed to activate profile")
profileConfiguration.TryOrBreak(() => ActivateProfile(profileConfiguration), "Failed to activate profile"); profileConfiguration.TryOrBreak(() => ActivateProfile(profileConfiguration), "Failed to activate profile");
if (shouldBeActive && profileConfiguration.Profile != null && !profileConfiguration.Profile.ShouldDisplay)
profileConfiguration.Profile.ShouldDisplay = true;
else if (!shouldBeActive && profileConfiguration.Profile != null) else if (!shouldBeActive && profileConfiguration.Profile != null)
{
if (!profileConfiguration.FadeInAndOut)
DeactivateProfile(profileConfiguration); DeactivateProfile(profileConfiguration);
else if (!profileConfiguration.Profile.ShouldDisplay && profileConfiguration.Profile.Opacity <= 0)
DeactivateProfile(profileConfiguration);
else if (profileConfiguration.Profile.Opacity > 0)
RequestDeactivation(profileConfiguration);
}
profileConfiguration.Profile?.Update(deltaTime); profileConfiguration.Profile?.Update(deltaTime);
} }
@ -254,7 +263,8 @@ internal class ProfileService : IProfileService
{ {
ProfileConfiguration profileConfiguration = profileCategory.ProfileConfigurations[j]; ProfileConfiguration profileConfiguration = profileCategory.ProfileConfigurations[j];
// Ensure all criteria are met before rendering // Ensure all criteria are met before rendering
if (!profileConfiguration.IsSuspended && !profileConfiguration.IsMissingModule && profileConfiguration.ActivationConditionMet) bool fadingOut = profileConfiguration.Profile?.ShouldDisplay == false && profileConfiguration.Profile?.Opacity > 0;
if (!profileConfiguration.IsSuspended && !profileConfiguration.IsMissingModule && (profileConfiguration.ActivationConditionMet || fadingOut))
profileConfiguration.Profile?.Render(canvas, SKPointI.Empty, null); profileConfiguration.Profile?.Render(canvas, SKPointI.Empty, null);
} }
catch (Exception e) catch (Exception e)
@ -316,7 +326,10 @@ internal class ProfileService : IProfileService
public Profile ActivateProfile(ProfileConfiguration profileConfiguration) public Profile ActivateProfile(ProfileConfiguration profileConfiguration)
{ {
if (profileConfiguration.Profile != null) if (profileConfiguration.Profile != null)
{
profileConfiguration.Profile.ShouldDisplay = true;
return profileConfiguration.Profile; return profileConfiguration.Profile;
}
ProfileEntity profileEntity; ProfileEntity profileEntity;
try try
@ -361,6 +374,16 @@ internal class ProfileService : IProfileService
OnProfileDeactivated(new ProfileConfigurationEventArgs(profileConfiguration)); OnProfileDeactivated(new ProfileConfigurationEventArgs(profileConfiguration));
} }
public void RequestDeactivation(ProfileConfiguration profileConfiguration)
{
if (profileConfiguration.IsBeingEdited)
throw new ArtemisCoreException("Cannot disable a profile that is being edited, that's rude");
if (profileConfiguration.Profile == null)
return;
profileConfiguration.Profile.ShouldDisplay = false;
}
public void DeleteProfile(ProfileConfiguration profileConfiguration) public void DeleteProfile(ProfileConfiguration profileConfiguration)
{ {
DeactivateProfile(profileConfiguration); DeactivateProfile(profileConfiguration);

View File

@ -97,7 +97,7 @@ public interface INode : INotifyPropertyChanged, IBreakableModel
void TryEvaluate(); void TryEvaluate();
/// <summary> /// <summary>
/// Resets the node causing all pins to re-evaluate the next time <see cref="Evaluate" /> is called /// Resets the node causing all pins to re-evaluate the next time <see cref="TryEvaluate" /> is called
/// </summary> /// </summary>
void Reset(); void Reset();
} }

View File

@ -25,4 +25,6 @@ public class ProfileConfigurationEntity
public Guid ProfileCategoryId { get; set; } public Guid ProfileCategoryId { get; set; }
public Guid ProfileId { get; set; } public Guid ProfileId { get; set; }
public bool FadeInAndOut { get; set; }
} }

View File

@ -20,7 +20,7 @@
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -317,7 +317,7 @@ public class DeviceVisualizer : Control
Dispatcher.UIThread.Post(InvalidateMeasure); Dispatcher.UIThread.Post(InvalidateMeasure);
} }
catch (Exception e) catch (Exception)
{ {
// ignored // ignored
} }

View File

@ -18,7 +18,7 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared;
/// </summary> /// </summary>
public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposable public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposable
{ {
private const int MaxDepth = 4; private const int MAX_DEPTH = 4;
private ObservableCollection<DataModelVisualizationViewModel> _children; private ObservableCollection<DataModelVisualizationViewModel> _children;
private DataModel? _dataModel; private DataModel? _dataModel;
private bool _isMatchingFilteredTypes; private bool _isMatchingFilteredTypes;
@ -47,6 +47,9 @@ public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposa
PropertyDescription = DataModelPath?.GetPropertyDescription() ?? DataModel?.DataModelDescription; PropertyDescription = DataModelPath?.GetPropertyDescription() ?? DataModel?.DataModelDescription;
} }
/// <summary>
/// Copies the path of the data model to the clipboard.
/// </summary>
public ReactiveCommand<Unit, Unit> CopyPath { get; } public ReactiveCommand<Unit, Unit> CopyPath { get; }
/// <summary> /// <summary>
@ -337,7 +340,7 @@ public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposa
{ {
if (DataModel == null) if (DataModel == null)
throw new ArtemisSharedUIException("Cannot create a data model visualization child VM for a parent without a data model"); throw new ArtemisSharedUIException("Cannot create a data model visualization child VM for a parent without a data model");
if (depth > MaxDepth) if (depth > MAX_DEPTH)
return null; return null;
DataModelPath dataModelPath = new(DataModel, path); DataModelPath dataModelPath = new(DataModel, path);

View File

@ -19,6 +19,9 @@ namespace Artemis.UI.Shared;
/// <typeparam name="TViewModel">ViewModel type.</typeparam> /// <typeparam name="TViewModel">ViewModel type.</typeparam>
public class ReactiveCoreWindow<TViewModel> : CoreWindow, IViewFor<TViewModel> where TViewModel : class public class ReactiveCoreWindow<TViewModel> : CoreWindow, IViewFor<TViewModel> where TViewModel : class
{ {
/// <summary>
/// The ViewModel.
/// </summary>
public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty
.Register<ReactiveCoreWindow<TViewModel>, TViewModel?>(nameof(ViewModel)); .Register<ReactiveCoreWindow<TViewModel>, TViewModel?>(nameof(ViewModel));

View File

@ -5,7 +5,7 @@ using Artemis.Core;
namespace Artemis.UI.Shared.Services.ProfileEditor.Commands; namespace Artemis.UI.Shared.Services.ProfileEditor.Commands;
/// <summary> /// <summary>
/// Represents a profile editor command that can be used to update a layer property of type <typeparamref name="T" />. /// Represents a profile editor command that can be used to update a color gradient.
/// </summary> /// </summary>
public class UpdateColorGradient : IProfileEditorCommand public class UpdateColorGradient : IProfileEditorCommand
{ {

View File

@ -29,8 +29,8 @@
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Layout" Version="1.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" />
<PackageReference Include="Splat.Ninject" Version="14.4.1" /> <PackageReference Include="Splat.Ninject" Version="14.4.1" />
</ItemGroup> </ItemGroup>

View File

@ -92,7 +92,7 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
private void CurrentMainWindowOnClosing(object? sender, EventArgs e) private void CurrentMainWindowOnClosing(object? sender, EventArgs e)
{ {
WindowSizeSetting.Save(); WindowSizeSetting?.Save();
_lifeTime.MainWindow = null; _lifeTime.MainWindow = null;
SidebarViewModel = null; SidebarViewModel = null;
Router.NavigateAndReset.Execute(new EmptyViewModel(this, "blank")).Subscribe(); Router.NavigateAndReset.Execute(new EmptyViewModel(this, "blank")).Subscribe();

View File

@ -127,6 +127,9 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
</StackPanel> </StackPanel>
<CheckBox VerticalAlignment="Bottom" IsChecked="{CompiledBinding FadeInAndOut}" ToolTip.Tip="Smoothly animates in and out when the profile activation conditions change.">Fade when enabling and disabling</CheckBox>
</StackPanel> </StackPanel>
</Border> </Border>

View File

@ -30,6 +30,7 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
private readonly IWindowService _windowService; private readonly IWindowService _windowService;
private Hotkey? _disableHotkey; private Hotkey? _disableHotkey;
private Hotkey? _enableHotkey; private Hotkey? _enableHotkey;
private bool _fadeInAndOut;
private ProfileConfigurationHotkeyMode _hotkeyMode; private ProfileConfigurationHotkeyMode _hotkeyMode;
private ProfileConfigurationIconType _iconType; private ProfileConfigurationIconType _iconType;
private ObservableCollection<ProfileIconViewModel>? _materialIcons; private ObservableCollection<ProfileIconViewModel>? _materialIcons;
@ -57,6 +58,7 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
_profileName = _profileConfiguration.Name; _profileName = _profileConfiguration.Name;
_iconType = _profileConfiguration.Icon.IconType; _iconType = _profileConfiguration.Icon.IconType;
_hotkeyMode = _profileConfiguration.HotkeyMode; _hotkeyMode = _profileConfiguration.HotkeyMode;
_fadeInAndOut = _profileConfiguration.FadeInAndOut;
if (_profileConfiguration.EnableHotkey != null) if (_profileConfiguration.EnableHotkey != null)
_enableHotkey = new Hotkey {Key = _profileConfiguration.EnableHotkey.Key, Modifiers = _profileConfiguration.EnableHotkey.Modifiers}; _enableHotkey = new Hotkey {Key = _profileConfiguration.EnableHotkey.Key, Modifiers = _profileConfiguration.EnableHotkey.Modifiers};
if (_profileConfiguration.DisableHotkey != null) if (_profileConfiguration.DisableHotkey != null)
@ -117,6 +119,12 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
set => RaiseAndSetIfChanged(ref _disableHotkey, value); set => RaiseAndSetIfChanged(ref _disableHotkey, value);
} }
public bool FadeInAndOut
{
get => _fadeInAndOut;
set => RaiseAndSetIfChanged(ref _fadeInAndOut, value);
}
public ObservableCollection<ProfileModuleViewModel?> Modules { get; } public ObservableCollection<ProfileModuleViewModel?> Modules { get; }
public ProfileModuleViewModel? SelectedModule public ProfileModuleViewModel? SelectedModule
@ -131,7 +139,6 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
public ReactiveCommand<Unit, Unit> OpenConditionEditor { get; } public ReactiveCommand<Unit, Unit> OpenConditionEditor { get; }
public ReactiveCommand<Unit, Unit> BrowseBitmapFile { get; } public ReactiveCommand<Unit, Unit> BrowseBitmapFile { get; }
public ReactiveCommand<Unit, Unit> Confirm { get; } public ReactiveCommand<Unit, Unit> Confirm { get; }
public ReactiveCommand<Unit, Unit> Import { get; }
public ReactiveCommand<Unit, Unit> Delete { get; } public ReactiveCommand<Unit, Unit> Delete { get; }
public ReactiveCommand<Unit, Unit> Cancel { get; } public ReactiveCommand<Unit, Unit> Cancel { get; }
@ -155,6 +162,7 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
ProfileConfiguration.HotkeyMode = HotkeyMode; ProfileConfiguration.HotkeyMode = HotkeyMode;
ProfileConfiguration.EnableHotkey = EnableHotkey; ProfileConfiguration.EnableHotkey = EnableHotkey;
ProfileConfiguration.DisableHotkey = DisableHotkey; ProfileConfiguration.DisableHotkey = DisableHotkey;
ProfileConfiguration.FadeInAndOut = FadeInAndOut;
await SaveIcon(); await SaveIcon();

View File

@ -117,7 +117,7 @@ public class LayerPropertyNode : Node<LayerPropertyNodeEntity, LayerPropertyNode
/// The bucket might grow a bit over time as the user edits the node but pins won't get lost, enabling undo/redo in the /// The bucket might grow a bit over time as the user edits the node but pins won't get lost, enabling undo/redo in the
/// editor. /// editor.
/// </summary> /// </summary>
private void CreateOrAddOutputPin(Type valueType, string displayName) private new void CreateOrAddOutputPin(Type valueType, string displayName)
{ {
// Grab the first pin from the bucket that isn't on the node yet // Grab the first pin from the bucket that isn't on the node yet
OutputPin? pin = _pinBucket.FirstOrDefault(p => !Pins.Contains(p)); OutputPin? pin = _pinBucket.FirstOrDefault(p => !Pins.Contains(p));

View File

@ -9,7 +9,7 @@ namespace Artemis.VisualScripting.Nodes.List;
public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPredicateNodeCustomViewModel>, IDisposable public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPredicateNodeCustomViewModel>, IDisposable
{ {
private readonly object _scriptLock = new(); private readonly object _scriptLock = new();
private ListOperatorPredicateStartNode _startNode; private readonly ListOperatorPredicateStartNode _startNode;
public ListOperatorPredicateNode() public ListOperatorPredicateNode()
{ {
@ -65,7 +65,7 @@ public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPr
private bool EvaluateItem(object item) private bool EvaluateItem(object item)
{ {
if (Script == null || _startNode == null) if (Script == null)
return false; return false;
_startNode.Item = item; _startNode.Item = item;
@ -100,7 +100,6 @@ public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPr
{ {
Script?.Dispose(); Script?.Dispose();
Script = null; Script = null;
_startNode = null;
} }
#endregion #endregion