1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 13:28:33 +00:00

Nodes - Inform nodes they are being loaded using the new IsLoading property

This commit is contained in:
Robert 2025-02-14 22:15:03 +01:00
parent 14c7940a21
commit 7176aba0d6
4 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,11 @@ public interface INode : INotifyPropertyChanged, IBreakableModel, IPluginFeature
/// Gets a boolean indicating whether the node is a default node that connot be removed
/// </summary>
bool IsDefaultNode { get; }
/// <summary>
/// Gets a boolean indicating whether the node is currently loading, use this to disable pin type changes etc.
/// </summary>
bool IsLoading { get; set; }
/// <summary>
/// Gets or sets the X-position of the node

View File

@ -46,6 +46,7 @@ public class NodeData
if (entity != null)
{
node.IsLoading = true;
node.X = entity.X;
node.Y = entity.Y;
try

View File

@ -206,6 +206,8 @@ public abstract class NodeScript : CorePropertyChanged, INodeScript
}
LoadConnections();
foreach (INode node in Nodes)
node.IsLoading = false;
}
internal void LoadFromEntity(NodeScriptEntity entity)
@ -216,6 +218,7 @@ public abstract class NodeScript : CorePropertyChanged, INodeScript
private void LoadExistingNode(INode node, NodeEntity nodeEntity)
{
node.IsLoading = true;
node.Id = nodeEntity.Id;
node.X = nodeEntity.X;
node.Y = nodeEntity.Y;

View File

@ -92,6 +92,9 @@ public abstract class Node : BreakableModel, INode
/// <inheritdoc />
public virtual bool IsDefaultNode => false;
/// <inheritdoc />
public bool IsLoading { get; set; }
private readonly List<IPin> _pins = new();
/// <inheritdoc />