Exemple #1
0
        /// <summary>
        /// Raises the <see cref="E:Draw" /> event.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void OnDraw(EventArgs args)
        {
            var closeWard =
                WardTrackerVariables.detectedWards.FirstOrDefault(
                    w => w.Position.Distance(Game.CursorPos, true) < 80 * 80);

            if (closeWard != null)
            {
                if (MenuExtensions.GetItemValue <KeyBind>("dz191.dza.ward.extrainfo").Active)
                {
                    var polyPoints  = GetWardPolygon(closeWard);
                    var currentPath = polyPoints.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                    var currentPoly = Geometry.ToPolygon(currentPath);
                    currentPoly.Draw(GetWardColor(closeWard.WardTypeW));
                }
            }
            foreach (var ward in WardTrackerVariables.detectedWards)
            {
                if (closeWard != null && ward.Position.Distance(closeWard.Position) < float.Epsilon && MenuExtensions.GetItemValue <KeyBind>("dz191.dza.ward.extrainfo").Active)
                {
                    continue;
                }

                var position = ward.Position;
                var shape    = Helper.GetPolygonVertices(
                    new Vector2(position.X, position.Y + 15.5f).To3D(),
                    MenuExtensions.GetItemValue <Slider>("dz191.dza.ward.sides").Value, 65f, 0);
                var list        = shape.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                var currentPoly = Geometry.ToPolygon(list);
                var colour      = GetWardColor(ward.WardTypeW);
                currentPoly.Draw(colour);
            }
        }
Exemple #2
0
        /// <summary>
        /// Raises the <see cref="E:Draw" /> event.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void OnDraw(EventArgs args)
        {
            if (!WardTrackerBase.moduleMenu["dz191.dza.ward.track"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            var closeWard =
                WardTrackerVariables.detectedWards.FirstOrDefault(
                    w => w.Position.LSDistance(Game.CursorPos, true) < 80 * 80);

            if (closeWard != null)
            {
                if (WardTrackerBase.moduleMenu["dz191.dza.ward.extrainfo"].Cast <KeyBind>().CurrentValue)
                {
                    var polyPoints  = GetWardPolygon(closeWard);
                    var currentPath = polyPoints.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                    var currentPoly = Geometry.ToPolygon(currentPath);
                    currentPoly.Draw(GetWardColor(closeWard.WardTypeW));
                }
            }
            foreach (var ward in WardTrackerVariables.detectedWards)
            {
                if (Environment.TickCount > ward.startTick + ward.WardTypeW.WardDuration)
                {
                    continue;
                }

                if (closeWard != null && ward.Position.LSDistance(closeWard.Position) < float.Epsilon && WardTrackerBase.moduleMenu["dz191.dza.ward.extrainfo"].Cast <KeyBind>().CurrentValue)
                {
                    continue;
                }

                var position = ward.Position;

                switch (WardTrackerBase.moduleMenu["dz191.dza.ward.type"].Cast <ComboBox>().CurrentValue)
                {
                case 0:
                    Render.Circle.DrawCircle(position, 125f, GetWardColor(ward.WardTypeW));
                    break;

                case 1:
                    var shape = Helper.GetPolygonVertices(
                        new Vector2(position.X, position.Y + 15.5f).To3D(),
                        WardTrackerBase.moduleMenu["dz191.dza.ward.sides"].Cast <Slider>().CurrentValue, 65f, 0);
                    var list        = shape.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                    var currentPoly = Geometry.ToPolygon(list);
                    var colour      = GetWardColor(ward.WardTypeW);
                    currentPoly.Draw(colour);
                    break;
                }
            }
        }