Beispiel #1
0
        private void DrawingOnOnDraw(EventArgs args)
        {
            if (!Modes.ModeDraw.MenuLocal.Item("Draw.Enable").GetValue <bool>())
            {
                return;
            }

            foreach (var hero in HeroManager.AllHeroes)
            {
                var passiveBuffs = (from b in hero.Buffs join b1 in PassiveBuffs on b.DisplayName equals b1.BuffName select new { b, b1 }).Distinct();
                foreach (var buffName in passiveBuffs)
                {
                    for (int i = 0; i < passiveBuffs.Count(); i++)
                    {
                        if (buffName.b.EndTime >= Game.Time)
                        {
                            CommonGeometry.DrawBox(new Vector2(hero.HPBarPosition.X + 10, (i * 8) + hero.HPBarPosition.Y + 32), 130, 6, Color.FromArgb(100, 255, 200, 37), 1, Color.Black);

                            var buffTime = buffName.b.EndTime - buffName.b.StartTime;
                            CommonGeometry.DrawBox(new Vector2(hero.HPBarPosition.X + 11, (i * 8) + hero.HPBarPosition.Y + 33), (130 / buffTime) * (buffName.b.EndTime - Game.Time), 4, buffName.b1.Color, 1, buffName.b1.Color);

                            TimeSpan timeSpan = TimeSpan.FromSeconds(buffName.b.EndTime - Game.Time);
                            var      timer    = $"{timeSpan.Minutes:D2}:{timeSpan.Seconds:D2}";
                            CommonGeometry.DrawText(CommonGeometry.TextPassive, timer, hero.HPBarPosition.X + 142, (i * 8) + hero.HPBarPosition.Y + 29, SharpDX.Color.Wheat);
                        }
                    }
                }

                var jungleBuffs = (from b in hero.Buffs join b1 in JungleBuffs on b.DisplayName equals b1.BuffName select new { b, b1 }).Distinct();
                foreach (var buffName in jungleBuffs.ToList())
                {
                    var circle1 = new CommonGeometry.Circle2(new Vector2(hero.Position.X + 3, hero.Position.Y - 3), 140 + (buffName.b1.Number * 20), Game.Time - buffName.b.StartTime, buffName.b.EndTime - buffName.b.StartTime).ToPolygon();
                    circle1.Draw(Color.Black, 3);

                    var circle = new CommonGeometry.Circle2(hero.Position.To2D(), 140 + (buffName.b1.Number * 20), Game.Time - buffName.b.StartTime, buffName.b.EndTime - buffName.b.StartTime).ToPolygon();
                    circle.Draw(buffName.b1.Color, 3);
                }
            }
        }
        private void DrawingOnOnDraw(EventArgs args)
        {
            if (!Modes.ModeDraw.MenuLocal["Draw.Enable"].Cast<CheckBox>().CurrentValue)
            {
                return;
            }

            foreach (var hero in HeroManager.AllHeroes)
            {
                var passiveBuffs = (from b in hero.Buffs join b1 in PassiveBuffs on b.DisplayName equals b1.BuffName select new {b, b1}).Distinct();
                foreach (var buffName in passiveBuffs)
                {
                    for (int i = 0; i < passiveBuffs.Count(); i++)
                    {
                        if (buffName.b.EndTime >= Game.Time)
                        {
                            CommonGeometry.DrawBox(new Vector2(hero.HPBarPosition.X + 10, (i*8) + hero.HPBarPosition.Y + 32), 130, 6,Color.FromArgb(100, 255, 200, 37), 1, Color.Black);

                            var buffTime = buffName.b.EndTime - buffName.b.StartTime;
                            CommonGeometry.DrawBox(new Vector2(hero.HPBarPosition.X + 11, (i*8) + hero.HPBarPosition.Y + 33),(130/buffTime)*(buffName.b.EndTime - Game.Time), 4, buffName.b1.Color, 1,buffName.b1.Color);

                            TimeSpan timeSpan = TimeSpan.FromSeconds(buffName.b.EndTime - Game.Time);
                            var timer = $"{timeSpan.Minutes:D2}:{timeSpan.Seconds:D2}";
                            CommonGeometry.DrawText(CommonGeometry.TextPassive, timer, hero.HPBarPosition.X + 142,(i*8) + hero.HPBarPosition.Y + 29, SharpDX.Color.Wheat);
                        }
                    }
                }

                var jungleBuffs = (from b in hero.Buffs join b1 in JungleBuffs on b.DisplayName equals b1.BuffName select new { b, b1 }).Distinct();
                foreach (var buffName in jungleBuffs.ToList())
                {
                    var circle1 = new CommonGeometry.Circle2(new Vector2(hero.Position.X + 3, hero.Position.Y - 3), 140 + (buffName.b1.Number * 20), Game.Time - buffName.b.StartTime, buffName.b.EndTime - buffName.b.StartTime).ToPolygon();
                    circle1.Draw(Color.Black, 3);

                    var circle = new CommonGeometry.Circle2(hero.Position.LSTo2D(), 140 + (buffName.b1.Number * 20), Game.Time - buffName.b.StartTime, buffName.b.EndTime - buffName.b.StartTime).ToPolygon();
                    circle.Draw(buffName.b1.Color, 3);
                }
            }
        }