本文整理汇总了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());
// }
//};
}
示例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>();
}
}
示例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);
}
示例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]+" / ");
}
};
}
示例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>());
}
示例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>();
}
示例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));
}
示例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);
}
};
}
示例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>());
}
示例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);
}
};
}
示例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);
}
示例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;
}
示例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>();
}
示例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);
}
示例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>();
}