fixes
This commit is contained in:
@@ -237,12 +237,12 @@ namespace FlaxEditor.Surface
|
||||
/// <param name="additive">If the instigator should be added to the list of instigators.</param>
|
||||
public void ConnectingStart(IConnectionInstigator instigator, bool additive = false)
|
||||
{
|
||||
if (instigator != null && instigator != _connectionInstigator)
|
||||
if (instigator != null && instigator != _connectionInstigators)
|
||||
{
|
||||
if (!additive)
|
||||
_connectionInstigator.Clear();
|
||||
_connectionInstigators.Clear();
|
||||
|
||||
_connectionInstigator.Add(instigator);
|
||||
_connectionInstigators.Add(instigator);
|
||||
StartMouseCapture();
|
||||
}
|
||||
}
|
||||
@@ -263,13 +263,13 @@ namespace FlaxEditor.Surface
|
||||
public void ConnectingEnd(IConnectionInstigator end)
|
||||
{
|
||||
// Ensure that there is at least one connection instigator
|
||||
if (_connectionInstigator.Count == 0)
|
||||
if (_connectionInstigators.Count == 0)
|
||||
return;
|
||||
|
||||
List<IConnectionInstigator> instigators = new List<IConnectionInstigator>(_connectionInstigator);
|
||||
List<IConnectionInstigator> instigators = new List<IConnectionInstigator>(_connectionInstigators);
|
||||
for (int i = 0; i < instigators.Count; i++)
|
||||
{
|
||||
var start = _connectionInstigator[i];
|
||||
var start = _connectionInstigators[i];
|
||||
|
||||
// Check if boxes are different and end box is specified
|
||||
if (start == end || end == null)
|
||||
@@ -281,7 +281,7 @@ namespace FlaxEditor.Surface
|
||||
}
|
||||
|
||||
// Reset instigator list
|
||||
_connectionInstigator.Clear();
|
||||
_connectionInstigators.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,8 @@ namespace FlaxEditor.Surface
|
||||
_cmStartPos = location;
|
||||
|
||||
// Offset added in case the user doesn't like the box and wants to quickly get rid of it by clicking
|
||||
OnShowPrimaryMenu(_activeVisjectCM, _cmStartPos + ContextMenuOffset, _connectionInstigator[0] as Box);
|
||||
Box startBox = _connectionInstigators.Count > 0 ? _connectionInstigators[0] as Box : null;
|
||||
OnShowPrimaryMenu(_activeVisjectCM, _cmStartPos + ContextMenuOffset, startBox);
|
||||
|
||||
if (!string.IsNullOrEmpty(input))
|
||||
{
|
||||
@@ -475,7 +476,7 @@ namespace FlaxEditor.Surface
|
||||
private void OnPrimaryMenuVisibleChanged(Control primaryMenu)
|
||||
{
|
||||
if (!primaryMenu.Visible)
|
||||
_connectionInstigator.Clear();
|
||||
_connectionInstigators.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -553,7 +554,7 @@ namespace FlaxEditor.Surface
|
||||
}
|
||||
|
||||
// If the user is patiently waiting for his box to get connected to the newly created one fulfill his wish!
|
||||
_connectionInstigator[0] = startBox;
|
||||
_connectionInstigators[0] = startBox;
|
||||
|
||||
if (!IsConnecting)
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace FlaxEditor.Surface
|
||||
var endPos = cmVisible ? _rootControl.PointFromParent(ref _cmStartPos) : _rootControl.PointFromParent(ref _mousePos);
|
||||
Color lineColor = Style.Colors.Connecting;
|
||||
|
||||
List<IConnectionInstigator> instigators = new List<IConnectionInstigator>(_connectionInstigator);
|
||||
List<IConnectionInstigator> instigators = new List<IConnectionInstigator>(_connectionInstigators);
|
||||
for (int i = 0; i < instigators.Count; i++)
|
||||
{
|
||||
IConnectionInstigator currentInstigator = instigators[i];
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace FlaxEditor.Surface
|
||||
if (_leftMouseDown)
|
||||
{
|
||||
// Connecting
|
||||
if (_connectionInstigator.Count > 0)
|
||||
if (_connectionInstigators.Count > 0)
|
||||
{
|
||||
}
|
||||
// Moving
|
||||
@@ -438,7 +438,7 @@ namespace FlaxEditor.Surface
|
||||
public override bool OnMouseDown(Float2 location, MouseButton button)
|
||||
{
|
||||
// Check if user is connecting boxes
|
||||
if (_connectionInstigator.Count > 0)
|
||||
if (_connectionInstigators.Count > 0)
|
||||
return true;
|
||||
|
||||
// Base
|
||||
@@ -560,7 +560,7 @@ namespace FlaxEditor.Surface
|
||||
_movingNodesDelta = Float2.Zero;
|
||||
}
|
||||
// Connecting
|
||||
else if (_connectionInstigator.Count > 0)
|
||||
else if (_connectionInstigators.Count > 0)
|
||||
{
|
||||
}
|
||||
// Selecting
|
||||
@@ -632,7 +632,7 @@ namespace FlaxEditor.Surface
|
||||
ShowPrimaryMenu(_cmStartPos);
|
||||
}
|
||||
// Letting go of a connection or right clicking while creating a connection
|
||||
else if (!_isMovingSelection && _connectionInstigator.Count > 0 && !IsPrimaryMenuOpened)
|
||||
else if (!_isMovingSelection && _connectionInstigators.Count > 0 && !IsPrimaryMenuOpened)
|
||||
{
|
||||
_cmStartPos = location;
|
||||
Cursor = CursorType.Default;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace FlaxEditor.Surface
|
||||
Enabled = false;
|
||||
|
||||
// Clean data
|
||||
_connectionInstigator.Clear();
|
||||
_connectionInstigators.Clear();
|
||||
_lastInstigatorUnderMouse = null;
|
||||
|
||||
var failed = RootContext.Load();
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace FlaxEditor.Surface
|
||||
/// <summary>
|
||||
/// The connection start.
|
||||
/// </summary>
|
||||
protected List<IConnectionInstigator> _connectionInstigator = new List<IConnectionInstigator>();
|
||||
protected List<IConnectionInstigator> _connectionInstigators = new List<IConnectionInstigator>();
|
||||
|
||||
/// <summary>
|
||||
/// The last connection instigator under mouse.
|
||||
@@ -234,17 +234,17 @@ namespace FlaxEditor.Surface
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether user is selecting nodes.
|
||||
/// </summary>
|
||||
public bool IsSelecting => _leftMouseDown && !_isMovingSelection && _connectionInstigator.Count == 0;
|
||||
public bool IsSelecting => _leftMouseDown && !_isMovingSelection && _connectionInstigators.Count == 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether user is moving selected nodes.
|
||||
/// </summary>
|
||||
public bool IsMovingSelection => _leftMouseDown && _isMovingSelection && _connectionInstigator.Count == 0;
|
||||
public bool IsMovingSelection => _leftMouseDown && _isMovingSelection && _connectionInstigators.Count == 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether user is connecting nodes.
|
||||
/// </summary>
|
||||
public bool IsConnecting => _connectionInstigator.Count > 0;
|
||||
public bool IsConnecting => _connectionInstigators.Count > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the left mouse button is down.
|
||||
|
||||
Reference in New Issue
Block a user