public override bool ProcessControl(UIMenu.MenuControls control) { if (!Enabled) { Game.PlaySound(Parent.AUDIO_ERROR, Parent.AUDIO_LIBRARY); return(true); } switch (control) { case UIMenu.MenuControls.Left: Index--; Parent.ListChange(this, Index); ListChangedTrigger(Index); Game.PlaySound(Parent.AUDIO_LEFTRIGHT, Parent.AUDIO_LIBRARY); break; case UIMenu.MenuControls.Right: Index++; Parent.ListChange(this, Index); ListChangedTrigger(Index); Game.PlaySound(Parent.AUDIO_LEFTRIGHT, Parent.AUDIO_LIBRARY); break; } return(base.ProcessControl(control)); }
public override bool ProcessControl(UIMenu.MenuControls control) { switch (control) { case UIMenu.MenuControls.Select: Checked = !Checked; Parent.CheckboxChange(this, Checked); CheckboxEventTrigger(); break; } return(true); }
/// <summary> /// Process a specific control. Override to customize your own item. /// </summary> /// <param name="control">Control that has been pressed.</param> /// <returns>Return true if you want the control to be processed by the parent menu.</returns> public virtual bool ProcessControl(UIMenu.MenuControls control) { switch (control) { case UIMenu.MenuControls.Select: Parent.ItemSelect(this, Parent.CurrentSelection); ItemActivate(Parent); if (!Parent.Children.ContainsKey(this)) { return(true); } Parent.Visible = false; Parent.Children[this].Visible = true; Parent.MenuChangeEv(Parent.Children[this], true); break; } return(true); }
public void ResetKey(UIMenu.MenuControls menuControl) { _menuList.ForEach(m => m.ResetKey(menuControl)); }
public void SetKey(UIMenu.MenuControls menuControl, Keys control) { _menuList.ForEach(m => m.SetKey(menuControl, control)); }
public void SetKey(UIMenu.MenuControls menuControl, Control control, int controllerIndex) { _menuList.ForEach(m => m.SetKey(menuControl, control, controllerIndex)); }