Exemple #1
0
		/// <summary>
		/// Responds to user input, changing the selected entry and accepting
		/// or cancelling the menu.
		/// </summary>
		public override void HandleInput( InputState input ) {
			// Move to the previous menu entry?
			if( input.MenuUp ) {
				AudioManager.PlayCue( "Menu_Accept" );
				selectedEntry--;

				if( selectedEntry < 0 )
					selectedEntry = menuEntries.Count - 1;
			}

			// Move to the next menu entry?
			if( input.MenuDown ) {
				AudioManager.PlayCue( "Menu_Accept" );
				selectedEntry++;

				if( selectedEntry >= menuEntries.Count )
					selectedEntry = 0;
			}

			// Accept or cancel the menu?
			if( input.MenuSelect ) {
				OnSelectEntry( selectedEntry );
			} else if( input.MenuCancel ) {
				OnCancel();
			}
		}
Exemple #2
0
		/// <summary>
		/// Responds to user input.
		/// </summary>
		public override void HandleInput( InputState input ) {
			if( input.MenuSelect ) {
				ExitScreen();
				ScreenManager.AddScreen( new TitleScreen() );
			} else if( input.MenuCancel ) {
				OnCancel();
			}
		}
Exemple #3
0
		/// <summary>
		/// Allows the screen to handle user input. Unlike Update, this method
		/// is only called when the screen is active, and not when some other
		/// screen has taken the focus.
		/// </summary>
		public virtual void HandleInput( InputState input ) { }