Beispiel #1
0
        public override void Draw()
        {
            var enemies = EntityManager.GetEntities <Player>().Where(x =>
                                                                     x.IsValid && x.Team != Me.Team && x.Hero != null && x.Hero.IsValid) /*.OrderBy(x => x.Id)*/;
            var enumerable = enemies as Player[] ?? enemies.ToArray();
            var count      = enumerable.Count() + 1;
            var currentLoc = PanelPosition;
            var width      = _iconSize.X * (ViewManager.EnabledCount * 2 + 1);

            RendererManager.DrawFilledRectangle(
                new RectangleF(PanelPosition.X, PanelPosition.Y, width, count * _iconSize.Y),

                Color.Black, new SharpDX.Color(50, 50, 50, 50), 1);
            DrawHorizontalsIcons(currentLoc, _iconSize, ViewManager.EnabledList);

            foreach (var enemy in enumerable.Select(x => x.Hero).Where(x =>
                                                                       Main.Updater.BombDamageManager.DamageDictionary.ContainsKey(x.HeroId)))
            {
                var heroId = enemy.HeroId;
                currentLoc.Y += 25;
                RendererManager.DrawTexture(heroId,
                                            new RectangleF(currentLoc.X, currentLoc.Y, _iconSize.X, _iconSize.Y), UnitTextureType.MiniUnit, true);
                DrawHorizontalsDamage(currentLoc, _iconSize, enemy, ViewManager.EnabledList);
            }

            RendererManager.DrawRectangle(
                new RectangleF(PanelPosition.X, PanelPosition.Y, width, count * _iconSize.Y),
                new SharpDX.Color(100, 100, 100, 50));
        }
Beispiel #2
0
        public void DrawHorizontalsIcons(Vector2 startPos, Vector2 size, params AbilityId[] ids)
        {
            var pos = startPos + new Vector2(size.X * 1.5f, 0);

            for (var i = 1; i <= ids.Length; i++)
            {
                RendererManager.DrawTexture(ids[i - 1],
                                            new RectangleF(pos.X, startPos.Y, _iconSize.X, _iconSize.Y), loadTexture: true);
                pos += new Vector2(size.X * 2, 0);
            }
        }