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); }
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; }
public DelegateCheckedMenuItem(string text, MenuNames name, Func <bool> initDelegate, Action <bool> changedDelegate) : base(text) { base.Name = name.ToString(); _initDelegate = initDelegate; _changedDelegate = changedDelegate; }
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); }
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; } }
public DelegateMenuItem(string text, MenuNames name, Action click) : base(text) { EventHandler value = delegate { click(); }; base.Click += value; base.Name = name.ToString(); }
internal bool IsChecked(MenuNames menuname, string identifier) { try { return(MenuDictionary[menuname.ToString()][identifier].Cast <CheckBox>().CurrentValue); } catch (Exception) { // checkbox not exist return(false); } }
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)); }
internal void AddCheckBox(MenuNames menuname, string displayName, string identifier, bool defaultValue) { MenuDictionary[menuname.ToString()].Add(identifier, new CheckBox(displayName, defaultValue)); }
internal int GetValue(MenuNames menuname, string identifier) { return(MenuDictionary[menuname.ToString()][identifier].Cast <Slider>().CurrentValue); }
public SelectedNodeMenuItem(string text, MenuNames name, Action <T> action) : base(text) { base.Name = name.ToString(); _action = action; }
public FileRequiredMenuItem(string text, MenuNames name, Action clickDelegate) : base(text) { base.Name = name.ToString(); _clickDelegate = clickDelegate; }