public AutoBottleMenu(Menu mainMenu) { var menu = new Menu("Bottle", "bottle"); var enabled = new MenuItem("autoBottleEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use bottle at base"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var autoSelfBottle = new MenuItem("autoBottleSelf", "Self bottle").SetValue(true); autoSelfBottle.SetTooltip("Auto bottle usage on self while at base"); menu.AddItem(autoSelfBottle); autoSelfBottle.ValueChanged += (sender, args) => AutoSelfBottle = args.GetNewValue <bool>(); AutoSelfBottle = autoSelfBottle.IsActive(); var autoAllyBottle = new MenuItem("autoBottleAlly", "Ally bottle").SetValue(true); autoAllyBottle.SetTooltip("Auto bottle usage on allies while at base"); menu.AddItem(autoAllyBottle); autoAllyBottle.ValueChanged += (sender, args) => AutoAllyBottle = args.GetNewValue <bool>(); AutoAllyBottle = autoAllyBottle.IsActive(); mainMenu.AddSubMenu(menu); }
public PhaseBootsMenu(Menu mainMenu) { var menu = new Menu("Phase boots", "phaseBootsMenu"); var enabled = new MenuItem("phaseBootsEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use phase boots"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var damageThreshold = new MenuItem("phaseBootsDistance", "Distance check").SetValue(new Slider(700, 0, 2000)); damageThreshold.SetTooltip("Use phase boots only when move distance is bigger"); menu.AddItem(damageThreshold); damageThreshold.ValueChanged += (sender, args) => Distance = args.GetNewValue <Slider>().Value; Distance = damageThreshold.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public MidasMenu(Menu mainMenu) { var menu = new Menu("Midas", "midasMenu"); var enabled = new MenuItem("midasEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use hand of midas"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var healthThresholdPct = new MenuItem("midasHealthPct", "HP% threshold").SetValue(new Slider(70, 0, 100)); healthThresholdPct.SetTooltip("Use hand of midas only when creep has more hp%"); menu.AddItem(healthThresholdPct); healthThresholdPct.ValueChanged += (sender, args) => HealthThresholdPct = args.GetNewValue <Slider>().Value; HealthThresholdPct = healthThresholdPct.GetValue <Slider>().Value; var experienceThreshold = new MenuItem("midasExpPct", "Experience threshold").SetValue(new Slider(90, 0, 150)); experienceThreshold.SetTooltip("Use hand of midas only when creep will grant more exp (base)"); menu.AddItem(experienceThreshold); experienceThreshold.ValueChanged += (sender, args) => ExperienceThreshold = args.GetNewValue <Slider>().Value; ExperienceThreshold = experienceThreshold.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public IronTalonMenu(Menu mainMenu) { var menu = new Menu("Iron talon", "ironTalonMenu"); var enabled = new MenuItem("ironTalonEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use iron talon on creeps"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var damageThreshold = new MenuItem("ironTalonDamageThreshold", "Damage threshold").SetValue(new Slider(300, 100, 600)); damageThreshold.SetTooltip("Use iron talon only when it will deal more damage"); menu.AddItem(damageThreshold); damageThreshold.ValueChanged += (sender, args) => DamageThreshold = args.GetNewValue <Slider>().Value; DamageThreshold = damageThreshold.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public PowerTreadsMenu(Menu mainMenu) { var menu = new Menu("Power treads", "ptSwitcherMenu"); var enabled = new MenuItem("ptSwitcherEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto switch power treads when using abilities"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var universal = new MenuItem("ptUniversalUse", "Universal use").SetValue(true); universal.SetTooltip( "If enabled power treads will work with all other assemblies otherwise only when player used ability"); menu.AddItem(universal); universal.ValueChanged += (sender, args) => UniversalUseEnabled = args.GetNewValue <bool>(); UniversalUseEnabled = universal.IsActive(); var switchOnMove = new MenuItem("ptSwitchOnMove", "Switch on move").SetValue( new StringList("None", "Hero attribute", "Strength", "Agility", "Intelligence")); menu.AddItem(switchOnMove); switchOnMove.ValueChanged += (sender, args) => SwitchOnMoveAttribute = args.GetNewValue <StringList>().SelectedIndex; SwitchOnMoveAttribute = switchOnMove.GetValue <StringList>().SelectedIndex; var switchOnAttack = new MenuItem("ptSwitchOnAttack", "Switch on attack").SetValue( new StringList("None", "Hero attribute", "Strength", "Agility", "Intelligence")); menu.AddItem(switchOnAttack); switchOnAttack.ValueChanged += (sender, args) => SwitchOnAttackAttribute = args.GetNewValue <StringList>().SelectedIndex; SwitchOnAttackAttribute = switchOnAttack.GetValue <StringList>().SelectedIndex; var switchOnHeal = new MenuItem("ptSwitchOnHeal", "Switch when healing").SetValue(true); switchOnHeal.SetTooltip("AutoBottleMenu, flask, shrine"); menu.AddItem(switchOnHeal); switchOnHeal.ValueChanged += (sender, args) => SwitchOnHeal = args.GetNewValue <bool>(); SwitchOnHeal = switchOnHeal.IsActive(); var mpAbilityThreshold = new MenuItem("ptMpAbilityThreshold", "MP ability threshold").SetValue(new Slider(25)); mpAbilityThreshold.SetTooltip("Use soul ring when ability costs more mp"); menu.AddItem(mpAbilityThreshold); mpAbilityThreshold.ValueChanged += (sender, args) => MpAbilityThreshold = args.GetNewValue <Slider>().Value; MpAbilityThreshold = mpAbilityThreshold.GetValue <Slider>().Value; menu.AddItem( new MenuItem("ptAbilities", "Enabled:").SetValue( abilityToggler = new AbilityToggler(new Dictionary <string, bool>()))); mainMenu.AddSubMenu(menu); }
public SoulRingMenu(Menu mainMenu) { var menu = new Menu("Soul ring", "soulRing"); var enabled = new MenuItem("autoSoulRing", "Enabled").SetValue(true); enabled.SetTooltip("Auto soul ring when using abilities"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue<bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var universal = new MenuItem("srUniversalUse", "Universal use").SetValue(true); universal.SetTooltip("If enabled soul ring will work with all other assemblies otherwise only when player used ability"); menu.AddItem(universal); universal.ValueChanged += (sender, args) => UniversalUseEnabled = args.GetNewValue<bool>(); UniversalUseEnabled = universal.IsActive(); var invis = new MenuItem("srUseWhenInvis", "Use when invisible").SetValue(false); invis.SetTooltip("Use soul ring if your hero is invisible"); menu.AddItem(invis); invis.ValueChanged += (sender, args) => UseWhenInvisible = args.GetNewValue<bool>(); UseWhenInvisible = invis.IsActive(); var hpThreshold = new MenuItem("soulRingHpThreshold", "HP% threshold").SetValue(new Slider(70)); hpThreshold.SetTooltip("Use soul ring if you have more hp%"); menu.AddItem(hpThreshold); hpThreshold.ValueChanged += (sender, args) => HpThreshold = args.GetNewValue<Slider>().Value; HpThreshold = hpThreshold.GetValue<Slider>().Value; var mpThreshold = new MenuItem("soulRingMpThreshold", "MP% threshold").SetValue(new Slider(100)); mpThreshold.SetTooltip("Use soul ring if you have less mp%"); menu.AddItem(mpThreshold); mpThreshold.ValueChanged += (sender, args) => MpThreshold = args.GetNewValue<Slider>().Value; MpThreshold = mpThreshold.GetValue<Slider>().Value; var mpAbilityThreshold = new MenuItem("srMpAbilityThreshold", "MP ability threshold").SetValue(new Slider(25)); mpAbilityThreshold.SetTooltip("Use soul ring when ability costs more mp"); menu.AddItem(mpAbilityThreshold); mpAbilityThreshold.ValueChanged += (sender, args) => MpAbilityThreshold = args.GetNewValue<Slider>().Value; MpAbilityThreshold = mpAbilityThreshold.GetValue<Slider>().Value; menu.AddItem( new MenuItem("soulRingAbilities", "Enabled:").SetValue( abilityToggler = new AbilityToggler(new Dictionary<string, bool>()))); mainMenu.AddSubMenu(menu); } IsEnabled = enabled.IsActive();
public GoldSpenderMenu(Menu mainMenu) { var menu = new Menu("Gold spender", "goldSpender"); var enabled = new MenuItem("spendGold", "Enabled").SetValue(true); enabled.SetTooltip("Buy items when you are about to die"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var hpThreshold = new MenuItem("goldSpenderHpThreshold", "HP threshold").SetValue(new Slider(150, 1, 500)); hpThreshold.SetTooltip("Buy items if you have less HP"); menu.AddItem(hpThreshold); hpThreshold.ValueChanged += (sender, args) => HpThreshold = args.GetNewValue <Slider>().Value; HpThreshold = hpThreshold.GetValue <Slider>().Value; var hpThresholdPct = new MenuItem("goldSpenderHpThresholdPct", "HP% threshold").SetValue(new Slider(20, 1, 40)); hpThresholdPct.SetTooltip("Buy items if you have less HP%"); menu.AddItem(hpThresholdPct); hpThresholdPct.ValueChanged += (sender, args) => HpThresholdPct = args.GetNewValue <Slider>().Value; HpThresholdPct = hpThresholdPct.GetValue <Slider>().Value; var enemyDistance = new MenuItem("goldSpenderEnemyDistance", "Enemy distance").SetValue(new Slider(600, 0, 2000)); enemyDistance.SetTooltip("Check enemy in range before buying"); menu.AddItem(enemyDistance); enemyDistance.ValueChanged += (sender, args) => EnemyDistance = args.GetNewValue <Slider>().Value; EnemyDistance = enemyDistance.GetValue <Slider>().Value; menu.AddItem( new MenuItem("goldSpenderItemsToggler", "Items:").SetValue( abilityToggler = new AbilityToggler(ItemsToBuy.ToDictionary(x => x.Key, x => true)))); menu.AddItem( new MenuItem("goldSpenderItemsPriority", "Order:").SetValue( priorityChanger = new PriorityChanger(ItemsToBuy.Select(x => x.Key).ToList()))); var buyback = new MenuItem("goldSpenderBuyback", "Save for buyback after (mins)").SetValue(new Slider(30, 0, 60)); menu.AddItem(buyback); buyback.ValueChanged += (sender, args) => SaveForBuyback = args.GetNewValue <Slider>().Value; SaveForBuyback = buyback.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public RecoveryMenu(Menu mainMenu) { var menu = new Menu("Recovery abuse", "recoveryAbuse"); var enabled = new MenuItem("abuseEnabled", "Enabled").SetValue(true); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var key = new MenuItem("recoveryKey", "Hotkey").SetValue(new KeyBind('-', KeyBindType.Press)); menu.AddItem(key); key.ValueChanged += (sender, args) => { if (skipNextEvent) { skipNextEvent = false; return; } IsActive = args.GetNewValue <KeyBind>().Active; OnAbuseChange?.Invoke(null, new BoolEventArgs(IsActive)); }; menu.AddItem( new MenuItem("recoveryItemsToggler", "Enabled:").SetValue( abilityToggler = new AbilityToggler(ItemsToUse.ToDictionary(x => x.ToString(), x => true)))); menu.AddItem( new MenuItem("recoveryItemsPriority", "Order:").SetValue( priorityChanger = new PriorityChanger(ItemsToUse.Select(x => x.ToString()).ToList()))); var toBackpack = new MenuItem("recoveryToBackpack", "Move items to backpack").SetValue(false); toBackpack.SetTooltip("Move items to backpack to \"disable\" them instead of dropping on the ground"); menu.AddItem(toBackpack); toBackpack.ValueChanged += (sender, args) => ItemsToBackpack = args.GetNewValue <bool>(); ItemsToBackpack = toBackpack.IsActive(); ItemSettingsMenu = new SettingsMenu(menu); mainMenu.AddSubMenu(menu); }
public BlinkMenu(Menu mainMenu) { var menu = new Menu("Blink dagger", "blinkAdjustment"); var enabled = new MenuItem("blinkAdjustment", "Maximize blink range").SetValue(true); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); mainMenu.AddSubMenu(menu); }
public DustMenu(Menu mainMenu) { var menu = new Menu("Dust", "dustMenu"); var enabled = new MenuItem("dustEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use dust of appearance"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); mainMenu.AddSubMenu(menu); }
public DewardingMenu(Menu mainMenu) { var menu = new Menu("Dewarding", "dewardMenu"); var enabled = new MenuItem("dewardEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use quelling blade, tangos, iron talon etc. enemy on wards"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var tangoHpThreshold = new MenuItem("dewardTangoHp", "Tango HP threshold").SetValue(new Slider(150, 0, 250)); tangoHpThreshold.SetTooltip("Use tango only if you are missing more hp"); menu.AddItem(tangoHpThreshold); tangoHpThreshold.ValueChanged += (sender, args) => TangoHpThreshold = args.GetNewValue <Slider>().Value; TangoHpThreshold = tangoHpThreshold.GetValue <Slider>().Value; var updateRate = new MenuItem("dewardUpdateRate", "Update rate").SetValue(new Slider(200, 1, 500)); updateRate.SetTooltip("Lower value => faster reaction, but requires more resources"); menu.AddItem(updateRate); updateRate.ValueChanged += (sender, args) => { UpdateRate = args.GetNewValue <Slider>().Value; OnUpdateRateChange?.Invoke(null, new IntEventArgs(UpdateRate)); }; UpdateRate = updateRate.GetValue <Slider>().Value; menu.AddItem( new MenuItem("dewardItemsToggler", "Items:").SetValue( abilityToggler = new AbilityToggler(ItemsToUse.ToDictionary(x => x.ToString(), x => true)))); menu.AddItem( new MenuItem("dewardPriority", "Order:").SetValue( priorityChanger = new PriorityChanger(ItemsToUse.Select(x => x.ToString()).ToList()))); mainMenu.AddSubMenu(menu); }
public TechiesMinesDestroyerMenu(Menu mainMenu) { var menu = new Menu("Mines destroyer", "minesDestroyer"); var enabled = new MenuItem("destroyerMines", "Enabled").SetValue(true); enabled.SetTooltip("Auto use quelling blade, iron talon and battle fury on remote/stasis mines"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var attackMines = new MenuItem("attackMines", "Attack techies mines").SetValue(true); attackMines.SetTooltip( "Auto attack techies mines when they can be killed with 1 hit and no other mines around"); menu.AddItem(attackMines); attackMines.ValueChanged += (sender, args) => AttackMines = args.GetNewValue <bool>(); AttackMines = attackMines.IsActive(); var attackMinesInvisible = new MenuItem("attackMinesInvis", "Attack when invisible").SetValue(true); attackMinesInvisible.SetTooltip("Attack techies mines when your hero is invisible"); menu.AddItem(attackMinesInvisible); attackMinesInvisible.ValueChanged += (sender, args) => AttackMinesInvisible = args.GetNewValue <bool>(); AttackMinesInvisible = attackMinesInvisible.IsActive(); var updateRate = new MenuItem("techiesMinesUpdateRate", "Update rate").SetValue(new Slider(200, 1, 500)); updateRate.SetTooltip("Lower value => faster reaction, but requires more resources"); menu.AddItem(updateRate); updateRate.ValueChanged += (sender, args) => { UpdateRate = args.GetNewValue <Slider>().Value; OnUpdateRateChange?.Invoke(null, new IntEventArgs(UpdateRate)); }; UpdateRate = updateRate.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public InstantHealthRestoreItemMenu(Menu mainMenu, string name, bool defaultEnabled = true) { var simpleName = name.ToLower().Replace(" ", string.Empty); var menu = new Menu(name, simpleName + "Menu"); var enabled = new MenuItem(simpleName + "Enabled", "Enabled").SetValue(defaultEnabled); enabled.SetTooltip("Auto use item on low health"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var hpThreshold = new MenuItem(simpleName + "Hp", "HP threshold").SetValue(new Slider(150, 50, 500)); hpThreshold.SetTooltip("Use item if you have less HP"); menu.AddItem(hpThreshold); hpThreshold.ValueChanged += (sender, args) => HealthThreshold = args.GetNewValue <Slider>().Value; HealthThreshold = hpThreshold.GetValue <Slider>().Value; var hpThresholdPct = new MenuItem(simpleName + "HpPct", "HP% threshold").SetValue(new Slider(20, 1, 50)); hpThresholdPct.SetTooltip("Use item if you have less HP%"); menu.AddItem(hpThresholdPct); hpThresholdPct.ValueChanged += (sender, args) => HealthThresholdPct = args.GetNewValue <Slider>().Value; HealthThresholdPct = hpThresholdPct.GetValue <Slider>().Value; var enemyCheckRange = new MenuItem(simpleName + "EnemyRange", "Enemy search range").SetValue(new Slider(800, 0, 2000)); enemyCheckRange.SetTooltip( "Use item only if there is enemy hero in range (if set to 0 range won't be checked)"); menu.AddItem(enemyCheckRange); enemyCheckRange.ValueChanged += (sender, args) => EnemySearchRange = args.GetNewValue <Slider>().Value; EnemySearchRange = enemyCheckRange.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public AutoArcaneBootsMenu(Menu mainMenu) { var menu = new Menu("Arcane boots", "autoArcaneBoots"); var enabled = new MenuItem("autoUseArcaneBoots", "Enabled").SetValue(true); enabled.SetTooltip("Auto use arcane boots when you are missing mp"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var allyRange = new MenuItem("autoBootsAllyRange", "Ally search range").SetValue(new Slider(2000, 0, 5000)); allyRange.SetTooltip("Don't use if ally with low mp in range"); menu.AddItem(allyRange); allyRange.ValueChanged += (sender, args) => AllySearchRange = args.GetNewValue <Slider>().Value; AllySearchRange = allyRange.GetValue <Slider>().Value; var fountainRange = new MenuItem("autoBootsFountainRange", "Fountain range").SetValue(new Slider(4000, 2000, 8000)); fountainRange.SetTooltip("Don't use if fountain is closer (2k - fountain; 4k - base; 8k - t2)"); menu.AddItem(fountainRange); fountainRange.ValueChanged += (sender, args) => FountainRange = args.GetNewValue <Slider>().Value; FountainRange = fountainRange.GetValue <Slider>().Value; var notifyAllies = new MenuItem("autoArcaneNotify", "Notify allies").SetValue(true); notifyAllies.SetTooltip("Notify allies if they are out of arcane boots cast range"); menu.AddItem(notifyAllies); notifyAllies.ValueChanged += (sender, args) => NotifyAllies = args.GetNewValue <bool>(); NotifyAllies = notifyAllies.IsActive(); mainMenu.AddSubMenu(menu); }
public AutoTangoMenu(Menu mainMenu) { var menu = new Menu("Tango", "tangoMenu"); var enabled = new MenuItem("tangoEnabled", "Enabled").SetValue(true); enabled.SetTooltip("Auto use tango on happy little tree"); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var missingHp = new MenuItem("tangoMissingHp", "Health threshold").SetValue(new Slider(150, 50, 250)); missingHp.SetTooltip("Use tango only when missing more hp"); menu.AddItem(missingHp); missingHp.ValueChanged += (sender, args) => HealthThreshold = args.GetNewValue <Slider>().Value; HealthThreshold = missingHp.GetValue <Slider>().Value; mainMenu.AddSubMenu(menu); }
public SnatcherMenu(Menu mainMenu) { var menu = new Menu("Snatcher", "snatcher"); var notificationMenu = new Menu("Notification", "snatcherNotification"); var notificationEnabled = new MenuItem("snatcherNotificationEnabled", "Enabled").SetValue(false); notificationEnabled.SetTooltip("Show notification when snatched is enabled"); notificationMenu.AddItem(notificationEnabled); notificationEnabled.ValueChanged += (sender, args) => { IsNotificationEnabled = args.GetNewValue <bool>(); OnNotificationEnabledChange?.Invoke(null, new BoolEventArgs(IsNotificationEnabled)); }; IsNotificationEnabled = notificationEnabled.IsActive(); var notificationHoldKey = new MenuItem("snatcherNotificationHoldKey", "Enabled for hold key").SetValue(false); notificationMenu.AddItem(notificationHoldKey); notificationHoldKey.ValueChanged += (sender, args) => { NotificationHold = args.GetNewValue <bool>(); }; NotificationHold = notificationHoldKey.IsActive(); var notificationToggleKey = new MenuItem("snatcherNotificationToggleKey", "Enabled for toggle key").SetValue(true); notificationMenu.AddItem(notificationToggleKey); notificationToggleKey.ValueChanged += (sender, args) => { NotificationToggle = args.GetNewValue <bool>(); }; NotificationToggle = notificationToggleKey.IsActive(); var notificationSize = new MenuItem("snatcherNotificationSize", "Size").SetValue(new Slider(22, 15, 30)); notificationMenu.AddItem(notificationSize); notificationSize.ValueChanged += (sender, args) => { NotificationSize = args.GetNewValue <Slider>().Value; }; NotificationSize = notificationSize.GetValue <Slider>().Value; var notificationX = new MenuItem("snatcherNotificationX", "Coordinates X").SetValue( new Slider(15, 0, (int)HUDInfo.ScreenSizeX())); notificationMenu.AddItem(notificationX); notificationX.ValueChanged += (sender, args) => { NotificationX = args.GetNewValue <Slider>().Value; }; NotificationX = notificationX.GetValue <Slider>().Value; var notificationY = new MenuItem("snatcherNotificationY", "Coordinates Y").SetValue( new Slider(50, 0, (int)HUDInfo.ScreenSizeY())); notificationMenu.AddItem(notificationY); notificationY.ValueChanged += (sender, args) => { NotificationY = args.GetNewValue <Slider>().Value; }; NotificationY = notificationY.GetValue <Slider>().Value; var enabled = new MenuItem("snatcherEnabled", "Enabled").SetValue(true); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var holdKey = new MenuItem("holdSnatchKey", "Hold key").SetValue(new KeyBind('O', KeyBindType.Press)); menu.AddItem(holdKey); holdKey.ValueChanged += (sender, args) => HoldKey = args.GetNewValue <KeyBind>().Active; HoldKey = holdKey.IsActive(); var holdItems = new MenuItem("enabledStealHold", "Hold steal:").SetValue( new AbilityToggler(items.ToDictionary(x => x.Key, x => true))); menu.AddItem(holdItems); holdItems.ValueChanged += (sender, args) => { SetEnabledItems(args.GetNewValue <AbilityToggler>().Dictionary, EnabledHoldItems); }; var toggleKey = new MenuItem("pressSnatchKey", "Toggle key").SetValue(new KeyBind('P', KeyBindType.Toggle)); menu.AddItem(toggleKey); toggleKey.ValueChanged += (sender, args) => ToggleKey = args.GetNewValue <KeyBind>().Active; ToggleKey = toggleKey.IsActive(); var toggleItems = new MenuItem("enabledStealToggle", "Toggle steal:").SetValue( new AbilityToggler(items.ToDictionary(x => x.Key, x => true))); menu.AddItem(toggleItems); toggleItems.ValueChanged += (sender, args) => SetEnabledItems( args.GetNewValue <AbilityToggler>().Dictionary, EnabledToggleItems); var otherUnits = new MenuItem("snatcherOtherUnits", "Use other units").SetValue(false) .SetTooltip("Like Spirit Bear, Meepo clones"); menu.AddItem(otherUnits); otherUnits.ValueChanged += (sender, args) => { UseOtherUnits = args.GetNewValue <bool>(); OnUseOtherUnitsChange?.Invoke(null, new BoolEventArgs(UseOtherUnits)); }; UseOtherUnits = otherUnits.IsActive(); var itemMoveCostThreshold = new MenuItem("snatcherMoveItemCost", "Move item cost threshold").SetValue(new Slider(1000, 0, 5000)); itemMoveCostThreshold.SetTooltip( "It will move item from inventory (when full) to backpack which costs less gold to pick up aegis/rapier/gem (disabled: 0)"); menu.AddItem(itemMoveCostThreshold); itemMoveCostThreshold.ValueChanged += (sender, args) => ItemMoveCostThreshold = args.GetNewValue <Slider>().Value; ItemMoveCostThreshold = itemMoveCostThreshold.GetValue <Slider>().Value; var updateRate = new MenuItem("snatcherUpdateRate", "Update rate").SetValue(new Slider(1, 1, 500)); updateRate.SetTooltip("Lower value => faster reaction, but requires more resources"); menu.AddItem(updateRate); updateRate.ValueChanged += (sender, args) => { UpdateRate = args.GetNewValue <Slider>().Value; OnUpdateRateChange?.Invoke(null, new IntEventArgs(UpdateRate)); }; UpdateRate = updateRate.GetValue <Slider>().Value; var debug = new MenuItem("snatcherDebug", "Debug info").SetValue(false); menu.AddItem(debug); debug.ValueChanged += (sender, args) => OnDebug?.Invoke(null, EventArgs.Empty); SetEnabledItems(holdItems.GetValue <AbilityToggler>().Dictionary, EnabledHoldItems); SetEnabledItems(toggleItems.GetValue <AbilityToggler>().Dictionary, EnabledToggleItems); menu.AddSubMenu(notificationMenu); mainMenu.AddSubMenu(menu); }
public LivingArmorMenu(Menu rootMenu) { var menu = new Menu("Living armor", "livingArmor"); var enabled = new MenuItem("livingArmorEnabled", "Enabled").SetValue(true); menu.AddItem(enabled); enabled.ValueChanged += (sender, args) => { IsEnabled = args.GetNewValue <bool>(); OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled)); }; IsEnabled = enabled.IsActive(); var notification = new MenuItem("livingArmorNotification", "Show notification").SetValue(true); notification.SetTooltip("Print message in chat on whom living armor was used (visible only to you)"); menu.AddItem(notification); notification.ValueChanged += (sender, args) => IsEnabledNotification = args.GetNewValue <bool>(); IsEnabledNotification = notification.IsActive(); var heroMenu = new Menu("Hero", "livingArmorHero"); var heroEnabled = new MenuItem("livingArmorHeroEnabled", "Enabled").SetValue(true); heroMenu.AddItem(heroEnabled); heroEnabled.ValueChanged += (sender, args) => IsEnabledHero = args.GetNewValue <bool>(); IsEnabledHero = heroEnabled.IsActive(); var ignoreSelf = new MenuItem("livingArmorSelfIgnore", "Ignore your hero").SetValue(false); ignoreSelf.SetTooltip("Don't auto use living armor on your hero"); heroMenu.AddItem(ignoreSelf); ignoreSelf.ValueChanged += (sender, args) => IgnoreSelf = args.GetNewValue <bool>(); IgnoreSelf = ignoreSelf.IsActive(); var heroHpThreshold = new MenuItem("livingArmorHeroHp", "Hero HP% threshold").SetValue(new Slider(70)); heroHpThreshold.SetTooltip("Use living armor if your ally has less hp%"); heroMenu.AddItem(heroHpThreshold); heroHpThreshold.ValueChanged += (sender, args) => HeroHpThreshold = args.GetNewValue <Slider>().Value; HeroHpThreshold = heroHpThreshold.GetValue <Slider>().Value; var enemyCheckRange = new MenuItem("livingArmorHeroEnemyRange", "Enemy search range").SetValue(new Slider(700, 0, 2000)); enemyCheckRange.SetTooltip("Use living armor only if there is enemy hero in range (if set to 0 range won't be checked)"); heroMenu.AddItem(enemyCheckRange); enemyCheckRange.ValueChanged += (sender, args) => HeroEnemySearchRange = args.GetNewValue <Slider>().Value; HeroEnemySearchRange = enemyCheckRange.GetValue <Slider>().Value; var towerMenu = new Menu("Tower", "livingArmorTower"); var towerEnabled = new MenuItem("livingArmorTowerEnabled", "Enabled").SetValue(true); towerMenu.AddItem(towerEnabled); towerEnabled.ValueChanged += (sender, args) => IsEnabledTower = args.GetNewValue <bool>(); IsEnabledTower = towerEnabled.IsActive(); var towerHpThreshold = new MenuItem("livingArmorTowerHp", "Tower HP% threshold").SetValue(new Slider(60)); towerHpThreshold.SetTooltip("Use living armor if ally tower has less hp%"); towerMenu.AddItem(towerHpThreshold); towerHpThreshold.ValueChanged += (sender, args) => TowerHpThreshold = args.GetNewValue <Slider>().Value; TowerHpThreshold = towerHpThreshold.GetValue <Slider>().Value; var raxMenu = new Menu("Barracks", "livingArmorBarracks"); var raxEnabled = new MenuItem("livingArmorBarracksEnabled", "Enabled").SetValue(true); raxMenu.AddItem(raxEnabled); raxEnabled.ValueChanged += (sender, args) => IsEnabledBarracks = args.GetNewValue <bool>(); IsEnabledBarracks = raxEnabled.IsActive(); var raxHpThreshold = new MenuItem("livingArmorBarracksHp", "Barracks HP% threshold").SetValue(new Slider(80)); raxHpThreshold.SetTooltip("Use living armor if ally barracks has less hp%"); raxMenu.AddItem(raxHpThreshold); raxHpThreshold.ValueChanged += (sender, args) => BarracksHpThreshold = args.GetNewValue <Slider>().Value; BarracksHpThreshold = raxHpThreshold.GetValue <Slider>().Value; var creepMenu = new Menu("Creep", "livingArmorCreep"); var creepEnabled = new MenuItem("livingArmorCreepEnabled", "Enabled").SetValue(false); creepMenu.AddItem(creepEnabled); creepEnabled.ValueChanged += (sender, args) => IsEnabledCreep = args.GetNewValue <bool>(); IsEnabledCreep = creepEnabled.IsActive(); var useOnCreepsUnderTower = new MenuItem("livingArmorCreepForce", "Force use under tower").SetValue(true); useOnCreepsUnderTower.SetTooltip("Always use living armor on creep which are attacked by tower"); creepMenu.AddItem(useOnCreepsUnderTower); useOnCreepsUnderTower.ValueChanged += (sender, args) => IsEnabledCreepUnderTower = args.GetNewValue <bool>(); IsEnabledCreepUnderTower = useOnCreepsUnderTower.IsActive(); var creepHpThreshold = new MenuItem("livingArmorCreepHp", "Creep HP% threshold").SetValue(new Slider(40)); creepHpThreshold.SetTooltip("Use living armor if ally creep has less hp%"); creepMenu.AddItem(creepHpThreshold); creepHpThreshold.ValueChanged += (sender, args) => CreepHpThreshold = args.GetNewValue <Slider>().Value; CreepHpThreshold = creepHpThreshold.GetValue <Slider>().Value; menu.AddSubMenu(heroMenu); menu.AddSubMenu(towerMenu); menu.AddSubMenu(raxMenu); menu.AddSubMenu(creepMenu); rootMenu.AddSubMenu(menu); }