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()); // } //}; }
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>()); }