コード例 #1
0
ファイル: MenuInit.cs プロジェクト: vikkaspattel/EnsageSharp
        public static void AddAllToMenu()
        {
            var mySpells = AbilityMain.Me.Spellbook.Spells.Where(x => AbilityDatabase.Find(x.Name) != null);
            var myItems  = AbilityMain.Me.Inventory.Items;
            var spells   = mySpells as Ability[] ?? mySpells.ToArray();
            var myItems1 = myItems as Item[] ?? myItems.ToArray();
            var blink    = myItems1.FirstOrDefault(x => x.Name == "item_blink");

            MyAbilities.SoulRing = myItems1.FirstOrDefault(x => x.Name == "item_soul_ring");
            if (blink != null)
            {
                MyAbilities.Blink = blink;
                BlinkMenu.Create(blink);
            }
            Nukes.AddAllNukes(spells, myItems1);
            Disables.AddAllDisables(spells, myItems1);
            Slows.AddAllSlows(spells, myItems1);
            Buffs.AddAllBuffs(spells, myItems1);
            Harrases.AddAllHarrases(spells, myItems1);
            Silences.AddAllSilences(spells, myItems1);
            Specials.AddAllSpecials(spells, myItems1);
            Heals.AddAllHeals(spells, myItems1);
            Shields.AddAllShields(spells, myItems1);
            MainMenu.Menu.AddSubMenu(MainMenu.AbilitiesMenu);
            MainMenu.DrawingsMenu.AddSubMenu(MainMenu.DamageIndicatorMenu);
            MainMenu.DrawingsMenu.AddSubMenu(MainMenu.GankDamageMenu);
            MainMenu.GankDamageMenu.AddItem(new MenuItem("enableGankDamage", "Enable: ").SetValue(true));
            MainMenu.GankDamageMenu.AddItem(
                new MenuItem("enableGankDamageAllies", "Enable for allies: ").SetValue(true));
            MainMenu.GankDamageMenu.AddItem(
                new MenuItem("enableGankDamageEnemies", "Enable for enemies: ").SetValue(true));
            MainMenu.DamageIndicatorMenu.AddItem(
                new MenuItem("abilityDamageIndicatorDrawDamage", "Draw Damage").SetValue(true));
            MainMenu.DamageIndicatorMenu.AddItem(
                new MenuItem("abilityDamageIndicatorDrawHits", "Draw hits").SetValue(true));
            MainMenu.DamageIndicatorMenu.AddItem(
                new MenuItem("abilityDamageIndicatorTextSize", "Increase text size").SetValue(new Slider(0, 0, 5)));
            MainMenu.DrawingsMenu.AddSubMenu(MainMenu.AbilityOverlayMenu);
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("spellOverlay", "SPELLS OVERLAY:").SetFontStyle(fontColor: Color.White));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("enableSpellOverlayEnemy", "Enable for enemies: ").SetValue(true));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("enableSpellOverlayAlly", "Enable for allies: ").SetValue(true));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("sizeSliderSpell", "Increase the size: ").SetValue(new Slider(0, 0, 25)));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("itemOverlay", "ITEMS OVERLAY:").SetFontStyle(fontColor: Color.White));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("enableItemOverlayEnemy", "Enable for enemies: ").SetValue(true));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("enableItemOverlayAlly", "Enable for allies: ").SetValue(true));
            MainMenu.AbilityOverlayMenu.AddItem(
                new MenuItem("sizeSliderItem", "Increase the size: ").SetValue(new Slider(0, 0, 25)));
            MainMenu.ComboKeysMenu.AddItem(new MenuItem("unfinishedFeature", "This feature is currently unfinished!"))
            .SetFontStyle(fontColor: Color.OrangeRed)
            .SetTooltip("Contains unfinished stuff, not all combos are tweaked/in right order.");
            MainMenu.ComboKeysMenu.AddItem(new MenuItem("abilityKey1", "Combo Key"))
            .SetValue(new KeyBind('G', KeyBindType.Press));
            MainMenu.ComboKeysMenu.AddItem(new MenuItem("abilityComboType", "Combo Order"))
            .SetValue(new StringList(new[] { "Normal", "Maximum Disable", "Maximum Damage" }));
            MainMenu.ComboKeysMenu.AddItem(new MenuItem("comboAbilitiesToggler", "Abilities in combo: "))
            .SetValue(new AbilityToggler(new Dictionary <string, bool>()));
            foreach (var spell in
                     from spell in spells
                     let data = AbilityDatabase.Find(spell.Name)
                                where
                                data != null &&
                                (data.IsNuke || data.IsDisable || data.IsHarras || data.IsBuff || data.WeakensEnemy ||
                                 data.IsSlow || data.IsSilence)
                                select spell)
            {
                var dv = spell.AbilityType != AbilityType.Ultimate;
                ComboMenu.AddAbility(spell.Name, dv);
            }
            foreach (var spell in
                     from spell in myItems1
                     let data = AbilityDatabase.Find(spell.Name)
                                where
                                data != null &&
                                (data.IsNuke || data.IsDisable || data.IsHarras || data.IsBuff || data.WeakensEnemy ||
                                 data.IsSlow || data.IsSilence)
                                select spell)
            {
                ComboMenu.AddAbility(spell.Name);
            }
            //if (blink != null)
            //{
            //    MainMenu.ComboKeysMenu.Item("comboAbilitiesToggler").GetValue<AbilityToggler>().Add(blink.Name);
            //}
            MainMenu.OptionsMenu.AddSubMenu(MainMenu.ComboKeysMenu);
            MainMenu.OptionsMenu.AddSubMenu(MainMenu.DrawingsMenu);
            MainMenu.Menu.AddSubMenu(MainMenu.OptionsMenu);
            MainMenu.Menu.AddSubMenu(MainMenu.RangeDrawingMenu);
        }
コード例 #2
0
ファイル: Update.cs プロジェクト: vikkaspattel/EnsageSharp
        public static void UpdateItems(EventArgs args)
        {
            if (!OnUpdateChecks.CanUpdate())
            {
                return;
            }
            try
            {
                if (!Utils.SleepCheck("checkitems"))
                {
                    return;
                }
                foreach (var item in
                         AbilityMain.Me.Inventory.Items)
                {
                    if (MyAbilities.Blink == null && NameManager.Name(item) == "item_blink")
                    {
                        //MainMenu.ComboKeysMenu.Item("comboAbilitiesToggler").GetValue<AbilityToggler>().Add(item.Name);
                        BlinkMenu.Create(item);
                        MyAbilities.Blink = item;
                        continue;
                    }

                    if (NameManager.Name(item) == "item_soul_ring")
                    {
                        MyAbilities.SoulRing = item;
                    }
                    if (NameManager.Name(item) == "item_aether_lens")
                    {
                        RangeDrawing.Update();
                    }
                    var data = AbilityDatabase.Find(NameManager.Name(item));

                    if (data == null)
                    {
                        continue;
                    }

                    if (!MyAbilities.OffensiveAbilities.ContainsValue(item))
                    {
                        var added = false;
                        if (data.IsSlow)
                        {
                            AddNewSlow(item);
                            added = true;
                        }
                        if (data.IsHarras)
                        {
                            AddNewHarras(item);
                            added = true;
                        }
                        if (data.IsBuff)
                        {
                            AddNewBuff(item);
                            added = true;
                        }
                        if (data.IsSilence)
                        {
                            AddNewSilence(item);
                            added = true;
                        }
                        if (data.TrueSight || data.WeakensEnemy || data.IsPurge)
                        {
                            AddNewSpecial(item, data);
                            added = true;
                        }
                        if (data.IsDisable)
                        {
                            AddNewDisable(item);
                            added = true;
                        }
                        if (data.IsNuke)
                        {
                            AddNewNuke(item);
                            added = true;
                        }
                        if (added)
                        {
                            RangeDrawing.AddRange(item);
                            ComboMenu.AddAbility(item.Name);
                        }
                    }
                    //Console.WriteLine(!MyAbilities.DeffensiveAbilities.ContainsValue(item) + " " + NameManager.Name(item) + " " + data.IsHeal);
                    if (!MyAbilities.DeffensiveAbilities.ContainsValue(item))
                    {
                        if (data.IsHeal)
                        {
                            AddNewHeal(item);
                        }
                        if (data.IsShield)
                        {
                            AddNewShield(item);
                        }
                    }
                }
                if (AbilityMain.Me.ClassID == ClassID.CDOTA_Unit_Hero_Rubick)
                {
                    foreach (var item in AllyHeroes.AbilityDictionary[NameManager.Name(AbilityMain.Me)])
                    {
                        var data = AbilityDatabase.Find(NameManager.Name(item));

                        if (data == null)
                        {
                            continue;
                        }

                        if (!MyAbilities.OffensiveAbilities.ContainsValue(item))
                        {
                            var added = false;
                            if (data.IsSlow)
                            {
                                AddNewSlow(item);
                                added = true;
                            }
                            if (data.IsHarras)
                            {
                                AddNewHarras(item);
                                added = true;
                            }
                            if (data.IsBuff)
                            {
                                AddNewBuff(item);
                                added = true;
                            }
                            if (data.IsSilence)
                            {
                                AddNewSilence(item);
                                added = true;
                            }
                            if (data.TrueSight || data.WeakensEnemy || data.IsPurge)
                            {
                                AddNewSpecial(item, data);
                                added = true;
                            }
                            if (data.IsDisable)
                            {
                                AddNewDisable(item);
                                added = true;
                            }
                            if (data.IsNuke)
                            {
                                AddNewNuke(item);
                                added = true;
                            }
                            if (added)
                            {
                                ComboMenu.AddAbility(item.Name);
                            }
                        }
                        //Console.WriteLine(!MyAbilities.DeffensiveAbilities.ContainsValue(item) + " " + NameManager.Name(item) + " " + data.IsHeal);
                        if (!MyAbilities.DeffensiveAbilities.ContainsValue(item))
                        {
                            if (data.IsHeal)
                            {
                                AddNewHeal(item);
                            }
                            if (data.IsShield)
                            {
                                AddNewShield(item);
                            }
                        }
                    }
                }
                Utils.Sleep(1000, "checkitems");
            }
            catch (Exception)
            {
                //
            }
        }