mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Nodes - Inform nodes they are being loaded using the new IsLoading property
This commit is contained in:
parent
14c7940a21
commit
7176aba0d6
@ -40,6 +40,11 @@ public interface INode : INotifyPropertyChanged, IBreakableModel, IPluginFeature
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
bool IsDefaultNode { get; }
|
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>
|
/// <summary>
|
||||||
/// Gets or sets the X-position of the node
|
/// Gets or sets the X-position of the node
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -46,6 +46,7 @@ public class NodeData
|
|||||||
|
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
{
|
{
|
||||||
|
node.IsLoading = true;
|
||||||
node.X = entity.X;
|
node.X = entity.X;
|
||||||
node.Y = entity.Y;
|
node.Y = entity.Y;
|
||||||
try
|
try
|
||||||
|
|||||||
@ -206,6 +206,8 @@ public abstract class NodeScript : CorePropertyChanged, INodeScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
LoadConnections();
|
LoadConnections();
|
||||||
|
foreach (INode node in Nodes)
|
||||||
|
node.IsLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void LoadFromEntity(NodeScriptEntity entity)
|
internal void LoadFromEntity(NodeScriptEntity entity)
|
||||||
@ -216,6 +218,7 @@ public abstract class NodeScript : CorePropertyChanged, INodeScript
|
|||||||
|
|
||||||
private void LoadExistingNode(INode node, NodeEntity nodeEntity)
|
private void LoadExistingNode(INode node, NodeEntity nodeEntity)
|
||||||
{
|
{
|
||||||
|
node.IsLoading = true;
|
||||||
node.Id = nodeEntity.Id;
|
node.Id = nodeEntity.Id;
|
||||||
node.X = nodeEntity.X;
|
node.X = nodeEntity.X;
|
||||||
node.Y = nodeEntity.Y;
|
node.Y = nodeEntity.Y;
|
||||||
|
|||||||
@ -92,6 +92,9 @@ public abstract class Node : BreakableModel, INode
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual bool IsDefaultNode => false;
|
public virtual bool IsDefaultNode => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public bool IsLoading { get; set; }
|
||||||
|
|
||||||
private readonly List<IPin> _pins = new();
|
private readonly List<IPin> _pins = new();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user