Ejemplo n.º 1
0
 public override void Paint(MapPaintEventArgs e, bool isActiveManipulator)
 {
     using (var rectanglePen = new Pen(Color.FromArgb(118, 143, 219), 3))
     {
         e.Graphics.DrawRectangle(rectanglePen, _activeRectangle);
     }
 }
Ejemplo n.º 2
0
        public override void Paint(MapPaintEventArgs e, bool isActiveManipulator)
        {
            if (isActiveManipulator)
            {
                Rectangle gameSize = _map.Display.GetGameRectangle();
                Debug.Assert(new Rectangle(new Point(0, 0), _map.CanvasSize) == e.FullMapRectangle);

                var villageDimension = _map.Display.Dimensions.SizeWithSpacing;

                if (_pinPointedTribe != null)
                {
                    foreach (Player player in _pinPointedTribe.Players)
                    {
                        IEnumerable<Village> uneventfulVillages = GetUneventfulVillages(player);
                        DrawVillageMarkers(e.Graphics, uneventfulVillages, gameSize, _otherVillagesPen, villageDimension);
                    }

                    // Gained & lost villages:
                    foreach (Player player in _pinPointedTribe.Players)
                    {
                        DrawVillageMarkers(e.Graphics, player.GainedVillages, gameSize, _newVillagesPen, villageDimension);
                        DrawVillageMarkers(e.Graphics, player.LostVillages, gameSize, _lostVillagesPen, villageDimension);
                    }
                }
                else
                {
                    Village village = _pinPointedVillage ?? _selectedVillage;
                    if (village != null)
                    {
                        if (village.HasPlayer)
                        {
                            IEnumerable<Village> uneventfulVillages = GetUneventfulVillages(village.Player);
                            DrawVillageMarkers(e.Graphics, uneventfulVillages, gameSize, _otherVillagesPen, villageDimension);

                            // Gained & lost villages:
                            DrawVillageMarkers(e.Graphics, village.Player.GainedVillages, gameSize, _newVillagesPen, villageDimension);
                            DrawVillageMarkers(e.Graphics, village.Player.LostVillages, gameSize, _lostVillagesPen, villageDimension);
                        }
                        else if (village.PreviousVillageDetails != null && village.PreviousVillageDetails.HasPlayer)
                        {
                            // Newly barbarian
                            DrawVillageMarkers(e.Graphics, village.PreviousVillageDetails.Player.Villages, gameSize, _otherVillagesPen, villageDimension);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public virtual void Paint(MapPaintEventArgs e, bool isActiveManipulator)
 {
 }
Ejemplo n.º 4
0
        public override void Paint(MapPaintEventArgs e, bool isActiveManipulator)
        {
            if (!Settings.ShowIfNotActiveManipulator && !isActiveManipulator)
            {
                return;
            }

            Size villageSize = _map.Display.Dimensions.Size;
            if (villageSize.Width < MinVillageWidthToShowMarkers)
            {
                return;
            }

            Rectangle gameSize = _map.Display.GetGameRectangle();
            Graphics g = e.Graphics;

            if (isActiveManipulator && ActivePlan != null)
            {
                PaintWhenActiveManipulator(gameSize, g, villageSize);
            }

            PaintNonActivePlans(villageSize, g, gameSize);

            if (ActivePlan != null)
            {
                PaintActivePlan(villageSize, g, gameSize);
            }
        }
Ejemplo n.º 5
0
 public void Paint(Graphics g, Rectangle fullMap)
 {
     var paintArgs = new MapPaintEventArgs(g, fullMap);
     Display.Paint(g, fullMap);
     Manipulators.Paint(paintArgs);
 }
        public void Paint(MapPaintEventArgs e)
        {
            foreach (ManipulatorBase roaming in _roaming)
            {
                roaming.Paint(e, false);
            }

            foreach (ManipulatorManagerBase manipulator in _manipulators.Values)
            {
                manipulator.Paint(e, manipulator == CurrentManipulator);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Paints the polygons
        /// </summary>
        public override void Paint(MapPaintEventArgs e, bool isActiveManipulator)
        {
            if (Polygons != null)
            {
                foreach (Polygon poly in Polygons)
                {
                    bool active = poly == ActivePolygon && isActiveManipulator;
                    if (poly.List.Count > 1 && poly.Visible)
                    {
                        Pen pen = GetPen(poly.LineColor);
                        Brush brush = GetBrush(poly.LineColor);

                        var firstP = new Point();
                        var p = new Point();
                        int x = -1, y = -1;
                        foreach (Point gameP in poly.List)
                        {
                            p = World.Default.Map.Display.GetMapLocation(gameP);
                            if (x != -1 || y != -1)
                            {
                                e.Graphics.DrawLine(pen, x, y, p.X, p.Y);
                            }
                            else
                            {
                                firstP = p;
                            }
                            if (active)
                            {
                                e.Graphics.FillRectangle(brush, new Rectangle(p.X - 3, p.Y - 3, 7, 7));
                            }

                            x = p.X;
                            y = p.Y;
                        }
                        if (!poly.Drawing)
                        {
                            e.Graphics.DrawLine(pen, firstP, p);

                            if (_map.Display.AllowText)
                            {
                                SizeF size = e.Graphics.MeasureString(poly.Name, _font);
                                p.Offset(5, 5);
                                e.Graphics.DrawEllipse(pen, p.X, p.Y, size.Width, size.Height);
                                e.Graphics.DrawString(poly.Name, _font, brush, new Point(p.X, p.Y));
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public void Paint(MapPaintEventArgs e, bool isActiveManipulator)
        {
            if (_fullControllManipulator != null && !_manipulators.Contains(_fullControllManipulator))
            {
                _fullControllManipulator.Paint(e, isActiveManipulator);
            }

            foreach (ManipulatorBase manipulator in _manipulators)
                manipulator.Paint(e, isActiveManipulator);
        }