Exemplo n.º 1
0
 /// <summary>
 /// Add points to the polygon
 /// </summary>
 protected internal override bool MouseMoveCore(MapMouseMoveEventArgs e)
 {
     if (e.MouseEventArgs.Button == MouseButtons.Left && _isDragging)
     {
         Point currentMap = CreateGamePoint(e.MouseEventArgs.Location);
         if (_lastPosition != currentMap)
         {
             _lastPosition = currentMap;
             SetMapCenter();
         }
     }
     return false;
 }
Exemplo n.º 2
0
 protected internal virtual bool MouseMoveCore(MapMouseMoveEventArgs e)
 {
     return false;
 }
Exemplo n.º 3
0
        protected internal override bool MouseMoveCore(MapMouseMoveEventArgs e)
        {
            // This is for the MiniMap:
            // Inform the MiniMap that the selected village changed so that
            // the minimap still pinpoints what we hover while the main map
            // keeps track of just the AttackPlans
            if (e.Village != null)
            {
                if (_hoverVillage != e.Village)
                {
                    _map.EventPublisher.SelectVillages(this, e.Village, VillageTools.SelectVillage);

                    _hoverVillage = e.Village;
                    return true;
                }
            }
            if (e.Village == null && _hoverVillage != null)
            {
                _map.EventPublisher.Deselect(this);

                _hoverVillage = null;
                return true;
            }
            return false;
        }
        /// <summary>
        /// Make the ActiveRectangle move with the mouse.
        /// Display informative tooltip.
        /// </summary>
        protected internal override bool MouseMoveCore(MapMouseMoveEventArgs e)
        {
            if (_showHelpTooltip && _lastTooltipLocation != e.Location)
            {
                _lastTooltipLocation = e.Location;
                _map.ShowTooltip(HelpTitle, HelpBody);
            }

            CalculateActiveRectanglePosition(e.Location.X, e.Location.Y);
            return true;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Add points to the polygon
        /// </summary>
        protected internal override bool MouseMoveCore(MapMouseMoveEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                Point currentMap = e.MouseEventArgs.Location;
                if (Control.ModifierKeys.HasFlag(Keys.Control))
                {
                    currentMap.X = _lastAddedMapLocation.X;
                }
                if (Control.ModifierKeys.HasFlag(Keys.Shift))
                {
                    currentMap.Y = _lastAddedMapLocation.Y;
                }

                if (_activePolygon != null && _activePolygon.Drawing && CanAddPointToPolygon(_lastAddedMapLocation, currentMap))
                {
                    // Add extra point to the polygon
                    _activePolygon.Add(currentMap);
                    _lastAddedMapLocation = currentMap;
                    return true;
                }
            }
            return false;
        }
Exemplo n.º 6
0
        protected internal override bool MouseMoveCore(MapMouseMoveEventArgs e)
        {
            if (e.Village != null && _pinPointedVillage == null && _unpinpointedVillage != e.Village)
            {
                if (_selectedVillage != e.Village)
                {
                    _map.EventPublisher.SelectVillages(this, e.Village, VillageTools.SelectVillage);

                    _selectedVillage = e.Village;
                    _unpinpointedVillage = null;
                    return true;
                }
            }
            if (e.Village == null && _pinPointedVillage == null && _selectedVillage != null)
            {
                _selectedVillage = null;
                _map.EventPublisher.Deselect(this);
                return true;
            }
            return false;
        }
Exemplo n.º 7
0
 public bool MouseMoveCore(MapMouseMoveEventArgs e)
 {
     if (_fullControllManipulator != null)
     {
         return _fullControllManipulator.MouseMoveCore(e);
     }
     else
     {
         bool redraw = false;
         foreach (ManipulatorBase m in _manipulators) redraw |= m.MouseMoveCore(e);
         return redraw;
     }
 }