예제 #1
0
        public static void AddToMenu(Menu menu, List <BuffType> buffTypes, HeroListManagerArgs args, bool randomize)
        {
            try
            {
                if (Menues.ContainsKey(args.UniqueId))
                {
                    throw new ArgumentException(
                              string.Format("BuffManager: UniqueID \"{0}\" already exist.", args.UniqueId));
                }

                args.Enemies = true;
                args.Allies  = false;

                menu.AddItem(
                    new MenuItem(menu.Name + ".buff-" + args.UniqueId + ".delay", "Delay").SetValue(
                        new Slider(100, 0, 500)));
                if (randomize)
                {
                    menu.AddItem(
                        new MenuItem(menu.Name + ".buff-" + args.UniqueId + ".randomize", "Randomize Position").SetValue
                            (new Slider(10)));
                }

                menu.AddItem(new MenuItem(menu.Name + ".buff-" + args.UniqueId + ".separator", string.Empty));

                HeroListManager.AddToMenu(menu, args);

                Menues[args.UniqueId] = new Tuple <Menu, List <BuffType>, bool>(menu, buffTypes, randomize);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
예제 #2
0
        public static void AddToMenu(Menu menu, HeroListManagerArgs args, bool dangerous = false)
        {
            try
            {
                if (Menues.ContainsKey(args.UniqueId))
                {
                    throw new ArgumentException(
                              string.Format("GapcloserManager: UniqueID \"{0}\" already exist.", args.UniqueId));
                }

                args.Enemies = true;
                args.Allies  = false;

                menu.AddItem(
                    new MenuItem(menu.Name + ".gap-" + args.UniqueId + ".delay", "Delay").SetValue(
                        new Slider(100, 0, 500)));
                menu.AddItem(
                    new MenuItem(menu.Name + ".gap-" + args.UniqueId + ".distance", "Min. Distance").SetValue(
                        new Slider(150, 0, 500)));
                menu.AddItem(
                    new MenuItem(menu.Name + ".gap-" + args.UniqueId + ".dangerous", "Only Dangerous").SetValue(
                        dangerous));

                menu.AddItem(new MenuItem(menu.Name + ".gap-" + args.UniqueId + ".separator", string.Empty));

                HeroListManager.AddToMenu(menu, args);

                Menues[args.UniqueId] = menu;
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
        public static void AddToMenu(Menu menu, HeroListManagerArgs args)
        {
            try
            {
                if (Menues.ContainsKey(args.UniqueId))
                {
                    throw new ArgumentException(
                              string.Format("HeroListManager: UniqueID \"{0}\" already exist.", args.UniqueId));
                }

                menu.Color = args.IsWhitelist ? WhitelistColor : BlacklistColor;

                foreach (var hero in GameObjects.Heroes.Where(h => args.Allies && h.IsAlly || args.Enemies && h.IsEnemy)
                         )
                {
                    var item =
                        new MenuItem(
                            menu.Name + ".hero-list-" + args.UniqueId + hero.ChampionName.ToLower(), hero.ChampionName)
                        .SetTag(args.MenuTag);
                    if (args.DontSave)
                    {
                        item.DontSave();
                    }
                    menu.AddItem(item.SetValue(args.DefaultValue));
                }

                if (args.EnabledButton)
                {
                    menu.AddItem(
                        new MenuItem(menu.Name + ".hero-list-" + args.UniqueId + ".enabled", "Enabled").SetTag(
                            args.MenuTag).SetValue(args.Enabled));
                }

                Menues[args.UniqueId] = new Tuple <Menu, HeroListManagerArgs>(menu, args);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
예제 #4
0
 public static void AddToMenu(Menu menu, BuffType buffType, HeroListManagerArgs args, bool randomize)
 {
     AddToMenu(menu, new List <BuffType> {
         buffType
     }, args, randomize);
 }