コード例 #1
0
ファイル: MenuManager.cs プロジェクト: tekintr/Elobuddy
        internal static void CreateMenu()
        {
            ExtensionsMenu = MainMenu.AddMenu("Marksman AIO : Extensions", "MarksmanAIO.Extensions");

            _cache = ExtensionsMenu.Add("MenuManager.ExtensionsMenu.EnableCache", new CheckBox("Onbellek aktif"));
            _cache.OnValueChange += (sender, args) =>
            {
                if (args.NewValue)
                {
                    StaticCacheProvider.Initialize();
                }
            };

            if (Misc.IsMe)
            {
                System.Threading.Tasks.Task.Factory.StartNew(LoadEvadeIc);

                _debug = ExtensionsMenu.Add("MenuManager.ExtensionsMenu.EnableDebug", new CheckBox("Hata ayiklama aktif", false));
            }

            foreach (var source in Assembly.GetAssembly(typeof(ExtensionBase)).GetTypes().Where(x => x.IsSubclassOf(typeof(ExtensionBase)) && x.IsSealed))
            {
                var property = source.GetProperty("EnabledByDefault");

                bool enabledByDefault;

                if (property == null)
                {
                    enabledByDefault = false;
                }
                else
                {
                    enabledByDefault = (bool)property.GetValue(source);
                }

                var menuItem = ExtensionsMenu.Add("MenuManager.ExtensionsMenu." + source.Name, new CheckBox("Yukle " + source.Name, enabledByDefault));

                if (menuItem.CurrentValue)
                {
                    if (Extensions.All(x => x.Name != source.Name))
                    {
                        var instance = System.Activator.CreateInstance(source);

                        Extensions.Add(instance as ExtensionBase);

                        source.GetMethod("Load").Invoke(instance, null);
                    }
                }

                menuItem.OnValueChange += (sender, args) =>
                {
                    if (args.NewValue)
                    {
                        if (Extensions.Any(x => x.Name == source.Name))
                        {
                            return;
                        }

                        var instance = System.Activator.CreateInstance(source);

                        if (instance == null)
                        {
                            return;
                        }

                        Extensions.Add(instance as ExtensionBase);

                        source.GetMethod("Load").Invoke(instance, null);
                    }
                    else if (Extensions.Any(x => x.Name == source.Name))
                    {
                        var extension = Extensions.FirstOrDefault(x => x.Name == source.Name);

                        if (extension == null)
                        {
                            return;
                        }

                        extension.Dispose();
                        Extensions.RemoveAll(x => x.Name == source.Name);
                    }
                };
            }

            CacheMenu = ExtensionsMenu.AddSubMenu("Cache settings", "MenuManager.ExtensionsMenu.CacheMenu");
            CacheMenu.Add("MenuManager.ExtensionsMenu.MinionCacheRefreshRate", new Slider("Minion önbellek yenileme hızı : {0} milisaniyeler", 200, 0, 1000));
            CacheMenu.AddLabel("\nÖnerilen değer : 100 - 200\nBu ayar, her bir minion tabanlı hesaplamalar arasındaki gecikmeyi ayarlar.");

            Menu = MainMenu.AddMenu("Marksman AIO", "MarksmanAIO");
            Menu.AddGroupLabel("Tekrar hosgeldin, Kardesim !");
            Menu.AddSeparator(5);
            Menu.AddLabel("Bu addon, sahip olmak isteyen herkes için kullanışlıdır.\nall Marksmans eklentileri tek bir addonda. Bu AIO da güzel çizimlerle birlikte gelir\nand Bir aktivatör.Sadece ben " +
                          "Umarım eğlenirsin. İyi şanslar !");
            Menu.AddSeparator(40);
            Menu.AddLabel("Marksman AIO şu anda beta safhasında.\nHerhangi bir hata yaşadıysanız, onları forum konusuna bildirin.");

            InitializeAddon.PluginInstance.CreateMenu();
        }
コード例 #2
0
        internal static void CreateMenu()
        {
            ExtensionsMenu = MainMenu.AddMenu("Marksman AIO : Extensions", "MarksmanAIO.Extensions");

            _cache = ExtensionsMenu.Add("MenuManager.ExtensionsMenu.EnableCache", new CheckBox("Enable Cache"));
            _cache.OnValueChange += (sender, args) =>
            {
                if (args.NewValue)
                {
                    StaticCacheProvider.Initialize();
                }
            };

            if (Misc.IsMe)
            {
                System.Threading.Tasks.Task.Factory.StartNew(LoadEvadeIc);

                _debug = ExtensionsMenu.Add("MenuManager.ExtensionsMenu.EnableDebug", new CheckBox("Enable Debug", false));
            }

            foreach (var source in Assembly.GetAssembly(typeof(ExtensionBase)).GetTypes().Where(x => x.IsSubclassOf(typeof(ExtensionBase)) && x.IsSealed))
            {
                var property = source.GetProperty("EnabledByDefault");

                bool enabledByDefault;

                if (property == null)
                {
                    enabledByDefault = false;
                }
                else
                {
                    enabledByDefault = (bool)property.GetValue(source);
                }

                var menuItem = ExtensionsMenu.Add("MenuManager.ExtensionsMenu." + source.Name, new CheckBox("Load " + source.Name, enabledByDefault));

                if (menuItem.CurrentValue)
                {
                    if (Extensions.All(x => x.Name != source.Name))
                    {
                        var instance = System.Activator.CreateInstance(source);

                        Extensions.Add(instance as ExtensionBase);

                        source.GetMethod("Load").Invoke(instance, null);
                    }
                }

                menuItem.OnValueChange += (sender, args) =>
                {
                    if (args.NewValue)
                    {
                        if (Extensions.Any(x => x.Name == source.Name))
                        {
                            return;
                        }

                        var instance = System.Activator.CreateInstance(source);

                        if (instance == null)
                        {
                            return;
                        }

                        Extensions.Add(instance as ExtensionBase);

                        source.GetMethod("Load").Invoke(instance, null);
                    }
                    else if (Extensions.Any(x => x.Name == source.Name))
                    {
                        var extension = Extensions.FirstOrDefault(x => x.Name == source.Name);

                        if (extension == null)
                        {
                            return;
                        }

                        extension.Dispose();
                        Extensions.RemoveAll(x => x.Name == source.Name);
                    }
                };
            }

            CacheMenu = ExtensionsMenu.AddSubMenu("Cache settings", "MenuManager.ExtensionsMenu.CacheMenu");
            CacheMenu.Add("MenuManager.ExtensionsMenu.MinionCacheRefreshRate", new Slider("Minion cache refresh rate : {0} milisecounds", 200, 0, 1000));
            CacheMenu.AddLabel("\nRecomended value : 100 - 200\nThis setting sets the delay between each minion based calculations.");

            Menu = MainMenu.AddMenu("Marksman AIO", "MarksmanAIO");
            Menu.AddGroupLabel("Welcome back, Buddy !");
            Menu.AddSeparator(5);
            Menu.AddLabel("This addon comes in handy for anyone who wants to have\nall marksmans plugins in just one addon. This AIO comes also with beautiful drawings\nand an activator. I just " +
                          "hope you will have fun. Good luck !");
            Menu.AddSeparator(40);
            Menu.AddLabel("Marksman AIO is currently in early beta phase.\nIf you experienced any bugs please report them in the forum thread.");

            InitializeAddon.PluginInstance.CreateMenu();
        }
コード例 #3
0
        internal static void CreateMenu()
        {
            ExtensionsMenu = MainMenu.AddMenu("Super-ADC合集:插件", "MarksmanAIO.Extensions");

            _cache = ExtensionsMenu.Add("MenuManager.ExtensionsMenu.EnableCache", new CheckBox("Enable Cache"));
            _cache.OnValueChange += (sender, args) =>
            {
                if (args.NewValue)
                {
                    StaticCacheProvider.Initialize();
                }
            };

            if (Misc.IsMe)
            {
                System.Threading.Tasks.Task.Factory.StartNew(LoadEvadeIc);

                _debug = ExtensionsMenu.Add("MenuManager.ExtensionsMenu.EnableDebug", new CheckBox("Enable Debug", false));
            }

            foreach (var source in Assembly.GetAssembly(typeof(ExtensionBase)).GetTypes().Where(x => x.IsSubclassOf(typeof(ExtensionBase)) && x.IsSealed))
            {
                var property = source.GetProperty("EnabledByDefault");

                bool enabledByDefault;

                if (property == null)
                {
                    enabledByDefault = false;
                }
                else
                {
                    enabledByDefault = (bool)property.GetValue(source);
                }

                var menuItem = ExtensionsMenu.Add("MenuManager.ExtensionsMenu." + source.Name, new CheckBox("Load " + source.Name, enabledByDefault));

                if (menuItem.CurrentValue)
                {
                    if (Extensions.All(x => x.Name != source.Name))
                    {
                        var instance = System.Activator.CreateInstance(source);

                        Extensions.Add(instance as ExtensionBase);

                        source.GetMethod("Load").Invoke(instance, null);
                    }
                }

                menuItem.OnValueChange += (sender, args) =>
                {
                    if (args.NewValue)
                    {
                        if (Extensions.Any(x => x.Name == source.Name))
                        {
                            return;
                        }

                        var instance = System.Activator.CreateInstance(source);

                        if (instance == null)
                        {
                            return;
                        }

                        Extensions.Add(instance as ExtensionBase);

                        source.GetMethod("Load").Invoke(instance, null);
                    }
                    else if (Extensions.Any(x => x.Name == source.Name))
                    {
                        var extension = Extensions.FirstOrDefault(x => x.Name == source.Name);

                        if (extension == null)
                        {
                            return;
                        }

                        extension.Dispose();
                        Extensions.RemoveAll(x => x.Name == source.Name);
                    }
                };
            }

            CacheMenu = ExtensionsMenu.AddSubMenu("延迟设置", "MenuManager.ExtensionsMenu.CacheMenu");
            CacheMenu.Add("MenuManager.ExtensionsMenu.MinionCacheRefreshRate", new Slider("小兵信息刷新率:{0} 毫秒", 200, 0, 1000));
            CacheMenu.AddLabel("\n推荐值:100 - 200 之间");

            Menu = MainMenu.AddMenu("Super-ADC合集:英雄", "MarksmanAIO");
            Menu.AddGroupLabel("欢迎使用 Super - ADC合集");
            Menu.AddSeparator(5);
            Menu.AddLabel("Super 用户专用ADC合集!此脚本包含活化剂和英雄脚本!\n 支持英雄:艾希 女警 飞机 德莱文 Ez 男枪 烬 金克斯 滑板鞋 大嘴 奥巴马 赏金 奎因 轮子妈 小炮 老鼠 \n螃蟹 韦鲁斯 薇恩");
            Menu.AddSeparator(40);
            Menu.AddLabel("ADC合集目前处于测试阶段!会不断更新完善!敬请期待!");

            InitializeAddon.PluginInstance.CreateMenu();
        }