예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 protected override void OnRightClick(Sandbox.UI.MousePanelEvent e)
 {
 }