示例#1
0
        internal void AddMenu(MenuNames menuname)
        {
            var menu    = MainMenu.GetMenu("cm_" + ObjectManager.Player.ChampionName.ToLower());
            var newmenu = menu.AddSubMenu(menuname.ToString().Replace("_", " "), "cm_" + menuname.ToString().ToLower(), "CarryMe " + ObjectManager.Player.ChampionName + " - " + menuname);

            MenuDictionary.Add(menuname.ToString(), newmenu);
        }
示例#2
0
 internal void AddLabel(MenuNames menuname, string label, bool header = false)
 {
     MenuDictionary[menuname.ToString()].Add("sep_" + SeperatorCount, new Separator(header ? 10 : 5));
     ++SeperatorCount;
     if (header)
     {
         MenuDictionary[menuname.ToString()].AddGroupLabel(label);
     }
     else
     {
         MenuDictionary[menuname.ToString()].AddLabel(label);
     }
     MenuDictionary[menuname.ToString()].Add("sep_" + SeperatorCount, new Separator(header ? 10 : 5));
     ++SeperatorCount;
 }
示例#3
0
 public DelegateCheckedMenuItem(string text, MenuNames name, Func <bool> initDelegate, Action <bool> changedDelegate)
     : base(text)
 {
     base.Name        = name.ToString();
     _initDelegate    = initDelegate;
     _changedDelegate = changedDelegate;
 }
示例#4
0
        public static ToolStripMenuItem Add(this ToolStripItemCollection menuItems, string text, MenuNames nameConstant)
        {
            ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem(text);

            toolStripMenuItem.Name = nameConstant.ToString();
            menuItems.Add(toolStripMenuItem);
            return(toolStripMenuItem);
        }
示例#5
0
        internal void AddRadioBox(MenuNames menuname, bool oneMustStayAktive, RadioBox Box1, RadioBox Box2)
        {
            var checkbox1 = MenuDictionary[menuname.ToString()].Add(Box1.Identifier, new CheckBox(Box1.Name, Box1.DefaultValue));
            var checkbox2 = MenuDictionary[menuname.ToString()].Add(Box2.Identifier, new CheckBox(Box2.Name, Box2.DefaultValue));

            RandioboxDictionary.Add(Box1.Name, checkbox2);
            RandioboxDictionary.Add(Box2.Name, checkbox1);

            if (oneMustStayAktive)
            {
                checkbox1.OnValueChange += CheckBoxChanged_OneStayActive;
                checkbox2.OnValueChange += CheckBoxChanged_OneStayActive;
            }
            else
            {
                checkbox1.OnValueChange += CheckBoxChanged_JustDisable;
                checkbox2.OnValueChange += CheckBoxChanged_JustDisable;
            }
        }
示例#6
0
        public DelegateMenuItem(string text, MenuNames name, Action click)
            : base(text)
        {
            EventHandler value = delegate
            {
                click();
            };

            base.Click += value;
            base.Name   = name.ToString();
        }
示例#7
0
 internal bool IsChecked(MenuNames menuname, string identifier)
 {
     try
     {
         return(MenuDictionary[menuname.ToString()][identifier].Cast <CheckBox>().CurrentValue);
     }
     catch (Exception)
     {
         // checkbox not exist
         return(false);
     }
 }
示例#8
0
 internal void AddSlider(MenuNames menuname, string displayName, string identifier, int defaultValue, int min, int max)
 {
     MenuDictionary[menuname.ToString()].Add(identifier, new Slider(displayName, defaultValue, min, max));
 }
示例#9
0
 internal void AddCheckBox(MenuNames menuname, string displayName, string identifier, bool defaultValue)
 {
     MenuDictionary[menuname.ToString()].Add(identifier, new CheckBox(displayName, defaultValue));
 }
示例#10
0
 internal int GetValue(MenuNames menuname, string identifier)
 {
     return(MenuDictionary[menuname.ToString()][identifier].Cast <Slider>().CurrentValue);
 }
示例#11
0
 public SelectedNodeMenuItem(string text, MenuNames name, Action <T> action)
     : base(text)
 {
     base.Name = name.ToString();
     _action   = action;
 }
示例#12
0
 public FileRequiredMenuItem(string text, MenuNames name, Action clickDelegate)
     : base(text)
 {
     base.Name      = name.ToString();
     _clickDelegate = clickDelegate;
 }