当前位置: 首页>>代码示例>>C#>>正文


C# Menu.AddMItem方法代码示例

本文整理汇总了C#中LeagueSharp.Common.Menu.AddMItem方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.AddMItem方法的具体用法?C# Menu.AddMItem怎么用?C# Menu.AddMItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LeagueSharp.Common.Menu的用法示例。


在下文中一共展示了Menu.AddMItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        public void Initialize(Menu menu)
        {
            for (int i = 0; i < _healthStates.Length; i++)
                _healthStates[i] = ObjectManager.Player.HealthPercent;

            menu.AddMItem("Use when:");
            menu.AddMItem("Health below %", new Slider(15, 1, 35), (sender, args) => _minHealth = args.GetNewValue<Slider>());
            menu.AddMItem("Health % gone in < 1 sec", new Slider(60), (sender, args) => _burstHealth = args.GetNewValue<Slider>());
            if (HeroManager.Allies.Any(ally => ally.NetworkId != ObjectManager.Player.NetworkId))
            {
                var allies = menu.CreateSubmenu("Save allies");
                allies.AddMItem("When health below %", new Slider(15, 1, 35), (sender, args) => _allyHealth = args.GetNewValue<Slider>());
                allies.AddMItem("And enemy distance <", new Slider(1500, 500, 2500), (sender, args) => _enemyDistance = args.GetNewValue<Slider>());
                HeroManager.Allies.Where(ally => ally.NetworkId != ObjectManager.Player.NetworkId).ToList().ForEach(ally => allies.AddMItem("Save " + ally.ChampionName, true, (sender, args) => _saveAllies[ally.ChampionName] = args.GetNewValue<bool>()));
            }

            Game.OnUpdate += (eArgs) =>
            {
                if (_lastHealthState + 0.1f < Game.Time)
                {
                    _lastHealthState = Game.Time;
                    _healthStates[(int)((Game.Time * 10) % 10)] = ObjectManager.Player.HealthPercent;
                }
            };

            //Drawing.OnDraw += (args) =>
            //{
            //    for (int i = 0; i < _healthStates.Length; i++)
            //    {
            //        Drawing.DrawText(800, 200 + i * 20, Color.Blue, _healthStates[i].ToString());
            //    }
            //};
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:33,代码来源:Heal.cs

示例2: Initialize

 public void Initialize(Menu menu, ItemManager itemManager)
 {
     menu.AddMItem("Enemy min HP %", new Slider(20), (sender, args) => _minEnemyHealth = args.GetNewValue<Slider>().Value).ProcStoredValueChanged<Slider>();
     if (ObjectManager.Player.ChampionName == "Twitch")
     {
         menu.AddMItem("Only in Twitch ult", true, (sender, args) => _onlyTwitchUlt = args.GetNewValue<bool>()).ProcStoredValueChanged<bool>();
     }
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:8,代码来源:YoumusBlade.cs

示例3: Initialize

        public static void Initialize(Menu healMenu, ComboProvider combo, bool autoUpdate = true)
        {
            if (!HasHeal()) return;
            _heal = GetHeal();

            healMenu.AddMItem("Only in combo", true, (sender, args) => _onlyCombo = args.GetNewValue<bool>());
            healMenu.AddMItem("Enabled", false, (sender, args) => _enabled = args.GetNewValue<bool>());
            healMenu.AddMItem("(WIP - I highly recommend using an Activator!)");
            if (autoUpdate)
                Game.OnUpdate += _ => Update(combo);
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:11,代码来源:HealManager.cs

示例4: Init

        public static void Init()
        {
            var mainMenu = new Menu("The DevAssistant", "TheDevAssistant", true);

            var drawSpells = true;
            var drawBuffs = true;
            bool drawItems = true;

            mainMenu.AddMItem("Draw Spells", false, (sender, args) => drawSpells = args.GetNewValue<bool>());
            mainMenu.AddMItem("Draw Buffs", false, (sender, args) => drawBuffs = args.GetNewValue<bool>());
            mainMenu.AddMItem("Draw Items", false, (sender, args) => drawItems= args.GetNewValue<bool>());
            mainMenu.ProcStoredValueChanged<bool>();
            mainMenu.AddToMainMenu();

            Drawing.OnDraw += (args) =>
            {
                int i = 50;
                if (drawBuffs)
                {
                    if (TargetSelector.GetSelectedTarget().IsValidTarget())
                    {

                        foreach (var buff in TargetSelector.GetSelectedTarget().Buffs)
                        {
                            Drawing.DrawText(200, i += 20, Color.Red, buff.Name);
                        }
                    }
                    else
                    {
                        foreach (var buff in ObjectManager.Player.Buffs)
                        {
                            Drawing.DrawText(200, i += 20, Color.Red, buff.Name);
                        }
                    }
                }

                i = 50;
                if (drawSpells)
                    foreach (var buff in ObjectManager.Player.Spellbook.Spells)
                    {
                        Drawing.DrawText(600, i += 20, Color.Red, buff.Name+" / "+buff.Ammo+" / "+buff.Level+" / ");
                    }

                i = 50;
                if (drawItems)
                    foreach (var buff in ObjectManager.Player.InventoryItems)
                    {
                        Drawing.DrawText(1000, i += 20, Color.Red, buff.Id+" / "+buff.IData.DisplayName+" / "+buff.IData.SpellName+" / "+buff.IData.EffectAmount[1]+" / ");
                    }
            };
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:51,代码来源:DevAssistant.cs

示例5: Initialize

 public static void Initialize(Menu manamanagerMenu)
 {
     //Only using this three, because a manamanager on Combo or None wouldn't make sense
     Initialize(manamanagerMenu, Orbwalking.OrbwalkingMode.Mixed);
     Initialize(manamanagerMenu, Orbwalking.OrbwalkingMode.LaneClear);
     Initialize(manamanagerMenu, Orbwalking.OrbwalkingMode.LastHit);
     manamanagerMenu.AddMItem("Enabled", true, (sender, args) => EnableLimitations = args.GetNewValue<bool>());
 }
开发者ID:werdbrian,项目名称:LeagueSharp-6,代码行数:8,代码来源:ManaManager.cs

示例6: Initialize

 public static void Initialize(Menu manamanagerMenu)
 {
     //Only using this three, because a manamanager on Combo or None wouldn't make sense
     Initialize(manamanagerMenu, Orbwalking.OrbwalkingMode.Mixed, "Harass");
     Initialize(manamanagerMenu, Orbwalking.OrbwalkingMode.LaneClear);
     Initialize(manamanagerMenu, Orbwalking.OrbwalkingMode.LastHit, "Lasthit (skill farm assist)");
     manamanagerMenu.AddMItem("Enabled", false, (sender, args) => EnableLimitations = args.GetNewValue<bool>());
     manamanagerMenu.ProcStoredValueChanged<bool>();
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:9,代码来源:ManaManager.cs

示例7: Initialize

 /// <summary>
 /// Adds to the menu and stuffs
 /// </summary>
 public static void Initialize(Menu igniteMenu)
 {
     _ignite = ObjectManager.Player.Spellbook.Spells.FirstOrDefault(spell => spell.Name == "summonerdot");
     if (_ignite == null) return;
     _igniteSpell = new Spell(_ignite.Slot);
     _igniteUsage = igniteMenu.AddMItem("Use Ignite", true);
     _igniteKillsteal = igniteMenu.AddMItem("Killsteal", false);
     _igniteOnlyCombo = igniteMenu.AddMItem("Only in combo", false);
     _igniteSituation = igniteMenu.AddMItem("Situation analysis", false);
     igniteMenu.AddMItem("Don't use if killable by");
     _igniteMaxAutoattacks = igniteMenu.AddMItem("X Autoattacks", new Slider(1, 0, 5));
     _igniteSpellsCooldown = igniteMenu.AddMItem("Don't use if skills up", false);
     _igniteCloseFight = igniteMenu.AddMItem("Ignore above in close fight", true);
     _igniteCloseFightHealth = igniteMenu.AddMItem("Close fight health diff %", new Slider(20));
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:18,代码来源:IgniteManager.cs

示例8: Init

        public static void Init()
        {
            var mainMenu = new Menu("The DevAssistant", "TheDevAssistant", true);

            var drawSpells = true;
            var drawBuffs = true;

            mainMenu.AddMItem("Draw Spells", true, (sender, args) => drawSpells = args.GetNewValue<bool>());
            mainMenu.AddMItem("Draw Buffs", true, (sender, args) => drawBuffs = args.GetNewValue<bool>());
            mainMenu.ProcStoredValueChanged<bool>();
            mainMenu.AddToMainMenu();

            Drawing.OnDraw += (args) =>
            {
                int i = 50;
                if (drawBuffs)
                {
                    if (TargetSelector.GetSelectedTarget().IsValidTarget())
                    {

                        foreach (var buff in TargetSelector.GetSelectedTarget().Buffs)
                        {
                            Drawing.DrawText(200, i += 20, Color.Red, buff.Name);
                        }
                    }
                    else
                    {
                        foreach (var buff in ObjectManager.Player.Buffs)
                        {
                            Drawing.DrawText(200, i += 20, Color.Red, buff.Name);
                        }
                    }
                }

                i = 50;
                if (drawSpells)
                    foreach (var buff in ObjectManager.Player.Spellbook.Spells)
                    {
                        Drawing.DrawText(600, i += 20, Color.Red, buff.Name);
                    }
            };
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:42,代码来源:DevAssistant.cs

示例9: Initialize

        public void Initialize(Menu menu)
        {
            menu.AddMItem("Min duration in ms", new Slider(1000, 0, 3000), (sender, args) => _minDuration = args.GetNewValue<Slider>());
            menu.AddMItem("1000 ms = 1 sec");
            var typeMenu = menu.CreateSubmenu("Use on");
            typeMenu.AddMItem("Blind", false, (sender, args) => _blind = args.GetNewValue<bool>());
            typeMenu.AddMItem("Silence", false, (sender, args) => _silence = args.GetNewValue<bool>());

            typeMenu.AddMItem("Stun", true, (sender, args) => _stun = args.GetNewValue<bool>());
            typeMenu.AddMItem("Fear", true, (sender, args) => _fear = args.GetNewValue<bool>());
            typeMenu.AddMItem("Snare", true, (sender, args) => _snare = args.GetNewValue<bool>());
            typeMenu.AddMItem("Polymorph", true, (sender, args) => _polymorph = args.GetNewValue<bool>());
            typeMenu.AddMItem("Charm", true, (sender, args) => _charm = args.GetNewValue<bool>());
            typeMenu.AddMItem("Sleep", true, (sender, args) => _sleep = args.GetNewValue<bool>());
            typeMenu.AddMItem("Taunt", true, (sender, args) => _taunt = args.GetNewValue<bool>());
            var miscMenu = menu.CreateSubmenu("Misc");
            miscMenu.AddMItem("Don't use on Alistar W (is a stun)", true, (sender, args) => _noAliW = args.GetNewValue<bool>());
            miscMenu.AddMItem("Use on killable Ignite", true, (sender, args) => _ignite = args.GetNewValue<bool>());
            miscMenu.AddMItem("Use on Exhaust", true, (sender, args) => _exhaust = args.GetNewValue<bool>());
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:20,代码来源:Cleanse.cs

示例10: Initialize

        public void Initialize(Menu menu, ItemManager itemManager)
        {
            menu.AddMItem("Use on enemy ults", true, (sender, args) => UseOnUltimates = args.GetNewValue<bool>());
            menu.AddMItem("Use when health %  < ", new Slider(40), (sender, args) => MinHealth = args.GetNewValue<Slider>().Value);

            Spellbook.OnCastSpell += (sender, args) =>
            {
                if (itemManager.IsTickingNow(this) && sender.Owner.IsEnemy && sender.Owner.Type == GameObjectType.obj_AI_Hero && args.Slot == SpellSlot.R && UseOnUltimates)
                {
                    if (args.Target != null && args.Target.IsValid && args.Target.IsMe)
                    {
                        Use(sender.Owner.Target as Obj_AI_Base);
                        return;
                    }

                    var halfLineLength = (args.EndPosition - args.StartPosition).Length() / 2f;
                    if (ObjectManager.Player.Position.Distance(args.StartPosition) > halfLineLength && ObjectManager.Player.Position.Distance(args.EndPosition) > halfLineLength) return;
                    Use(sender.Owner.Target as Obj_AI_Base);
                }
            };
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:21,代码来源:SeraphsEmbrace.cs

示例11: Initialize

 public static void Initialize(Menu menu, string menuName = "Manamanager", bool mixed = true, bool lasthit = true, bool laneclear = true)
 {
     //Only using this three, because a manamanager on Combo or None wouldn't make sense
     var mmMenu = new Menu("Manamanager", "Manamanager");
     if (mixed)
         Initialize(mmMenu, Orbwalking.OrbwalkingMode.Mixed);
     if (laneclear)
         Initialize(mmMenu, Orbwalking.OrbwalkingMode.LaneClear);
     if (lasthit)
         Initialize(mmMenu, Orbwalking.OrbwalkingMode.LastHit);
     mmMenu.AddMItem("Enabled", true, (sender, args) => EnableLimitations = args.GetNewValue<bool>());
     menu.AddSubMenu(mmMenu);
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:13,代码来源:ManaManager.cs

示例12: Initialize

 public void Initialize(Menu menu)
 {
     menu.AddMItem("After attack", true, (sender, args) => _afterAttack = args.GetNewValue<bool>());
     menu.ProcStoredValueChanged<bool>();
     Orbwalking.AfterAttack += (sender, args) => _justAttacked = true;
 }
开发者ID:werdbrian,项目名称:LeagueSharp-6,代码行数:6,代码来源:RavenousHydra.cs

示例13: Initialize

 public void Initialize(Menu menu)
 {
     menu.AddMItem("Player max HP %", new Slider(80), (sender, args) => _maxPlayerHealth = args.GetNewValue<Slider>().Value);
     menu.AddMItem("Enemy min HP %", new Slider(20), (sender, args) => _minEnemyHealth = args.GetNewValue<Slider>().Value);
     menu.ProcStoredValueChanged<Slider>();
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:6,代码来源:Botrk.cs

示例14: Initialize

 public void Initialize(Menu menu, ItemManager itemManager)
 {
     menu.AddMItem("Player max HP %", new Slider(80), val => _maxPlayerHealth = val.Value);
     menu.AddMItem("Enemy min HP %", new Slider(20), val => _minEnemyHealth = val.Value);
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:5,代码来源:Botrk.cs

示例15: Initialize

 public void Initialize(Menu menu, ItemManager itemManager)
 {
     menu.AddMItem("Enemy min HP %", new Slider(20), (sender, args) => _minEnemyHealth = args.GetNewValue<Slider>().Value).ProcStoredValueChanged<Slider>();
 }
开发者ID:jayblah,项目名称:TheNinow,代码行数:4,代码来源:BilgewaterCutlass.cs


注:本文中的LeagueSharp.Common.Menu.AddMItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。