예제 #1
0
        private void MouseoverWidget_MouseCellChanged(object sender, MouseCellChangedEventArgs e)
        {
            if (placementMode)
            {
                if (additivePlacement)
                {
                    AddResource(e.NewCell);
                }
                else
                {
                    RemoveResource(e.NewCell);
                }
            }

            if (brushSizeNud.Value > 1)
            {
                foreach (var cell in new Point[] { e.OldCell, e.NewCell })
                {
                    mapPanel.Invalidate(mapPanel.MapToClient(new Rectangle(
                                                                 new Point(cell.X - ((int)brushSizeNud.Value / 2), cell.Y - ((int)brushSizeNud.Value / 2)),
                                                                 new Size((int)brushSizeNud.Value, (int)brushSizeNud.Value)
                                                                 )));
                }
            }
        }
 private void MouseoverWidget_MouseCellChanged(object sender, MouseCellChangedEventArgs e)
 {
     if (placementMode)
     {
         if (Control.MouseButtons == MouseButtons.Left)
         {
             SetCellTrigger(e.NewCell);
         }
         else if (Control.MouseButtons == MouseButtons.Right)
         {
             RemoveCellTrigger(e.NewCell);
         }
     }
 }