- Added IsActive state to boxes

- Replaced box.enabled with box.isActive on some nodes
- Made connection lines draw with alpha when connected box is inactive
This commit is contained in:
Nils Hausfeld
2024-05-24 22:26:20 +02:00
parent 9731437717
commit d47a191d5c
5 changed files with 105 additions and 88 deletions

View File

@@ -41,6 +41,11 @@ namespace FlaxEditor.Surface.Elements
/// </summary>
protected bool _isSelected;
/// <summary>
/// The is active flag for the box. Unlike <see cref="FlaxEngine.GUI.Control.Enabled"/>, inactive boxes can still be interacted with, they just will be drawn like disabled boxes
/// </summary>
protected bool _isActive = true;
/// <summary>
/// Unique box ID within single node.
/// </summary>
@@ -180,6 +185,15 @@ namespace FlaxEditor.Surface.Elements
}
}
/// <summary>
/// Gets or sets the active state of the box. Unlike <see cref="FlaxEngine.GUI.Control.Enabled"/>, inactive boxes can still be interacted with, they just will be drawn like disabled boxes
/// </summary>
public bool IsActive
{
get => _isActive;
set => _isActive = value;
}
/// <inheritdoc />
protected Box(SurfaceNode parentNode, NodeElementArchetype archetype, Float2 location)
: base(parentNode, archetype, location, new Float2(Constants.BoxSize), false)