// Random shapes.. thanks Julian ^_^
        private void SetUp()
        {
            _polygon = new Polygon {
                Points = new PointCollection(5)
                {
                    new Point(100, 150),
                    new Point(120, 130),
                    new Point(140, 150),
                    new Point(140, 200),
                    new Point(100, 200)
                },
                Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 255)),
                Fill   =
                    new RadialGradientBrush(
                        Color.FromRgb(255, 255, 0),
                        Color.FromRgb(255, 0, 255))
            };

            OverlayWindow.Add(_polygon);

            // Create a line
            _line = new Line {
                X1              = 100,
                X2              = 300,
                Y1              = 200,
                Y2              = 200,
                Stroke          = new SolidColorBrush(Color.FromRgb(0, 255, 0)),
                StrokeThickness = 2
            };

            OverlayWindow.Add(_line);

            // Create an ellipse (circle)
            _ellipse = new Ellipse {
                Width  = 15,
                Height = 15,
                Margin = new Thickness(300, 300, 0, 0),
                Stroke =
                    new SolidColorBrush(Color.FromRgb(0, 255, 255))
            };

            OverlayWindow.Add(_ellipse);

            // Create a rectangle
            _rectangle = new Rectangle {
                RadiusX = 2,
                RadiusY = 2,
                Width   = 50,
                Height  = 100,
                Margin  = new Thickness(400, 400, 0, 0),
                Stroke  = new SolidColorBrush(Color.FromRgb(255, 0, 0)),
                Fill    =
                    new SolidColorBrush(Color.FromArgb(100, 255, 255,
                                                       255))
            };

            OverlayWindow.Add(_rectangle);
        }
        private void SetUp()
        {
            overlay1 = new System.Windows.Controls.Image();
            BitmapImage bi3 = new BitmapImage();

            bi3.BeginInit();
            bi3.UriSource = new Uri(System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath) + "\\panel1.bmp", UriKind.RelativeOrAbsolute);
            bi3.EndInit();
            overlay1.Stretch = Stretch.Fill;
            overlay1.Source  = bi3;
            OverlayWindow.Add(overlay1);
        }
Beispiel #3
0
        // Random shapes.. thanks Julian ^_^
        private void SetUp()
        {
            //_polygon = new Polygon
            //{
            //    Points = new PointCollection(5) {
            //        new Point(100, 150),
            //        new Point(120, 130),
            //        new Point(140, 150),
            //        new Point(140, 200),
            //        new Point(100, 200)
            //    },
            //    Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 255)),
            //    Fill =
            //        new RadialGradientBrush(
            //            Color.FromRgb(255, 255, 0),
            //            Color.FromRgb(255, 0, 255))
            //};
            //OverlayWindow.Add(_polygon);

            OverlayWindow.Add(new body());



            //// Create a line
            //_line = new Line
            //{
            //    X1 = 100,
            //    X2 = 300,
            //    Y1 = 200,
            //    Y2 = 200,
            //    Stroke = new SolidColorBrush(Color.FromRgb(0, 255, 0)),
            //    StrokeThickness = 2
            //};

            //OverlayWindow.Add(_line);

            //// Create an ellipse (circle)
            //_ellipse = new Ellipse
            //{
            //    Width = 15,
            //    Height = 15,
            //    Margin = new Thickness(300, 300, 0, 0),
            //    Stroke =
            //        new SolidColorBrush(Color.FromRgb(0, 255, 255))
            //};

            //OverlayWindow.Add(_ellipse);

            //// Create a rectangle
            //_rectangle = new Rectangle
            //{
            //    RadiusX = 2,
            //    RadiusY = 2,
            //    Width = 50,
            //    Height = 100,
            //    Margin = new Thickness(400, 400, 0, 0),
            //    Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0)),
            //    Fill =
            //        new SolidColorBrush(Color.FromArgb(100, 255, 255,
            //            255))
            //};

            //OverlayWindow.Add(_rectangle);
        }
Beispiel #4
0
        public override void Update()
        {
            // Raises the events only when the given interval has
            // passed since the last event, so it is okay to call every frame
            _tickEngine.Pulse();
            if (!OverlayWindow.IsVisible)
            {
                return;
            }
            if (!MouseDown)
            {
                FollowTargetWindow();
            }
            Combatant        self  = Program.mem?.GetSelfCombatant();
            List <Combatant> clist = Program.mem?._getCombatantList();

            if (self != null && clist != null)
            {
                clist.RemoveAll(c => c.OwnerID == self.ID);
                foreach (uint ID in clist.Where(c => c.Type == ObjectType.PC).Select(x => x.ID).ToList())
                {
                    clist.RemoveAll(c => c.OwnerID == ID);
                }
                RemoveUnvantedCombatants(self, clist);

                double centerY = OverlayWindow.Height / 2;
                double centerX = OverlayWindow.Width / 2;
                foreach (Combatant c in clist)
                {                                                                        //ridiculous posx+posy as key, no idea what else to use
                    if (c.ID == 3758096384 && !miscDrawMap.ContainsKey(c.PosX + c.PosY)) //for aetherytes, npcs, and other stuff;
                    {
                        miscDrawMap.Add(c.PosX + c.PosY, new EntityOverlayControl(c));
                        OverlayWindow.Add(miscDrawMap[c.PosX + c.PosY]);
                    }
                    else if (!drawMap.ContainsKey(c.ID))
                    {
                        drawMap.Add(c.ID, new EntityOverlayControl(c, c.ID == self.ID));
                        OverlayWindow.Add(drawMap[c.ID]);
                    }

                    double Top  = (c.PosY - self.PosY);
                    double Left = (c.PosX - self.PosX);
                    Top  += centerY + (Top * OverlayWindow.Height * .003 * Properties.Settings.Default.RadarZoom);
                    Left += centerX + (Left * OverlayWindow.Width * .003 * Properties.Settings.Default.RadarZoom);
                    if (drawMap.ContainsKey(c.ID))
                    {
                        drawMap[c.ID].Update(c);
                        Top  -= (drawMap[c.ID].ActualHeight / 2);
                        Left -= (drawMap[c.ID].ActualWidth / 2);
                        if (Top < 0)
                        {
                            Canvas.SetTop(drawMap[c.ID], 0);
                        }
                        else if (Top > OverlayWindow.Height - drawMap[c.ID].ActualHeight)
                        {
                            Canvas.SetTop(drawMap[c.ID], OverlayWindow.Height - drawMap[c.ID].ActualHeight);
                        }
                        else
                        {
                            Canvas.SetTop(drawMap[c.ID], Top);
                        }

                        if (Left < 0)
                        {
                            Canvas.SetLeft(drawMap[c.ID], 0);
                        }
                        else if (Left > OverlayWindow.Width - drawMap[c.ID].ActualWidth)
                        {
                            Canvas.SetLeft(drawMap[c.ID], OverlayWindow.Width - drawMap[c.ID].ActualWidth);
                        }
                        else
                        {
                            Canvas.SetLeft(drawMap[c.ID], Left);
                        }
                    }
                    else if (miscDrawMap.ContainsKey(c.PosX + c.PosY))
                    {
                        miscDrawMap[c.PosX + c.PosY].Update(c);
                        Top  -= (miscDrawMap[c.ID].ActualHeight / 2);
                        Left -= (miscDrawMap[c.ID].ActualWidth / 2);
                        Canvas.SetTop(miscDrawMap[c.PosX + c.PosY], Top);
                        Canvas.SetLeft(miscDrawMap[c.PosX + c.PosY], Left);
                    }
                }
            }

            //cleanup
            foreach (KeyValuePair <uint, EntityOverlayControl> entry in drawMap.ToArray())
            {
                //Hide hoard/cairn, after Banded Coffer appeared... hmm Hoard will re-appear if going out of "sight" and in again
                if (entry.Value.GetName().Equals("Hoard!") && (clist?.Any(c => c.EventType == EObjType.Banded) ?? false))
                {
                    entry.Value.Visibility = Visibility.Collapsed;
                    if (!hoardsDiscovered.Contains(entry.Key))
                    {
                        hoardsDiscovered.Add(entry.Key);
                    }
                    continue;
                }

                if (clist?.Exists(c => c.ID == entry.Key) ?? false)
                {
                    continue;
                }
                else
                {
                    entry.Value.Visibility = Visibility.Collapsed;
                    drawMap.Remove(entry.Key);
                }
            }
            foreach (KeyValuePair <float, EntityOverlayControl> entry in miscDrawMap.ToArray())
            {
                if (clist?.Exists(c => c.PosX + c.PosY == entry.Key) ?? false)
                {
                    continue;
                }
                else
                {
                    entry.Value.Visibility = Visibility.Collapsed;
                    miscDrawMap.Remove(entry.Key);
                }
            }
        }
        // Random shapes.. thanks Julian ^_^
        private void SetUp()
        {
            button = new System.Windows.Controls.Button
            {
                Margin  = new Thickness(0, 41, 0, 0),
                Width   = 70,
                Height  = 50,
                Content = "Click me"
            };
            button.MouseEnter += (s, e) =>
            {
                MessageBox.Show("Clicked overlay");
            };
            OverlayWindow.Add(button);
            #region shapes
            //_polygon = new Polygon
            //{
            //    Points = new PointCollection(5) {
            //        new Point(100, 150),
            //        new Point(120, 130),
            //        new Point(140, 150),
            //        new Point(140, 200),
            //        new Point(100, 200)
            //    },
            //    Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 255)),
            //    Fill =
            //        new RadialGradientBrush(
            //            Color.FromRgb(255, 255, 0),
            //            Color.FromRgb(255, 0, 255))
            //};

            //OverlayWindow.Add(_polygon);

            // Create a line
            //_line = new Line
            //{
            //    X1 = 100,
            //    X2 = 300,
            //    Y1 = 200,
            //    Y2 = 200,
            //    Stroke = new SolidColorBrush(Color.FromRgb(0, 255, 0)),
            //    StrokeThickness = 2
            //};

            //OverlayWindow.Add(_line);

            // Create an ellipse (circle)
            //_ellipse = new Ellipse
            //{
            //    Width = 15,
            //    Height = 15,
            //    Margin = new Thickness(300, 300, 0, 0),
            //    Stroke =
            //        new SolidColorBrush(Color.FromRgb(0, 255, 255))
            //};

            //OverlayWindow.Add(_ellipse);

            // Create a rectangle
            //_rectangle = new Rectangle
            //{
            //    RadiusX = 2,
            //    RadiusY = 2,
            //    Width = 50,
            //    Height = 100,
            //    Margin = new Thickness(400, 400, 0, 0),
            //    Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0)),
            //    Fill =
            //        new SolidColorBrush(Color.FromArgb(100, 255, 255,
            //            255))
            //};

            //OverlayWindow.Add(_rectangle);
            #endregion
        }