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


C# Menu.CreateSubmenu方法代码示例

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


在下文中一共展示了Menu.CreateSubmenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
        {
            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

示例3: Load

        public void Load(EventArgs eArgs)
        {
            if (ObjectManager.Player.ChampionName != "Cassiopeia") return;

            //ItemSeraphsEmbrace
            var mainMenu = new Menu("The Cassiopeia", "TheCassiopeia", true);
            var orbwalkerMenu = mainMenu.CreateSubmenu("Orbwalker");
            var targetselectorMenu = mainMenu.CreateSubmenu("Target Selector");
            var comboMenu = mainMenu.CreateSubmenu("Combo");
            var ultMenu = mainMenu.CreateSubmenu("Ultimate Settings");
            var harassMenu = mainMenu.CreateSubmenu("Harass");
            var laneclearMenu = mainMenu.CreateSubmenu("Lane Clear");
            var lasthitMenu = mainMenu.CreateSubmenu("Last Hit");
            var burstmodeMenu = mainMenu.CreateSubmenu("Mode: Burst");
            var lanepressureMenu = mainMenu.CreateSubmenu("Mode: Lane Pressure");

            var gapcloserMenu = mainMenu.CreateSubmenu("Gapcloser");
            // var interrupterMenu = mainMenu.CreateSubmenu("Interrupter");
            var manamanagerMenu = mainMenu.CreateSubmenu("Mana Manager");
            var miscMenu = mainMenu.CreateSubmenu("Miscellaneous");
            var summonerMenu = mainMenu.CreateSubmenu("Summoners");
            var itemMenu = mainMenu.CreateSubmenu("Items");
            var drawingMenu = mainMenu.CreateSubmenu("Drawing");
            var autolevelMenu = mainMenu.CreateSubmenu("Auto-Level Spells");
            var infoMenu = mainMenu.CreateSubmenu("Info");

            var orbwalker = new Orbwalking.Orbwalker(orbwalkerMenu);
            TargetSelector.AddToMenu(targetselectorMenu);

            var provider = new CassioCombo(1000, orbwalker, new CassQ(SpellSlot.Q), new CassW(SpellSlot.W), new CassE(SpellSlot.E), new CassR(SpellSlot.R));

            provider.CreateBasicMenu(comboMenu, harassMenu, laneclearMenu, gapcloserMenu, null, manamanagerMenu, summonerMenu, itemMenu, drawingMenu, false);
            provider.CreateAutoLevelMenu(autolevelMenu, ComboProvider.SpellOrder.RQEEW, ComboProvider.SpellOrder.REQW);

            ultMenu.AddMItem("NOTE: Uses R if ANY conditions apply.");

            if (HeroManager.Enemies.Count >= 3)
            {
                ultMenu.AddMItem("Min Enemies (Facing)", new Slider(2, 1, HeroManager.Enemies.Count), (sender, args) => provider.GetSkill<CassR>().MinTargetsFacing = args.GetNewValue<Slider>().Value);
                ultMenu.AddMItem("Min Enemies (Not Facing)", new Slider(HeroManager.Enemies.Count - 1, 1, HeroManager.Enemies.Count), (sender, args) => provider.GetSkill<CassR>().MinTargetsNotFacing = args.GetNewValue<Slider>().Value);

            }
            else
            {
                ultMenu.AddMItem("Min Enemies (Facing)", new Slider(1, 1, HeroManager.Enemies.Count), (sender, args) => provider.GetSkill<CassR>().MinTargetsFacing = args.GetNewValue<Slider>().Value);
                ultMenu.AddMItem("Min Enemies (Not Facing)", new Slider(1, 1, HeroManager.Enemies.Count), (sender, args) => provider.GetSkill<CassR>().MinTargetsNotFacing = args.GetNewValue<Slider>().Value);
            }

            ultMenu.AddMItem("Do Above Only in Combo", true, (sender, args) => provider.GetSkill<CassR>().MinEnemiesOnlyInCombo = args.GetNewValue<bool>());
            ultMenu.AddMItem("Ult if Target Killable with Combo", true, (sender, args) => provider.GetSkill<CassR>().UltOnKillable = args.GetNewValue<bool>());
            ultMenu.AddMItem("Only R if Target has Health % > Than", new Slider(30), (sender, args) => provider.GetSkill<CassR>().MinHealth = args.GetNewValue<Slider>().Value);
            ultMenu.AddMItem("Block R that Won't Hit", false, (sender, args) => provider.BlockBadUlts = args.GetNewValue<bool>());
            ultMenu.AddMItem("Range", new Slider(700, 400, 825), (sender, args) => provider.GetSkill<CassR>().Range = args.GetNewValue<Slider>().Value);
            provider.AssistedUltMenu = ultMenu.AddMItem("Assisted Ult", new KeyBind(82, KeyBindType.Press));

            ultMenu.ProcStoredValueChanged<Slider>();
            ultMenu.ProcStoredValueChanged<bool>();

            harassMenu.AddMItem("Auto Harass", false, (sender, args) => provider.GetSkill<CassQ>().AutoHarass = args.GetNewValue<bool>());
            harassMenu.AddMItem("Min Mana %", new Slider(60), (sender, args) => provider.GetSkill<CassQ>().AutoHarassMana = args.GetNewValue<Slider>().Value);
            harassMenu.ProcStoredValueChanged<bool>();
            harassMenu.ProcStoredValueChanged<Slider>();

            burstmodeMenu.AddMItem("[Burst Mode = Full DPS mode, replaces Combo when Enabled]");
            var burstMode = provider.BurstMode = burstmodeMenu.AddMItem("Burst Mode Enabled", new KeyBind(78, KeyBindType.Toggle));
            provider.GetSkill<CassR>().BurstMode = burstMode;
            burstMode.Permashow(customdisplayname: "Burst Mode");
            burstmodeMenu.AddMItem("Auto-Burst Mode if My Health % < Than ", new Slider(25), (sender, args) => provider.GetSkill<CassR>().PanicModeHealth = args.GetNewValue<Slider>().Value);
            burstmodeMenu.AddMItem("Use Ignite in Burst Mode", false, (sender, args) => provider.IgniteInBurstMode = args.GetNewValue<bool>());
            burstmodeMenu.AddMItem("Ignite Only if E on Cooldown", false, (sender, args) => provider.OnlyIgniteWhenNoE = args.GetNewValue<bool>());
            burstmodeMenu.ProcStoredValueChanged<Slider>();
            burstmodeMenu.ProcStoredValueChanged<bool>();

            comboMenu.AddMItem("Only Kill non-Poisoned with E if No Other Enemies Nearby", false, (sender, args) => provider.GetSkill<CassE>().OnlyKillNonPIn1V1 = args.GetNewValue<bool>());
            comboMenu.AddMItem("Fast Combo (Small Chance to E non-Poisoned)", true, (sender, args) => provider.GetSkill<CassQ>().FastCombo = args.GetNewValue<bool>());
            //comboMenu.AddMItem("Risky mode (uses fast combo often, but more fails)", false, (sender, args) => provider.GetSkill<CassQ>().RiskyCombo = args.GetNewValue<bool>());
            comboMenu.AddMItem("AA in Combo (Disable for Better Kiting)", true, (sender, args) => provider.AutoInCombo = args.GetNewValue<bool>());
            comboMenu.ProcStoredValueChanged<bool>();

            var stackTearItem = miscMenu.AddMItem("Stack Tear", new KeyBind(77, KeyBindType.Toggle, true));
            miscMenu.AddMItem("NOTE: Will only stack when no enemies nearby.");
            provider.GetSkill<CassQ>().StackTear = stackTearItem;
            stackTearItem.Permashow();
            miscMenu.AddMItem("Min Mana % for Tear Stacking", new Slider(90), (sender, args) => provider.GetSkill<CassQ>().MinTearStackMana = args.GetNewValue<Slider>().Value);
            miscMenu.AddMItem("Make Poison Influence Target Selection", true, (sender, args) => provider.EnablePoisonTargetSelection = args.GetNewValue<bool>());
            miscMenu.ProcStoredValueChanged<Slider>();
            miscMenu.ProcStoredValueChanged<bool>();

            miscMenu.AddMItem("Enable this if you are Hawk", false, (sender, args) =>
            {
                ObjectManager.Player.SetSkin(args.GetNewValue<bool>() ? "Trundle" : "Cassiopeia", 0);
                Utility.DelayAction.Add(1000, () => Game.Say("/laugh"));
            });

            Circle q = new Circle(true, Color.GreenYellow), e = new Circle(false, Color.Red);

            drawingMenu.AddMItem("Q Range", q, (sender, args) => q = args.GetNewValue<Circle>());
            drawingMenu.AddMItem("E Range", e, (sender, args) => e = args.GetNewValue<Circle>());
            drawingMenu.ProcStoredValueChanged<Circle>();
            drawingMenu.ProcStoredValueChanged<bool>();
//.........这里部分代码省略.........
开发者ID:jayblah,项目名称:TheNinow,代码行数:101,代码来源:Cassiopeia.cs

示例4: Load

        public void Load()
        {
            if (ObjectManager.Player.ChampionName != "Garen")
                return;
            Notifications.AddNotification("The Garen v2 loaded!", 3);

            var mainMenu = new Menu("The Garen", "The Garen", true);
            var orbwalkerMenu = mainMenu.CreateSubmenu("Orbwalker");
            var targetSelectorMenu = mainMenu.CreateSubmenu("Target Selector");
            var comboMenu = mainMenu.CreateSubmenu("Combo");
            var laneClearMenu = mainMenu.CreateSubmenu("Laneclear");
            var miscMenu = mainMenu.CreateSubmenu("Misc");
            var items = mainMenu.CreateSubmenu("Items");
            var gapcloserMenu = mainMenu.CreateSubmenu("Gapcloser");
            var interrupterMenu = mainMenu.CreateSubmenu("Interrupter");
            var drawingMenu = mainMenu.CreateSubmenu("Drawing");

            var orbwalker = new Orbwalking.Orbwalker(orbwalkerMenu);
            TargetSelector.AddToMenu(targetSelectorMenu);

            _comboProvider = new ComboProvider(500, new Skill[] { new GarenQ(new Spell(SpellSlot.Q)), new GarenW(new Spell(SpellSlot.W)), new GarenE(new Spell(SpellSlot.E)), new GarenR(new Spell(SpellSlot.R)) }.ToList(), orbwalker);
            _r = _comboProvider.GetSkill<GarenR>();
            _flash = ObjectManager.Player.Spellbook.Spells.FirstOrDefault(spell => spell.Name == "summonerflash");
            _comboProvider.CreateBasicMenu(comboMenu, null, null, gapcloserMenu, interrupterMenu, null, mainMenu.CreateSubmenu("Ignite"), items, false);
            _comboProvider.CreateLaneclearMenu(laneClearMenu, false, SpellSlot.W);

            comboMenu.AddMItem("Q After Auto Attack", true, (sender, args) => _comboProvider.GetSkill<GarenQ>().OnlyAfterAuto = args.GetNewValue<bool>());
            comboMenu.AddMItem("E After Auto Attack", true, (sender, args) => _comboProvider.GetSkill<GarenE>().OnlyAfterAuto = args.GetNewValue<bool>());
            comboMenu.AddMItem("R Killsteal", false, (sender, args) => _comboProvider.GetSkill<GarenR>().Killsteal = args.GetNewValue<bool>());
            comboMenu.AddMItem("Q if not in range", true, (sender, args) => _comboProvider.GetSkill<GarenQ>().UseWhenOutOfRange = args.GetNewValue<bool>());
            comboMenu.ProcStoredValueChanged<bool>();

            miscMenu.AddMItem("Also W out of combo", true, (sender, args) => _comboProvider.GetSkill<GarenW>().UseAlways = args.GetNewValue<bool>());
            miscMenu.AddMItem("Min incomming DPS for W in health %", new Slider(2, 1, 15), (sender, args) => _comboProvider.GetSkill<GarenW>().MinDamagePercent = args.GetNewValue<Slider>().Value).ProcStoredValueChanged<Slider>();
            miscMenu.AddMItem("Always W enemy ults", true, (sender, args) => _comboProvider.GetSkill<GarenW>().UseOnUltimates = args.GetNewValue<bool>());
            miscMenu.ProcStoredValueChanged<bool>();

            gapcloserMenu.AddMItem("(Using W if enabled)");

            laneClearMenu.AddMItem("E min. minions", new Slider(1, 1, 8), (sender, args) => _comboProvider.GetSkill<GarenE>().MinFarmMinions = args.GetNewValue<Slider>().Value).ProcStoredValueChanged<Slider>();
            laneClearMenu.AddMItem("Use Hydra", true, (sender, args) => _comboProvider.GetSkill<GarenE>().UseHydra = args.GetNewValue<bool>()).ProcStoredValueChanged<bool>();

            drawingMenu.AddMItem("Damage Indicator", new Circle(true, Color.FromArgb(100, Color.Goldenrod)), (sender, args) =>
            {
                DamageIndicator.DamageToUnit = _comboProvider.GetComboDamage;
                DamageIndicator.Enabled = args.GetNewValue<Circle>().Active;
                DamageIndicator.FillColor = args.GetNewValue<Circle>().Color;
                DamageIndicator.Fill = true;
                DamageIndicator.Color = Color.FromArgb(255, DamageIndicator.FillColor);
            });
            drawingMenu.AddMItem("R Range", new Circle(true, Color.Goldenrod), (sender, args) => _drawR = args.GetNewValue<Circle>());
            drawingMenu.AddMItem("Draw possible flash-ult", new Circle(true, Color.Red), (sender, args) => _drawFlashUlt = args.GetNewValue<Circle>());
            drawingMenu.AddMItem("Damage Indicator by xSalice!");
            drawingMenu.ProcStoredValueChanged<Circle>();

            mainMenu.AddMItem("Max order: R > E > Q > W! Have fun!");
            mainMenu.AddToMainMenu();
            _comboProvider.Initialize();

            Game.OnUpdate += Tick;
            Drawing.OnDraw += Draw;
        }
开发者ID:werdbrian,项目名称:LeagueSharp-6,代码行数:62,代码来源:Garen.cs

示例5: Load

        public void Load()
        {
            if (ObjectManager.Player.ChampionName != "Garen")
                return;
            Notifications.AddNotification("The Garen v2 loaded!", 3);

            var mainMenu = new Menu("The Garen", "The Garen", true);
            var orbwalkerMenu = mainMenu.CreateSubmenu("Orbwalker");
            var targetSelectorMenu = mainMenu.CreateSubmenu("Target Selector");
            var comboMenu = mainMenu.CreateSubmenu("Combo");
            var laneClearMenu = mainMenu.CreateSubmenu("Lane Clear");
            var miscMenu = mainMenu.CreateSubmenu("Misc");
            var items = mainMenu.CreateSubmenu("Items");
            var gapcloserMenu = mainMenu.CreateSubmenu("Gapcloser");
            var interrupterMenu = mainMenu.CreateSubmenu("Interrupter");
            var autoLevel = mainMenu.CreateSubmenu("Auto-level Spells");
            var drawingMenu = mainMenu.CreateSubmenu("Drawing");

            var orbwalker = new Orbwalking.Orbwalker(orbwalkerMenu);

            _comboProvider = new ComboProvider(500, new Skill[] { new GarenQ((SpellSlot.Q)), new GarenW((SpellSlot.W)), new GarenE((SpellSlot.E)), new GarenR((SpellSlot.R)) }.ToList(), orbwalker);
            _r = _comboProvider.GetSkill<GarenR>();
            _flash = ObjectManager.Player.Spellbook.Spells.FirstOrDefault(spell => spell.Name == "summonerflash");
            _comboProvider.CreateBasicMenu(targetSelectorMenu, comboMenu, null, null, null, gapcloserMenu, interrupterMenu, null, false);
            _comboProvider.CreateLaneclearMenu(laneClearMenu, false, SpellSlot.W);
            _comboProvider.GetSkill<GarenE>().ItemManager = _comboProvider.CreateItemsMenu(items, new RavenousHydra(), new BilgewaterCutlass(), new YoumusBlade(), new Botrk());
            _comboProvider.CreateAutoLevelMenu(autoLevel, ComboProvider.SpellOrder.REQW, ComboProvider.SpellOrder.REQW);

            comboMenu.AddMItem("Q after Auto Attack", true, (sender, args) => _comboProvider.GetSkill<GarenQ>().OnlyAfterAuto = args.GetNewValue<bool>());
            comboMenu.AddMItem("E after Auto Attack", true, (sender, args) => _comboProvider.GetSkill<GarenE>().OnlyAfterAuto = args.GetNewValue<bool>());
            comboMenu.AddMItem("Use R to KS", false, (sender, args) => _comboProvider.GetSkill<GarenR>().Killsteal = args.GetNewValue<bool>());
            comboMenu.AddMItem("Q to Get in Range", true, (sender, args) => _comboProvider.GetSkill<GarenQ>().UseWhenOutOfRange = args.GetNewValue<bool>());

            miscMenu.AddMItem("Use W Out of Combo", true, (sender, args) => _comboProvider.GetSkill<GarenW>().UseAlways = args.GetNewValue<bool>());
            miscMenu.AddMItem("Min. Incoming Damage for W in %HP", new Slider(2, 1, 15), (sender, args) => _comboProvider.GetSkill<GarenW>().MinDamagePercent = args.GetNewValue<Slider>().Value);
            miscMenu.AddMItem("Always W Enemy Ults", true, (sender, args) => _comboProvider.GetSkill<GarenW>().UseOnUltimates = args.GetNewValue<bool>());

            gapcloserMenu.AddMItem("(Use W if Enabled)");

            laneClearMenu.AddMItem("E if X Minions", new Slider(1, 1, 8), (sender, args) => _comboProvider.GetSkill<GarenE>().MinFarmMinions = args.GetNewValue<Slider>().Value);
            laneClearMenu.AddMItem("Use Hydra", true, (sender, args) => _comboProvider.GetSkill<GarenE>().UseHydra = args.GetNewValue<bool>());

            drawingMenu.AddMItem("Damage Indicator", new Circle(true, Color.FromArgb(100, Color.Goldenrod)), (sender, args) =>
            {
                DamageIndicator.DamageToUnit = _comboProvider.GetComboDamage;
                DamageIndicator.Enabled = args.GetNewValue<Circle>().Active;
                DamageIndicator.FillColor = args.GetNewValue<Circle>().Color;
                DamageIndicator.Fill = true;
                DamageIndicator.Color = Color.FromArgb(255, DamageIndicator.FillColor);
            });
            drawingMenu.AddMItem("Draw R Range", new Circle(true, Color.Goldenrod), (sender, args) => _drawR = args.GetNewValue<Circle>());
            drawingMenu.AddMItem("Draw Flash-R Indicator", new Circle(true, Color.Red), (sender, args) => _drawFlashUlt = args.GetNewValue<Circle>());
            drawingMenu.AddMItem("Damage Indicator by xSalice / detuks!");

            //mainMenu.AddMItem("Max order: R > E > Q > W! Have fun!");
            mainMenu.AddToMainMenu();
            _comboProvider.Initialize();
            //DevAssistant.Init();
            Game.OnUpdate += Tick;
            Drawing.OnDraw += Draw;
        }
开发者ID:jayblah,项目名称:TheNinow,代码行数:61,代码来源:Garen.cs


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