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); }
private void OnCanceledPath() { // Flush the current path we were making CurrentPath = null; // Hide the pathing tool once saved Globals.IsPathingToolVisible = false; }
public override void UnloadContent() { base.UnloadContent(); SpriteBatch = null; Cursor = null; CurrentPath = null; }
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; }