예제 #1
0
        private void OnPathingNodePlaced()
        {
            if (CurrentPath == null)
            {
                CurrentPath = new LedgeBuilder(Game, RenderWindow);
                CurrentPath.Initialize();

                Globals.ObjectSelected.Invoke(CurrentPath);
                elapsedNodePlacement = TimeSpan.Zero;
            }
            else if (elapsedNodePlacement <= nodePlacementDelay)
            {
                return;
            }

            elapsedNodePlacement = TimeSpan.Zero;

            // Create our path node
            LedgeNodeDisplay node = new LedgeNodeDisplay(Globals.Game);

            node.Position = new Vector2(Position.X - Globals.CurrentCameraOffsetX,
                                        Position.Y - Globals.CurrentCameraOffsetY);

            node.CameraOffsetX = Globals.CurrentCameraOffsetX;
            node.CameraOffsetY = Globals.CurrentCameraOffsetY;
            node.DrawOrder     = 100;
            node.Visible       = true;

            node.Initialize();

            CurrentPath.Nodes.Add(node);
        }
예제 #2
0
        private void OnCanceledPath()
        {
            // Flush the current path we were making
            CurrentPath = null;

            // Hide the pathing tool once saved
            Globals.IsPathingToolVisible = false;
        }
예제 #3
0
        public override void UnloadContent()
        {
            base.UnloadContent();

            SpriteBatch = null;
            Cursor      = null;
            CurrentPath = null;
        }
예제 #4
0
        private void OnSavePathingNodes()
        {
            Globals.Paths.Add(CurrentPath);
            Globals.ObjectSelected.Invoke(CurrentPath);

            // Drop the current path
            CurrentPath = null;

            // Hide the pathing tool once saved
            Globals.IsPathingToolVisible = false;
        }