public override void OnMouseLeftUp(Point location) { if (moving) { moving = false; moveAction = null; } }
public override void OnMouseMove(Point location) { if (moving) { Point move = new Point(location.X - mouseStart.X, location.Y - mouseStart.Y); if (!Util.Ctrl) move = LayerEditor.Layer.Definition.SnapToGrid(move); move = new Point(move.X - moved.X, move.Y - moved.Y); if (move.X != 0 || move.Y != 0) { if (moveAction != null) moveAction.DoAgain(move); else LevelEditor.Perform(moveAction = new EntityMoveAction(LayerEditor.Layer, Ogmo.EntitySelectionWindow.Selected, move)); moved = new Point(move.X + moved.X, move.Y + moved.Y); Ogmo.EntitySelectionWindow.RefreshContents(); } } }
public EntityMoveTool() : base("Move", "move.png") { moving = false; moveAction = null; }