protected override void OnMouseDown(Sandbox.UI.MousePanelEvent e) { if (ConnectionWire != null) { return; } ConnectionWire = NodeConnectionWire.Create(); ConnectionWire.StartPoint = this; Window.Instance.ActiveNodeConnectionWire = ConnectionWire; IsDragging = true; base.OnMouseDown(e); }
protected override void OnMouseOver(Sandbox.UI.MousePanelEvent e) { NodeConnectionWire currentConnectionWire = Window.Instance.ActiveNodeConnectionWire; if (ConnectionWire != null || currentConnectionWire == null || currentConnectionWire.StartPoint.Node == Node) { return; } ConnectionWire = currentConnectionWire; ConnectionWire.EndPoint = this; Window.Instance.ActiveNodeConnectionWire = null; ConnectionWire.StartPoint.IsDragging = false; base.OnMouseOver(e); }
protected override void OnMouseUp(Sandbox.UI.MousePanelEvent e) { if (!IsDragging) { return; } if (ConnectionWire.EndPoint == null) { ConnectionWire.Delete(true); } IsDragging = false; Window.Instance.ActiveNodeConnectionWire = null; base.OnMouseUp(e); }
protected override void OnRightClick(Sandbox.UI.MousePanelEvent e) { }