Exemple #1
0
        private void AddSystemIntelOverlay()
        {
            if (!MapConf.ShowIntel)
            {
                return;
            }

            EVEData.MapRegion rd = RegionDropDown.SelectedItem as EVEData.MapRegion;

            foreach (EVEData.IntelData id in EVEManager.IntelDataList)
            {
                foreach (string sysStr in id.Systems)
                {
                    if (rd.IsSystemOnMap(sysStr))
                    {
                        EVEData.MapSystem sys = rd.MapSystems[sysStr];

                        double radiusScale = (DateTime.Now - id.IntelTime).TotalSeconds / (double)MapConf.MaxIntelSeconds;

                        if (radiusScale < 0.0 || radiusScale >= 1.0)
                        {
                            continue;
                        }

                        // add circle to the map
                        double radius       = 100 * (1.0 - radiusScale);
                        double circleOffset = radius / 2;

                        Shape intelShape = new Ellipse()
                        {
                            Height = radius, Width = radius
                        };

                        intelShape.Fill = new SolidColorBrush(MapConf.ActiveColourScheme.IntelOverlayColour);
                        Canvas.SetLeft(intelShape, sys.LayoutX - circleOffset);
                        Canvas.SetTop(intelShape, sys.LayoutY - circleOffset);
                        Canvas.SetZIndex(intelShape, 15);
                        MainCanvas.Children.Add(intelShape);

                        DynamicMapElements.Add(intelShape);
                    }
                }
            }
        }
Exemple #2
0
        private void AddCharactersToMap()
        {
            EVEData.MapRegion rd = RegionDropDown.SelectedItem as EVEData.MapRegion;

            foreach (EVEData.Character c in EVEManager.LocalCharacters)
            {
                if (rd.IsSystemOnMap(c.Location))
                {
                    EVEData.MapSystem ms = rd.MapSystems[c.Location];

                    // add the character to
                    double circleSize   = 26;
                    double circleOffset = circleSize / 2;

                    // add circle for system
                    Shape highlightSystemCircle = new Ellipse()
                    {
                        Height = circleSize, Width = circleSize
                    };

                    highlightSystemCircle.Stroke          = new SolidColorBrush(MapConf.ActiveColourScheme.CharacterHighlightColour);
                    highlightSystemCircle.StrokeThickness = 2;

                    RotateTransform rt = new RotateTransform();
                    rt.CenterX = circleSize / 2;
                    rt.CenterY = circleSize / 2;
                    highlightSystemCircle.RenderTransform = rt;

                    DoubleCollection dashes = new DoubleCollection();
                    dashes.Add(1.0);
                    dashes.Add(1.0);

                    highlightSystemCircle.StrokeDashArray = dashes;

                    Canvas.SetLeft(highlightSystemCircle, ms.LayoutX - circleOffset);
                    Canvas.SetTop(highlightSystemCircle, ms.LayoutY - circleOffset);
                    Canvas.SetZIndex(highlightSystemCircle, 19);

                    MainCanvas.Children.Add(highlightSystemCircle);
                    DynamicMapElements.Add(highlightSystemCircle);

                    // Storyboard s = new Storyboard();
                    DoubleAnimation da = new DoubleAnimation();
                    da.From     = 360;
                    da.To       = 0;
                    da.Duration = new Duration(TimeSpan.FromSeconds(12));

                    RotateTransform eTransform = (RotateTransform)highlightSystemCircle.RenderTransform;
                    eTransform.BeginAnimation(RotateTransform.AngleProperty, da);

                    double textYOffset = -24;
                    double textXOffset = 6;

                    // also add the name of the character above the system
                    Label charText = new Label();
                    charText.Content    = c.Name;
                    charText.Foreground = new SolidColorBrush(MapConf.ActiveColourScheme.CharacterTextColour);

                    if (MapConf.ActiveColourScheme.CharacterTextSize > 0)
                    {
                        charText.FontSize = MapConf.ActiveColourScheme.CharacterTextSize;
                    }

                    Canvas.SetLeft(charText, ms.LayoutX + textXOffset);
                    Canvas.SetTop(charText, ms.LayoutY + textYOffset);
                    Canvas.SetZIndex(charText, 20);
                    MainCanvas.Children.Add(charText);
                    DynamicMapElements.Add(charText);
                }
            }
        }
Exemple #3
0
        private void AddSystemsToMap()
        {
            EVEData.MapRegion rd = RegionDropDown.SelectedItem as EVEData.MapRegion;

            foreach (EVEData.Link jump in rd.Jumps)
            {
                Line sysLink = new Line();

                EVEData.MapSystem from = rd.MapSystems[jump.From];
                EVEData.MapSystem to   = rd.MapSystems[jump.To];
                sysLink.X1 = from.LayoutX;
                sysLink.Y1 = from.LayoutY;

                sysLink.X2 = to.LayoutX;
                sysLink.Y2 = to.LayoutY;

                if (jump.ConstelationLink)
                {
                    sysLink.Stroke = new SolidColorBrush(MapConf.ActiveColourScheme.ConstellationGateColour);
                }
                else
                {
                    sysLink.Stroke = new SolidColorBrush(MapConf.ActiveColourScheme.NormalGateColour);
                }

                sysLink.StrokeThickness = 1;
                sysLink.Visibility      = Visibility.Visible;

                Canvas.SetZIndex(sysLink, 19);
                MainCanvas.Children.Add(sysLink);
            }

            if (MapConf.ShowJumpBridges || MapConf.ShowHostileJumpBridges)
            {
                foreach (EVEData.JumpBridge jb in EVEManager.JumpBridges)
                {
                    if (rd.IsSystemOnMap(jb.From) && rd.IsSystemOnMap(jb.To))
                    {
                        if ((jb.Friendly && !MapConf.ShowJumpBridges) || (!jb.Friendly && !MapConf.ShowHostileJumpBridges))
                        {
                            continue;
                        }

                        // jbLink.Data
                        EVEData.MapSystem from = rd.MapSystems[jb.From];
                        EVEData.MapSystem to   = rd.MapSystems[jb.To];

                        Point startPoint = new Point(from.LayoutX, from.LayoutY);
                        Point endPoint   = new Point(to.LayoutX, to.LayoutY);

                        Vector dir = Point.Subtract(startPoint, endPoint);

                        double jbDistance = Point.Subtract(startPoint, endPoint).Length;

                        Size arcSize = new Size(jbDistance + 50, jbDistance + 50);

                        ArcSegment arcseg = new ArcSegment(endPoint, arcSize, 100, false, SweepDirection.Clockwise, true);

                        PathSegmentCollection pscollection = new PathSegmentCollection();
                        pscollection.Add(arcseg);

                        PathFigure pf = new PathFigure();
                        pf.Segments   = pscollection;
                        pf.StartPoint = startPoint;

                        PathFigureCollection pfcollection = new PathFigureCollection();
                        pfcollection.Add(pf);

                        PathGeometry pathGeometry = new PathGeometry();
                        pathGeometry.Figures = pfcollection;

                        System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
                        path.Data = pathGeometry;

                        if (jb.Friendly)
                        {
                            path.Stroke = new SolidColorBrush(MapConf.ActiveColourScheme.FriendlyJumpBridgeColour);
                        }
                        else
                        {
                            path.Stroke = new SolidColorBrush(MapConf.ActiveColourScheme.HostileJumpBridgeColour);
                        }

                        path.StrokeThickness = 2;

                        DoubleCollection dashes = new DoubleCollection();
                        dashes.Add(1.0);
                        dashes.Add(1.0);

                        path.StrokeDashArray = dashes;

                        Canvas.SetZIndex(path, 19);

                        MainCanvas.Children.Add(path);
                    }
                }
            }

            foreach (EVEData.MapSystem sys in rd.MapSystems.Values.ToList())
            {
                double circleSize   = 15;
                double circleOffset = circleSize / 2;
                double textXOffset  = 5;
                double textYOffset  = -8;
                double textYOffset2 = 6;


                // add circle for system
                Shape systemShape;

                if (sys.ActualSystem.HasNPCStation)
                {
                    systemShape = new Rectangle()
                    {
                        Height = circleSize, Width = circleSize
                    };
                }
                else
                {
                    systemShape = new Ellipse()
                    {
                        Height = circleSize, Width = circleSize
                    };
                }

                systemShape.Stroke = new SolidColorBrush(MapConf.ActiveColourScheme.SystemOutlineColour);

                if (sys.OutOfRegion)
                {
                    systemShape.Fill = new SolidColorBrush(MapConf.ActiveColourScheme.OutRegionSystemColour);
                }
                else
                {
                    systemShape.Fill = new SolidColorBrush(MapConf.ActiveColourScheme.InRegionSystemColour);
                }

                // override with sec status colours
                if (MapConf.ShowSystemSecurity)
                {
                    systemShape.Fill = new SolidColorBrush(MapColours.GetSecStatusColour(sys.ActualSystem.Security));
                }


                systemShape.DataContext = sys;
                systemShape.MouseDown  += ShapeMouseDownHandler;
                systemShape.MouseEnter += ShapeMouseOverHandler;
                systemShape.MouseLeave += ShapeMouseOverHandler;

                Canvas.SetLeft(systemShape, sys.LayoutX - circleOffset);
                Canvas.SetTop(systemShape, sys.LayoutY - circleOffset);
                Canvas.SetZIndex(systemShape, 20);
                MainCanvas.Children.Add(systemShape);

                // add text
                Label sysText = new Label();
                sysText.Content = sys.Name;
                if (MapConf.ActiveColourScheme.SystemTextSize > 0)
                {
                    sysText.FontSize = MapConf.ActiveColourScheme.SystemTextSize;
                }

                if (sys.OutOfRegion)
                {
                    sysText.Foreground = new SolidColorBrush(MapConf.ActiveColourScheme.OutRegionSystemTextColour);
                }
                else
                {
                    sysText.Foreground = new SolidColorBrush(MapConf.ActiveColourScheme.InRegionSystemTextColour);
                }

                Canvas.SetLeft(sysText, sys.LayoutX + textXOffset);
                Canvas.SetTop(sysText, sys.LayoutY + textYOffset);
                Canvas.SetZIndex(sysText, 20);

                MainCanvas.Children.Add(sysText);



                double regionMarkerOffset = textYOffset2;

                if ((MapConf.ShowSystemSovName | MapConf.ShowSystemSovTicker) && sys.ActualSystem.SOVAlliance != null && EVEManager.AllianceIDToName.Keys.Contains(sys.ActualSystem.SOVAlliance))
                {
                    Label sysRegionText = new Label();

                    string content        = "";
                    string allianceName   = EVEManager.GetAllianceName(sys.ActualSystem.SOVAlliance);
                    string allianceTicker = EVEManager.GetAllianceTicker(sys.ActualSystem.SOVAlliance);

                    if (MapConf.ShowSystemSovName)
                    {
                        content = allianceName;
                    }

                    if (MapConf.ShowSystemSovTicker)
                    {
                        content = allianceTicker;
                    }

                    if (MapConf.ShowSystemSovTicker && MapConf.ShowSystemSovName && allianceName != string.Empty && allianceTicker != String.Empty)
                    {
                        content = allianceName + " (" + allianceTicker + ")";
                    }



                    sysRegionText.Content    = content;
                    sysRegionText.FontSize   = 7;
                    sysRegionText.Foreground = new SolidColorBrush(MapConf.ActiveColourScheme.OutRegionSystemTextColour);

                    Canvas.SetLeft(sysRegionText, sys.LayoutX + textXOffset);
                    Canvas.SetTop(sysRegionText, sys.LayoutY + textYOffset2);
                    Canvas.SetZIndex(sysRegionText, 20);

                    MainCanvas.Children.Add(sysRegionText);

                    regionMarkerOffset += 8;
                }



                if (MapConf.ShowJumpDistance && SelectedSystem != null && sys.Name != SelectedSystem)
                {
                    double Distance = EVEManager.GetRange(SelectedSystem, sys.Name);
                    Distance = Distance / 9460730472580800.0;

                    double Max = 0.1f;

                    switch (MapConf.JumpShipType)
                    {
                    case MapConfig.JumpShip.Super: { Max = 6.0; } break;

                    case MapConfig.JumpShip.Titan: { Max = 6.0; } break;

                    case MapConfig.JumpShip.Dread: { Max = 7.0; } break;

                    case MapConfig.JumpShip.Carrier: { Max = 7.0; } break;

                    case MapConfig.JumpShip.FAX: { Max = 7.0; } break;

                    case MapConfig.JumpShip.Blops: { Max = 8.0; } break;

                    case MapConfig.JumpShip.JF: { Max = 10.0; } break;
                    }

                    if (Distance < Max && Distance > 0.0)
                    {
                        systemShape.Fill = new SolidColorBrush(MapConf.ActiveColourScheme.JumpRangeInColour);

                        string JD = Distance.ToString("0.00") + " LY";

                        Label DistanceText = new Label();

                        DistanceText.Content    = JD;
                        DistanceText.FontSize   = 9;
                        DistanceText.Foreground = new SolidColorBrush(MapConf.ActiveColourScheme.OutRegionSystemTextColour);
                        regionMarkerOffset     += 8;

                        Canvas.SetLeft(DistanceText, sys.LayoutX + textXOffset);
                        Canvas.SetTop(DistanceText, sys.LayoutY + textYOffset2);


                        Canvas.SetZIndex(DistanceText, 20);
                        MainCanvas.Children.Add(DistanceText);
                    }
                    else
                    {
                        systemShape.Fill = new SolidColorBrush(MapConf.ActiveColourScheme.JumpRangeOutColour);
                    }
                }



                if (sys.OutOfRegion)
                {
                    Label sysRegionText = new Label();
                    sysRegionText.Content    = "(" + sys.Region + ")";
                    sysRegionText.FontSize   = 7;
                    sysRegionText.Foreground = new SolidColorBrush(MapConf.ActiveColourScheme.OutRegionSystemTextColour);

                    Canvas.SetLeft(sysRegionText, sys.LayoutX + textXOffset);
                    Canvas.SetTop(sysRegionText, sys.LayoutY + regionMarkerOffset);
                    Canvas.SetZIndex(sysRegionText, 20);

                    MainCanvas.Children.Add(sysRegionText);
                }
            }
        }