Example #1
0
        private bool Init(bool force)
        {
            try
            {
                _s = new Sprite(Drawing.Direct3DDevice);
                _recF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 12));
                _spellF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 8));
                _champF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 24));
                //_champIF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 24));
                _sumF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 16));
                _recS = new Render.Rectangle(0, 0, 16, 16, SharpDX.Color.Green);
                _recB = new Render.Rectangle(0, 0, (int) (16*1.7), (int) (16*1.7), SharpDX.Color.Green);
                _recNS = new Render.Rectangle(0, 0, 32, 16, SharpDX.Color.Green);
            }
            catch (Exception)
            {
                return false;
                //throw;
            }
            if (
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerEnemyTracker")
                    .GetMenuItem("SAwarenessUITrackerEnemyTrackerXPos")
                    .GetValue<Slider>()
                    .Value == -1)
            {
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerEnemyTracker")
                    .GetMenuItem("SAwarenessUITrackerEnemyTrackerXPos")
                    .SetValue(new Slider((int) _screen.X, Drawing.Width, 0));
            }
            if (
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerEnemyTracker")
                    .GetMenuItem("SAwarenessUITrackerEnemyTrackerYPos")
                    .GetValue<Slider>()
                    .Value == -1)
            {
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerEnemyTracker")
                    .GetMenuItem("SAwarenessUITrackerEnemyTrackerYPos")
                    .SetValue(new Slider((int) _screen.Y, Drawing.Height, 0));
            }
            if (
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerAllyTracker")
                    .GetMenuItem("SAwarenessUITrackerAllyTrackerXPos")
                    .GetValue<Slider>()
                    .Value == -1)
            {
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerAllyTracker")
                    .GetMenuItem("SAwarenessUITrackerAllyTrackerXPos")
                    .SetValue(new Slider((int) _screen.X, Drawing.Width, 0));
            }
            if (
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerAllyTracker")
                    .GetMenuItem("SAwarenessUITrackerAllyTrackerYPos")
                    .GetValue<Slider>()
                    .Value == -1)
            {
                Menu.UiTracker.GetMenuSettings("SAwarenessUITrackerAllyTracker")
                    .GetMenuItem("SAwarenessUITrackerAllyTrackerYPos")
                    .SetValue(new Slider((int) _screen.Y, Drawing.Height, 0));
            }

            //var loc = Assembly.GetExecutingAssembly().Location;
            //loc = loc.Remove(loc.LastIndexOf("\\", StringComparison.Ordinal));
            //loc = loc + "\\Sprites\\SAwareness\\";

            //SpriteHelper.LoadTexture("SummonerTint.dds", "SUMMONERS/", loc + "SUMMONERS\\SummonerTint.dds", ref _overlaySummoner);
            //SpriteHelper.LoadTexture("SummonerSpellTint.dds", "SUMMONERS/", loc + "SUMMONERS\\SummonerSpellTint.dds", ref _overlaySummonerSpell);
            //SpriteHelper.LoadTexture("SpellTint.dds", "SUMMONERS/", loc + "SUMMONERS\\SpellTint.dds", ref _overlaySpellItem);

            //SpriteHelper.LoadTexture("BarBackground.dds", "EXT/", loc + "EXT\\BarBackground.dds", ref _backBar);
            //SpriteHelper.LoadTexture("HealthBar.dds", "EXT/", loc + "EXT\\HealthBar.dds", ref _healthBar);
            //SpriteHelper.LoadTexture("ManaBar.dds", "EXT/", loc + "EXT\\ManaBar.dds", ref _manaBar);
            //SpriteHelper.LoadTexture("ItemSlotEmpty.dds", "EXT/", loc + "EXT\\ItemSlotEmpty.dds", ref _overlayEmptyItem);
            //SpriteHelper.LoadTexture("RecallBar.dds", "EXT/", loc + "EXT\\RecallBar.dds", ref _overlayRecall);

            SpriteHelper.LoadTexture("SummonerTint", ref _overlaySummoner, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("SummonerSpellTint", ref _overlaySummonerSpell, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("SpellTint", ref _overlaySpellItem, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("SpellTintRed", ref _overlaySpellItemRed, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("SpellTintGreen", ref _overlaySpellItemGreen, SpriteHelper.TextureType.Default);

            SpriteHelper.LoadTexture("BarBackground", ref _backBar, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("HealthBar", ref _healthBar, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("ManaBar", ref _manaBar, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("ItemSlotEmpty", ref _overlayEmptyItem, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("RecallBar", ref _overlayRecall, SpriteHelper.TextureType.Default);
            SpriteHelper.LoadTexture("GoldCsLvlBar", ref _overlayGoldCsLvl, SpriteHelper.TextureType.Default);

            foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
            {
                if (hero.IsEnemy)
                {
                    var champ = new ChampInfos();
                    //SpriteHelper.LoadTexture(hero.ChampionName + ".dds", "CHAMP/", loc + "CHAMP\\" + hero.ChampionName + ".dds", ref champ.SGui.Champ.Texture);
                    SpriteHelper.LoadTexture(hero.ChampionName, ref champ.SGui.Champ.Texture,
                        SpriteHelper.TextureType.Default);
                    SpellDataInst[] s1 = hero.Spellbook.Spells;
                    //SpriteHelper.LoadTexture(s1[0].Name + ".dds", "PASSIVE/", loc + "PASSIVE\\" + s1[0].Name + ".dds", ref champ.SGui.Passive.Texture);
                    //SpriteHelper.LoadTexture(s1[0].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[0].Name + ".dds", ref champ.SGui.SpellQ.Texture);
                    //SpriteHelper.LoadTexture(s1[1].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[1].Name + ".dds", ref champ.SGui.SpellW.Texture);
                    //SpriteHelper.LoadTexture(s1[2].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[2].Name + ".dds", ref champ.SGui.SpellE.Texture);
                    //SpriteHelper.LoadTexture(s1[3].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[3].Name + ".dds", ref champ.SGui.SpellR.Texture);
                    SpriteHelper.LoadTexture(s1[0].Name, ref champ.SGui.SpellQ.Texture, SpriteHelper.TextureType.Default);
                    SpriteHelper.LoadTexture(s1[1].Name, ref champ.SGui.SpellW.Texture, SpriteHelper.TextureType.Default);
                    SpriteHelper.LoadTexture(s1[2].Name, ref champ.SGui.SpellE.Texture, SpriteHelper.TextureType.Default);
                    SpriteHelper.LoadTexture(s1[3].Name, ref champ.SGui.SpellR.Texture, SpriteHelper.TextureType.Default);

                    //var s2 = hero.SummonerSpellbook.Spells;
                    //SpriteHelper.LoadTexture(s2[0].Name + ".dds", "SUMMONERS/", loc + "SUMMONERS\\" + s2[0].Name + ".dds", ref champ.SGui.SpellSum1.Texture);
                    //SpriteHelper.LoadTexture(s2[1].Name + ".dds", "SUMMONERS/", loc + "SUMMONERS\\" + s2[1].Name + ".dds", ref champ.SGui.SpellSum2.Texture);
                    SpellDataInst[] s2 = hero.SummonerSpellbook.Spells;
                    SpriteHelper.LoadTexture(s2[0].Name + "1", ref champ.SGui.SpellSum1.Texture,
                        SpriteHelper.TextureType.Summoner);
                    SpriteHelper.LoadTexture(s2[1].Name + "1", ref champ.SGui.SpellSum2.Texture,
                        SpriteHelper.TextureType.Summoner);

                    _enemies.Add(hero, champ);
                }
            }

            foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
            {
                if (!hero.IsEnemy && !hero.IsMe)
                {
                    var champ = new ChampInfos();
                    SpriteHelper.LoadTexture(hero.ChampionName, ref champ.SGui.Champ.Texture,
                        SpriteHelper.TextureType.Default);
                    SpellDataInst[] s1 = hero.Spellbook.Spells;
                    //SpriteHelper.LoadTexture(s1[0].Name + ".dds", "PASSIVE/", loc + "PASSIVE\\" + s1[0].Name + ".dds", ref champ.SGui.Passive.Texture);
                    SpriteHelper.LoadTexture(s1[0].Name, ref champ.SGui.SpellQ.Texture, SpriteHelper.TextureType.Default);
                    SpriteHelper.LoadTexture(s1[1].Name, ref champ.SGui.SpellW.Texture, SpriteHelper.TextureType.Default);
                    SpriteHelper.LoadTexture(s1[2].Name, ref champ.SGui.SpellE.Texture, SpriteHelper.TextureType.Default);
                    SpriteHelper.LoadTexture(s1[3].Name, ref champ.SGui.SpellR.Texture, SpriteHelper.TextureType.Default);

                    SpellDataInst[] s2 = hero.SummonerSpellbook.Spells;
                    SpriteHelper.LoadTexture(s2[0].Name, ref champ.SGui.SpellSum1.Texture,
                        SpriteHelper.TextureType.Summoner);
                    SpriteHelper.LoadTexture(s2[1].Name + "1", ref champ.SGui.SpellSum2.Texture,
                        SpriteHelper.TextureType.Summoner);

                    _allies.Add(hero, champ);
                }
            }
            UpdateItems(true);
            UpdateItems(false);
            CalculateSizes(true);
            CalculateSizes(false);

            return true;
        }
Example #2
0
        private bool Init(bool force)
        {
            try
            {
                S = new Sprite(Drawing.Direct3DDevice);
                RecF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 12));
                SpellF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 8));
                ChampF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 30));
                SumF = new Font(Drawing.Direct3DDevice, new System.Drawing.Font("Times New Roman", 16));
            }
            catch (Exception)
            {

                return false;
                //throw;
            }
            if (Menu.UiTracker.GetMenuItem("SAwarenessUITrackerXPos").GetValue<Slider>().Value == -1)
            {
                Menu.UiTracker.GetMenuItem("SAwarenessUITrackerXPos").SetValue(new Slider((int)_screen.X, Drawing.Width, 0));
            }
            if (Menu.UiTracker.GetMenuItem("SAwarenessUITrackerYPos").GetValue<Slider>().Value == -1)
            {
                Menu.UiTracker.GetMenuItem("SAwarenessUITrackerYPos").SetValue(new Slider((int)_screen.Y, Drawing.Height, 0));
            }

            var loc = Assembly.GetExecutingAssembly().Location;
            loc = loc.Remove(loc.LastIndexOf("\\", StringComparison.Ordinal));
            loc = loc + "\\Sprites\\SAwareness\\";

            SpriteHelper.LoadTexture("SummonerTint.dds", "SUMMONERS/", loc + "SUMMONERS\\SummonerTint.dds", ref _overlaySummoner);
            SpriteHelper.LoadTexture("SummonerSpellTint.dds", "SUMMONERS/", loc + "SUMMONERS\\SummonerSpellTint.dds", ref _overlaySummonerSpell);
            SpriteHelper.LoadTexture("SpellTint.dds", "SUMMONERS/", loc + "SUMMONERS\\SpellTint.dds", ref _overlaySpellItem);

            SpriteHelper.LoadTexture("BarBackground.dds", "EXT/", loc + "EXT\\BarBackground.dds", ref _backBar);
            SpriteHelper.LoadTexture("HealthBar.dds", "EXT/", loc + "EXT\\HealthBar.dds", ref _healthBar);
            SpriteHelper.LoadTexture("ManaBar.dds", "EXT/", loc + "EXT\\ManaBar.dds", ref _manaBar);
            SpriteHelper.LoadTexture("ItemSlotEmpty.dds", "EXT/", loc + "EXT\\ItemSlotEmpty.dds", ref _overlayEmptyItem);
            SpriteHelper.LoadTexture("RecallBar.dds", "EXT/", loc + "EXT\\RecallBar.dds", ref _overlayRecall);

            foreach (var hero in ObjectManager.Get<Obj_AI_Hero>())
            {
                if (hero.IsEnemy)
                {
                    var champ = new ChampInfos();
                    SpriteHelper.LoadTexture(hero.ChampionName + ".dds", "CHAMP/", loc + "CHAMP\\" + hero.ChampionName + ".dds", ref champ.SGui.Champ.Texture);
                    var s1 = hero.Spellbook.Spells;
                    //if (File.Exists(loc + "PASSIVE\\" + s1[0].Name + ".dds") && champ.passiveTexture == null)
                    //{
                    //    champ.passiveTexture = Texture.FromFile(Drawing.Direct3DDevice, loc + "PASSIVE\\" + s1[0].Name + ".dds");
                    //    if (champ.passiveTexture == null  && champ.passiveTexture.NativePointer != null)
                    //    {
                    //        return false;
                    //    }
                    //}
                    //else
                    //{
                    //    champ.passiveTexture = overlaySpellItem;
                    //}
                    SpriteHelper.LoadTexture(s1[0].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[0].Name + ".dds", ref champ.SGui.SpellQ.Texture);
                    SpriteHelper.LoadTexture(s1[1].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[1].Name + ".dds", ref champ.SGui.SpellW.Texture);
                    SpriteHelper.LoadTexture(s1[2].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[2].Name + ".dds", ref champ.SGui.SpellE.Texture);
                    SpriteHelper.LoadTexture(s1[3].Name + ".dds", "SPELLS/", loc + "SPELLS\\" + s1[3].Name + ".dds", ref champ.SGui.SpellR.Texture);

                    var s2 = hero.SummonerSpellbook.Spells;
                    SpriteHelper.LoadTexture(s2[0].Name + ".dds", "SUMMONERS/", loc + "SUMMONERS\\" + s2[0].Name + ".dds", ref champ.SGui.SpellSum1.Texture);
                    SpriteHelper.LoadTexture(s2[1].Name + ".dds", "SUMMONERS/", loc + "SUMMONERS\\" + s2[1].Name + ".dds", ref champ.SGui.SpellSum2.Texture);

                    Enemies.Add(hero, champ);
                }
            }
            UpdateItems();
            CalculateSizes();

            return true;
        }
Example #3
0
        private async Task<ChampInfos> CreateOverHeadHud(Obj_AI_Hero hero, ChampInfos champ, float percentScale)
        {
            float scaleSpell = GetHeadMode(hero.IsEnemy).SelectedIndex == 1 ? 1.7f : 1.0f;
            float scaleSum = GetHeadMode(hero.IsEnemy).SelectedIndex == 1 ? 1.0f : 0.8f;

            Task<SpriteHelper.SpriteInfo> taskInfo = null;
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.Summoner1).Name, champ.SpellSum1.Sprite[1], SpriteHelper.DownloadType.Summoner);
            champ.SpellSum1.Sprite[1] = await taskInfo;
            if (!champ.SpellSum1.Sprite[1].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSummonerSpellImage(hero, champ.SpellSum1.SizeHpBar, champ.SpellSum1.Sprite[1], SpellSlot.Summoner1, UpdateMethod.Hp));
            }
            else
            {
                champ.SpellSum1.Sprite[1].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellSum1.SizeHpBar.Width, champ.SpellSum1.SizeHpBar.Height);
                };
                champ.SpellSum1.Sprite[1].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 0 && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
                };
                champ.SpellSum1.Sprite[1].Sprite.Add();
            }

            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.Summoner2).Name, champ.SpellSum2.Sprite[1], SpriteHelper.DownloadType.Summoner);
            champ.SpellSum2.Sprite[1] = await taskInfo;
            if (!champ.SpellSum2.Sprite[1].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSummonerSpellImage(hero, champ.SpellSum2.SizeHpBar, champ.SpellSum2.Sprite[1], SpellSlot.Summoner2, UpdateMethod.Hp));
            }
            else
            {
                champ.SpellSum2.Sprite[1].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellSum2.SizeHpBar.Width, champ.SpellSum2.SizeHpBar.Height);
                };
                champ.SpellSum2.Sprite[1].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() &&
                           GetMode(hero.IsEnemy).SelectedIndex != 0 &&
                           hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
                };
                champ.SpellSum2.Sprite[1].Sprite.Add();
            }      

            //SpriteHelper.LoadTexture(s1[1].Name + ".dds", "PASSIVE/", loc + "PASSIVE\\" + s1[1].Name + ".dds", ref champ.Passive.Texture);
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.Q).Name, champ.SpellQ.Sprite[1], SpriteHelper.DownloadType.Spell);
            champ.SpellQ.Sprite[1] = await taskInfo;
            if (!champ.SpellQ.Sprite[1].LoadingFinished)
            {
                //Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellQ.SizeHpBar, champ.SpellQ.Sprite[1], SpellSlot.Q, UpdateMethod.Hp));
            }
            else
            {
                //SetScale(ref champ.SpellQ.Sprite[1].Sprite, _spellSize, scaleSpell * percentScale);
                champ.SpellQ.Sprite[1].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellQ.SizeHpBar.Width, champ.SpellQ.SizeHpBar.Height);
                };
                champ.SpellQ.Sprite[1].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() &&
                            GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 0 &&
                            hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
                };
                champ.SpellQ.Sprite[1].Sprite.Add();
            }

            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.W).Name, champ.SpellW.Sprite[1], SpriteHelper.DownloadType.Spell);
            champ.SpellW.Sprite[1] = await taskInfo;
            if (!champ.SpellW.Sprite[1].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellW.SizeHpBar, champ.SpellW.Sprite[1], SpellSlot.W, UpdateMethod.Hp));
            }
            else
            {
                champ.SpellW.Sprite[1].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellW.SizeHpBar.Width, champ.SpellW.SizeHpBar.Height);
                };
                champ.SpellW.Sprite[1].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() &&
                            GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 0 &&
                            hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
                };
                champ.SpellW.Sprite[1].Sprite.Add();
            }

            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.E).Name, champ.SpellE.Sprite[1], SpriteHelper.DownloadType.Spell);
            champ.SpellE.Sprite[1] = await taskInfo;
            if (!champ.SpellE.Sprite[1].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellE.SizeHpBar, champ.SpellE.Sprite[1], SpellSlot.E, UpdateMethod.Hp));
            }
            else
            {
                champ.SpellE.Sprite[1].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellE.SizeHpBar.Width, champ.SpellE.SizeHpBar.Height);
                };
                champ.SpellE.Sprite[1].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() &&
                            GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 0 &&
                            hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
                };
                champ.SpellE.Sprite[1].Sprite.Add();
            }

            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.R).Name, champ.SpellR.Sprite[1], SpriteHelper.DownloadType.Spell);
            champ.SpellR.Sprite[1] = await taskInfo;
            if (!champ.SpellR.Sprite[1].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellR.SizeHpBar, champ.SpellR.Sprite[1], SpellSlot.R, UpdateMethod.Hp));
            }
            else
            {
                champ.SpellR.Sprite[1].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellR.SizeHpBar.Width, champ.SpellR.SizeHpBar.Height);
                };
                champ.SpellR.Sprite[1].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() &&
                            GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 0 &&
                            hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
                };
                champ.SpellR.Sprite[1].Sprite.Add();
            }                

            //////

            champ.SpellQ.Rectangle[1] = new Render.Rectangle(champ.SpellQ.SizeHpBar.Width, champ.SpellQ.SizeHpBar.Height,
                _spellSize.Width, _spellSize.Height, SharpDX.Color.Red);
            champ.SpellQ.Rectangle[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellQ.SizeHpBar.Width, champ.SpellQ.SizeHpBar.Height);
            };
            champ.SpellQ.Rectangle[1].VisibleCondition = sender =>
            {
                return IsActive() &&
                        GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 1 &&
                        hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellQ.Rectangle[1].Add();

            champ.SpellW.Rectangle[1] = new Render.Rectangle(champ.SpellW.SizeHpBar.Width, champ.SpellW.SizeHpBar.Height,
                _spellSize.Width, _spellSize.Height, SharpDX.Color.Red);
            champ.SpellW.Rectangle[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellW.SizeHpBar.Width, champ.SpellW.SizeHpBar.Height);
            };
            champ.SpellW.Rectangle[1].VisibleCondition = sender =>
            {
                return IsActive() &&
                        GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 1 &&
                        hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellW.Rectangle[1].Add();

            champ.SpellE.Rectangle[1] = new Render.Rectangle(champ.SpellE.SizeHpBar.Width, champ.SpellE.SizeHpBar.Height,
                _spellSize.Width, _spellSize.Height, SharpDX.Color.Red);
            champ.SpellE.Rectangle[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellE.SizeHpBar.Width, champ.SpellE.SizeHpBar.Height);
            };
            champ.SpellE.Rectangle[1].VisibleCondition = sender =>
            {
                return IsActive() &&
                        GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 1 &&
                        hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellE.Rectangle[1].Add();

            champ.SpellR.Rectangle[1] = new Render.Rectangle(champ.SpellR.SizeHpBar.Width, champ.SpellR.SizeHpBar.Height,
                _spellSize.Width, _spellSize.Height, SharpDX.Color.Red);
            champ.SpellR.Rectangle[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellR.SizeHpBar.Width, champ.SpellR.SizeHpBar.Height);
            };
            champ.SpellR.Rectangle[1].VisibleCondition = sender =>
            {
                return IsActive() &&
                        GetMode(hero.IsEnemy).SelectedIndex != 0 && GetHeadDisplayMode(hero.IsEnemy).SelectedIndex == 1 &&
                        hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellR.Rectangle[1].Add();

            ///////
             
            champ.SpellQ.Text[1] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellQ.Text[1].TextUpdate = delegate
            {
                return champ.SpellQ.Value.ToString();
            };
            champ.SpellQ.Text[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellQ.CoordsHpBar.Width, champ.SpellQ.CoordsHpBar.Height);
            };
            champ.SpellQ.Text[1].VisibleCondition = sender =>
            {
                return IsActive() &&
                    champ.SpellQ.Value > 0.0f && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellQ.Text[1].OutLined = true;
            champ.SpellQ.Text[1].Centered = true;
            champ.SpellQ.Text[1].Add();

            champ.SpellW.Text[1] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellW.Text[1].TextUpdate = delegate
            {
                return champ.SpellW.Value.ToString();
            };
            champ.SpellW.Text[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellW.CoordsHpBar.Width, champ.SpellW.CoordsHpBar.Height);
            };
            champ.SpellW.Text[1].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellW.Value > 0.0f && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellW.Text[1].OutLined = true;
            champ.SpellW.Text[1].Centered = true;
            champ.SpellW.Text[1].Add();

            champ.SpellE.Text[1] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellE.Text[1].TextUpdate = delegate
            {
                return champ.SpellE.Value.ToString();
            };
            champ.SpellE.Text[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellE.CoordsHpBar.Width, champ.SpellE.CoordsHpBar.Height);
            };
            champ.SpellE.Text[1].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellE.Value > 0.0f && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellE.Text[1].OutLined = true;
            champ.SpellE.Text[1].Centered = true;
            champ.SpellE.Text[1].Add();

            champ.SpellR.Text[1] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellR.Text[1].TextUpdate = delegate
            {
                return champ.SpellR.Value.ToString();
            };
            champ.SpellR.Text[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellR.CoordsHpBar.Width, champ.SpellR.CoordsHpBar.Height);
            };
            champ.SpellR.Text[1].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellR.Value > 0.0f && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellR.Text[1].OutLined = true;
            champ.SpellR.Text[1].Centered = true;
            champ.SpellR.Text[1].Add();

            champ.SpellSum1.Text[1] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.SpellSum1.Text[1].TextUpdate = delegate
            {
                return champ.SpellSum1.Value.ToString();
            };
            champ.SpellSum1.Text[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellSum1.CoordsHpBar.Width, champ.SpellSum1.CoordsHpBar.Height);
            };
            champ.SpellSum1.Text[1].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellSum1.Value > 0.0f && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy);
            };
            champ.SpellSum1.Text[1].OutLined = true;
            champ.SpellSum1.Text[1].Centered = true;
            champ.SpellSum1.Text[1].Add();

            champ.SpellSum2.Text[1] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.SpellSum2.Text[1].TextUpdate = delegate
            {
                return champ.SpellSum2.Value.ToString();
            };
            champ.SpellSum2.Text[1].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellSum2.CoordsHpBar.Width, champ.SpellSum2.CoordsHpBar.Height);
            };
            champ.SpellSum2.Text[1].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellSum2.Value > 0.0f && hero.IsVisible && !hero.IsDead && GetUiActive(hero.IsEnemy); 
            };
            champ.SpellSum2.Text[1].OutLined = true;
            champ.SpellSum2.Text[1].Centered = true;
            champ.SpellSum2.Text[1].Add();

            return champ;
        }
Example #4
0
        private void Init()
        {
            int i = 0;
            foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
            {
                if (hero.IsMe)
                    continue;
                i++;
                var champ = new ChampInfos();

                champ.RecallInfo = new Packet.S2C.Teleport.Struct(hero.NetworkId, Packet.S2C.Teleport.Status.Unknown, Packet.S2C.Teleport.Type.Unknown, 0, 0);

                if (hero.IsEnemy)
                {
                    _enemies.Add(hero, champ);
                }
                if (!hero.IsEnemy)
                {
                    _allies.Add(hero, champ);
                }
            }
            InitCustomSpells();
            new Thread(LoadSpritesAsync).Start();
            LoadObjectsSync();
        }
Example #5
0
        private async Task<ChampInfos> CreateSideHud(Obj_AI_Hero hero, ChampInfos champ, float percentScale)
        {
            float percentHealth = CalcHpBar(hero);
            float percentMana = CalcManaBar(hero);
            //SpriteHelper.LoadTexture("ItemSlotEmpty", ref _overlayEmptyItem, SpriteHelper.TextureType.Default);
            Console.WriteLine(hero.ChampionName);
            Console.WriteLine("Champ");
            Task<SpriteHelper.SpriteInfo> taskInfo = null;
            taskInfo = SpriteHelper.LoadTextureAsync(hero.ChampionName, champ.Champ.Sprite[0], SpriteHelper.DownloadType.Champion);
            champ.Champ.Sprite[0] = await taskInfo;
            if (!champ.Champ.Sprite[0].LoadingFinished)
            {
                //Utility.DelayAction.Add(5000, () => UpdateChampImage(hero, champ.Champ.SizeSideBar, champ.Champ.Sprite[0], UpdateMethod.Side));
            }
            else
            {
                champ.Champ.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.Champ.SizeSideBar.Width, champ.Champ.SizeSideBar.Height);
                };
                champ.Champ.Sprite[0].Sprite.VisibleCondition = delegate
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
                };
                champ.Champ.Sprite[0].Sprite.Add(0);
            }

            //SpriteHelper.LoadTexture(s1[0].Name + ".dds", "PASSIVE/", loc + "PASSIVE\\" + s1[0].Name + ".dds", ref champ.Passive.Texture);
            Console.WriteLine("SpellQ");
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.Q).Name, champ.SpellQ.Sprite[0], SpriteHelper.DownloadType.Spell);
            champ.SpellQ.Sprite[0] = await taskInfo;
            if (!champ.SpellQ.Sprite[0].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellQ.SizeSideBar, champ.SpellQ.Sprite[0], SpellSlot.Q, UpdateMethod.Side));
            }
            else
            {
                champ.SpellQ.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellQ.SizeSideBar.Width, champ.SpellQ.SizeSideBar.Height);
                };
                champ.SpellQ.Sprite[0].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && 
                        GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
                };
                champ.SpellQ.Sprite[0].Sprite.Add(0);
            }

            Console.WriteLine("SpellW");
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.W).Name, champ.SpellW.Sprite[0], SpriteHelper.DownloadType.Spell);
            champ.SpellW.Sprite[0] = await taskInfo;
            if (!champ.SpellW.Sprite[0].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellW.SizeSideBar, champ.SpellW.Sprite[0], SpellSlot.W, UpdateMethod.Side));
            }
            else
            {
                champ.SpellW.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellW.SizeSideBar.Width, champ.SpellW.SizeSideBar.Height);
                };
                champ.SpellW.Sprite[0].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                        GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
                };
                champ.SpellW.Sprite[0].Sprite.Add(0);
            }

            Console.WriteLine("SpellE");
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.E).Name, champ.SpellE.Sprite[0], SpriteHelper.DownloadType.Spell);
            champ.SpellE.Sprite[0] = await taskInfo;
            if (!champ.SpellE.Sprite[0].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellE.SizeSideBar, champ.SpellE.Sprite[0], SpellSlot.E, UpdateMethod.Side));
            }
            else
            {
                champ.SpellE.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellE.SizeSideBar.Width, champ.SpellE.SizeSideBar.Height);
                };
                champ.SpellE.Sprite[0].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                        GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
                };
                champ.SpellE.Sprite[0].Sprite.Add(0);
            }

            Console.WriteLine("SpellR");
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.R).Name, champ.SpellR.Sprite[0], SpriteHelper.DownloadType.Spell);
            champ.SpellR.Sprite[0] = await taskInfo;
            if (!champ.SpellR.Sprite[0].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSpellImage(hero, champ.SpellR.SizeSideBar, champ.SpellR.Sprite[0], SpellSlot.R, UpdateMethod.Side));
            }
            else
            {
                champ.SpellR.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellR.SizeSideBar.Width, champ.SpellR.SizeSideBar.Height);
                };
                champ.SpellR.Sprite[0].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                        GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
                };
                champ.SpellR.Sprite[0].Sprite.Add(0);
            }

            Console.WriteLine("Spell1");
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.Summoner1).Name, champ.SpellSum1.Sprite[0], SpriteHelper.DownloadType.Summoner);
            champ.SpellSum1.Sprite[0] = await taskInfo;
            if (!champ.SpellSum1.Sprite[0].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSummonerSpellImage(hero, champ.SpellSum1.SizeSideBar, champ.SpellSum1.Sprite[0], SpellSlot.Summoner1, UpdateMethod.Side));
            }
            else
            {
                champ.SpellSum1.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellSum1.SizeSideBar.Width, champ.SpellSum1.SizeSideBar.Height);
                };
                champ.SpellSum1.Sprite[0].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
                };
                champ.SpellSum1.Sprite[0].Sprite.Add(0);
            }

            Console.WriteLine("Spell2");
            taskInfo = SpriteHelper.LoadTextureAsync(hero.Spellbook.GetSpell(SpellSlot.Summoner2).Name, champ.SpellSum2.Sprite[0], SpriteHelper.DownloadType.Summoner);
            champ.SpellSum2.Sprite[0] = await taskInfo;
            if (!champ.SpellSum2.Sprite[0].LoadingFinished)
            {
                Utility.DelayAction.Add(5000, () => UpdateSummonerSpellImage(hero, champ.SpellSum2.SizeSideBar, champ.SpellSum2.Sprite[0], SpellSlot.Summoner2, UpdateMethod.Side));
            }
            else
            {
                champ.SpellSum2.Sprite[0].Sprite.PositionUpdate = delegate
                {
                    return new Vector2(champ.SpellSum2.SizeSideBar.Width, champ.SpellSum2.SizeSideBar.Height);
                };
                champ.SpellSum2.Sprite[0].Sprite.VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
                };
                champ.SpellSum2.Sprite[0].Sprite.Add(0);
            }

            Console.WriteLine("Backbar");
            champ.BackBar.Sprite[0] = new SpriteHelper.SpriteInfo();
            SpriteHelper.LoadTexture("BarBackground", ref champ.BackBar.Sprite[0], SpriteHelper.TextureType.Default);
            champ.BackBar.Sprite[0].Sprite.PositionUpdate = delegate
            {
                return new Vector2(champ.BackBar.SizeSideBar.Width, champ.BackBar.SizeSideBar.Height);
            };
            champ.BackBar.Sprite[0].Sprite.VisibleCondition = delegate
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
            };
            champ.BackBar.Sprite[0].Sprite.Add(0);

            Console.WriteLine("Healthbar");
            champ.HealthBar.Sprite[0] = new SpriteHelper.SpriteInfo();
            SpriteHelper.LoadTexture("HealthBar", ref champ.HealthBar.Sprite[0], SpriteHelper.TextureType.Default);
            //SetScaleX(ref champ.HealthBar.Sprite[0].Sprite, _healthManaBarSize, percentScale * percentHealth);
            champ.HealthBar.Sprite[0].Sprite.PositionUpdate = delegate
            {
                //SetScaleX(ref champ.HealthBar.Sprite[0].Sprite, _healthManaBarSize, percentScale * CalcHpBar(hero));
                return new Vector2(champ.HealthBar.SizeSideBar.Width, champ.HealthBar.SizeSideBar.Height);
            };
            champ.HealthBar.Sprite[0].Sprite.VisibleCondition = delegate
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
            };
            champ.HealthBar.Sprite[0].Sprite.Add(1);

            Console.WriteLine("Manabar");
            champ.ManaBar.Sprite[0] = new SpriteHelper.SpriteInfo();
            SpriteHelper.LoadTexture("ManaBar", ref champ.ManaBar.Sprite[0], SpriteHelper.TextureType.Default);
            //SetScaleX(ref champ.ManaBar.Sprite[0].Sprite, _healthManaBarSize, percentScale * percentMana);
            champ.ManaBar.Sprite[0].Sprite.PositionUpdate = delegate
            {
                //SetScaleX(ref champ.ManaBar.Sprite[0].Sprite, _healthManaBarSize, percentScale * CalcManaBar(hero));
                return new Vector2(champ.ManaBar.SizeSideBar.Width, champ.ManaBar.SizeSideBar.Height);
            };
            champ.ManaBar.Sprite[0].Sprite.VisibleCondition = delegate
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
            };
            champ.ManaBar.Sprite[0].Sprite.Add(1);

            Console.WriteLine("Recallbar");
            champ.RecallBar.Sprite[0] = new SpriteHelper.SpriteInfo();
            SpriteHelper.LoadTexture("RecallBar", ref champ.RecallBar.Sprite[0], SpriteHelper.TextureType.Default);
            champ.RecallBar.Sprite[0].Sprite.PositionUpdate = delegate
            {
                return new Vector2(champ.RecallBar.SizeSideBar.Width, champ.RecallBar.SizeSideBar.Height);
            };
            champ.RecallBar.Sprite[0].Sprite.VisibleCondition = delegate
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && 
                    GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.RecallBar.Sprite[0].Sprite.Color = new ColorBGRA(Color3.White, 0.55f);
            champ.RecallBar.Sprite[0].Sprite.Add(1);

            Console.WriteLine("Goldbar");
            champ.GoldCsLvlBar.Sprite[0] = new SpriteHelper.SpriteInfo();
            SpriteHelper.LoadTexture("GoldCsLvlBar", ref champ.GoldCsLvlBar.Sprite[0], SpriteHelper.TextureType.Default);
            champ.GoldCsLvlBar.Sprite[0].Sprite.PositionUpdate = delegate
            {
                return new Vector2(champ.Champ.SizeSideBar.Width, champ.Champ.SizeSideBar.Height);
            };
            champ.GoldCsLvlBar.Sprite[0].Sprite.VisibleCondition = delegate
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.GoldCsLvlBar.Sprite[0].Sprite.Color = new ColorBGRA(Color3.White, 0.55f);
            champ.GoldCsLvlBar.Sprite[0].Sprite.Add(1);

            ///////

            champ.SpellR.Rectangle[0] = new Render.Rectangle(champ.SpellR.SizeSideBar.Width, champ.SpellR.SizeSideBar.Height,
                _sumSize.Width, _sumSize.Height, SharpDX.Color.Red);
            champ.SpellR.Rectangle[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellR.SizeSideBar.Width, champ.SpellR.SizeSideBar.Height);
            };
            champ.SpellR.Rectangle[0].VisibleCondition = sender =>
            {
                return IsActive() &&
                        GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                        GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 1;
            };
            champ.SpellR.Rectangle[0].Add(1);

            ///////

            champ.HealthBar.Text[0] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.HealthBar.Text[0].TextUpdate = delegate
            {
                return champ.SHealth ?? "";
            };
            champ.HealthBar.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.HealthBar.CoordsSideBar.Width, champ.HealthBar.CoordsSideBar.Height);
            };
            champ.HealthBar.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
            };
            champ.HealthBar.Text[0].OutLined = true;
            champ.HealthBar.Text[0].Centered = true;
            champ.HealthBar.Text[0].Add(4);

            champ.ManaBar.Text[0] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.ManaBar.Text[0].TextUpdate = delegate
            {
                return champ.SMana ?? "";
            };
            champ.ManaBar.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.ManaBar.CoordsSideBar.Width, champ.ManaBar.CoordsSideBar.Height);
            };
            champ.ManaBar.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 && GetUiActive(hero.IsEnemy);
            };
            champ.ManaBar.Text[0].OutLined = true;
            champ.ManaBar.Text[0].Centered = true;
            champ.ManaBar.Text[0].Add(4);

            champ.SpellQ.Text[0] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellQ.Text[0].TextUpdate = delegate
            {
                return champ.SpellQ.Value.ToString();
            };
            champ.SpellQ.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellQ.CoordsSideBar.Width, champ.SpellQ.CoordsSideBar.Height);
            };
            champ.SpellQ.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellQ.Value > 0.0f && GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.SpellQ.Text[0].OutLined = true;
            champ.SpellQ.Text[0].Centered = true;
            champ.SpellQ.Text[0].Add(4);

            champ.SpellW.Text[0] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellW.Text[0].TextUpdate = delegate
            {
                return champ.SpellW.Value.ToString();
            };
            champ.SpellW.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellW.CoordsSideBar.Width, champ.SpellW.CoordsSideBar.Height);
            };
            champ.SpellW.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellW.Value > 0.0f && GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.SpellW.Text[0].OutLined = true;
            champ.SpellW.Text[0].Centered = true;
            champ.SpellW.Text[0].Add(4);

            champ.SpellE.Text[0] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellE.Text[0].TextUpdate = delegate
            {
                return champ.SpellE.Value.ToString();
            };
            champ.SpellE.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellE.CoordsSideBar.Width, champ.SpellE.CoordsSideBar.Height);
            };
            champ.SpellE.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellE.Value > 0.0f && GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.SpellE.Text[0].OutLined = true;
            champ.SpellE.Text[0].Centered = true;
            champ.SpellE.Text[0].Add(4);

            champ.SpellR.Text[0] = new Render.Text(0, 0, "", 14, SharpDX.Color.Orange);
            champ.SpellR.Text[0].TextUpdate = delegate
            {
                return champ.SpellR.Value.ToString();
            };
            champ.SpellR.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellR.CoordsSideBar.Width, champ.SpellR.CoordsSideBar.Height);
            };
            champ.SpellR.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellR.Value > 0.0f && GetUiActive(hero.IsEnemy);
            };
            champ.SpellR.Text[0].OutLined = true;
            champ.SpellR.Text[0].Centered = true;
            champ.SpellR.Text[0].Add(4);

            champ.Champ.Text[0] = new Render.Text(0, 0, "", 30, SharpDX.Color.Orange);
            champ.Champ.Text[0].TextUpdate = delegate
            {
                if (champ.DeathTimeDisplay > 0.0f && hero.IsDead)
                    return champ.DeathTimeDisplay.ToString();
                else if (champ.InvisibleTime > 0.0f && !hero.IsVisible)
                    return champ.InvisibleTime.ToString();
                return "";
            };
            champ.Champ.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.Champ.CoordsSideBar.Width, champ.Champ.CoordsSideBar.Height);
            };
            champ.Champ.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    ((champ.DeathTimeDisplay > 0.0f && hero.IsDead) || (champ.InvisibleTime > 0.0f && !hero.IsVisible)) && 
                    GetUiActive(hero.IsEnemy);
            };
            champ.Champ.Text[0].OutLined = true;
            champ.Champ.Text[0].Centered = true;
            champ.Champ.Text[0].Add(4);

            champ.SpellSum1.Text[0] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.SpellSum1.Text[0].TextUpdate = delegate
            {
                return champ.SpellSum1.Value.ToString();
            };
            champ.SpellSum1.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellSum1.CoordsSideBar.Width, champ.SpellSum1.CoordsSideBar.Height);
            };
            champ.SpellSum1.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellSum1.Value > 0.0f && GetUiActive(hero.IsEnemy);
            };
            champ.SpellSum1.Text[0].OutLined = true;
            champ.SpellSum1.Text[0].Centered = true;
            champ.SpellSum1.Text[0].Add(4);

            champ.SpellSum2.Text[0] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.SpellSum2.Text[0].TextUpdate = delegate
            {
                return champ.SpellSum2.Value.ToString();
            };
            champ.SpellSum2.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.SpellSum2.CoordsSideBar.Width, champ.SpellSum2.CoordsSideBar.Height);
            };
            champ.SpellSum2.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    champ.SpellSum2.Value > 0.0f && GetUiActive(hero.IsEnemy);
            };
            champ.SpellSum2.Text[0].OutLined = true;
            champ.SpellSum2.Text[0].Centered = true;
            champ.SpellSum2.Text[0].Add(4);

            foreach (var item in champ.Item)
            {
                if (item == null)
                    continue;
                item.Text[0] = new Render.Text(0, 0, "", 12, SharpDX.Color.Orange);
                item.Text[0].TextUpdate = delegate
                {
                    return item.Value.ToString();
                };
                item.Text[0].PositionUpdate = delegate
                {
                    return new Vector2(item.CoordsSideBar.Width, item.CoordsSideBar.Height);
                };
                item.Text[0].VisibleCondition = sender =>
                {
                    return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                        item.Value > 0.0f && UiTracker.GetMenuItem("SAssembliesItemPanelActive").GetValue<bool>() &&
                        GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
                };
                item.Text[0].OutLined = true;
                item.Text[0].Centered = true;
                item.Text[0].Add(4);
            }

            champ.Level.Text[0] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.Level.Text[0].TextUpdate = delegate
            {
                return champ.Level.Value.ToString();
            };
            champ.Level.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.Level.CoordsSideBar.Width, champ.Level.CoordsSideBar.Height);
            };
            champ.Level.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0; 
            };
            champ.Level.Text[0].OutLined = true;
            champ.Level.Text[0].Centered = true;
            champ.Level.Text[0].Add(4);

            champ.Cs.Text[0] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.Cs.Text[0].TextUpdate = delegate
            {
                return champ.Cs.Value.ToString();
            };
            champ.Cs.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.Cs.CoordsSideBar.Width, champ.Cs.CoordsSideBar.Height);
            };
            champ.Cs.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.Cs.Text[0].OutLined = true;
            champ.Cs.Text[0].Centered = true;
            champ.Cs.Text[0].Add(4);

            champ.RecallBar.Text[0] = new Render.Text(0, 0, "", 16, SharpDX.Color.Orange);
            champ.RecallBar.Text[0].TextUpdate = delegate
            {
                if (champ.RecallInfo.Start != 0)
                {
                    float time = Environment.TickCount + champ.RecallInfo.Duration - champ.RecallInfo.Start;
                    if (time > 0.0f &&
                        (champ.RecallInfo.Status == Packet.S2C.Teleport.Status.Start))
                    {
                        return "Porting";
                    }
                    else if (time < 30.0f &&
                             (champ.RecallInfo.Status == Packet.S2C.Teleport.Status.Finish))
                    {
                        return "Ported";
                    }
                    else if (time < 30.0f &&
                             (champ.RecallInfo.Status == Packet.S2C.Teleport.Status.Abort))
                    {
                        return "Canceled";
                    }
                }
                return "";
            };
            champ.RecallBar.Text[0].PositionUpdate = delegate
            {
                return new Vector2(champ.RecallBar.CoordsSideBar.Width, champ.RecallBar.CoordsSideBar.Height);
            };
            champ.RecallBar.Text[0].VisibleCondition = sender =>
            {
                return IsActive() && GetMode(hero.IsEnemy).SelectedIndex != 1 &&
                    GetUiActive(hero.IsEnemy) && GetSideDisplayMode(hero.IsEnemy).SelectedIndex == 0;
            };
            champ.RecallBar.Text[0].OutLined = true;
            champ.RecallBar.Text[0].Centered = true;
            champ.RecallBar.Text[0].Add(4);

            //champ.Champ.Text[0].TextFontDescription = new FontDescription()
            //{
            //    FaceName = "Calibri",
            //    Height = 24,
            //    OutputPrecision = FontPrecision.Default,
            //    Quality = FontQuality.Default
            //};

            return champ;
        }