Пример #1
0
 /// <summary>
 /// Event handler for when the Quit Game menu entry is selected.
 /// </summary>
 private void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     const string message = "Are you sure you want to quit?";
     var confirmQuitMessageBox = new MessageBoxScreen(message);
     confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;
     ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
 }
Пример #2
0
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 private void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen());
 }
Пример #3
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to quit" message box. This uses the loading screen to
 /// transition from the game back to the main menu screen.
 /// </summary>
 private void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
 }
Пример #4
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 private void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
Пример #5
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 private void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen(), e.PlayerIndex);
 }
Пример #6
0
 /// <summary>
 /// Helper overload makes it easy to use OnCancel as a MenuEntry event handler.
 /// </summary>
 protected void OnCancel(object sender, PlayerIndexEventArgs e)
 {
     OnCancel(e.PlayerIndex);
 }
Пример #7
0
 /// <summary>
 /// Event handler for when the Frobnicate menu entry is selected.
 /// </summary>
 private void FrobnicateMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     _frobnicate = !_frobnicate;
     SetMenuEntryText();
 }
Пример #8
0
 /// <summary>
 /// Event handler for when the Elf menu entry is selected.
 /// </summary>
 private void ElfMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     _elf++;
     SetMenuEntryText();
 }
Пример #9
0
 /// <summary>
 /// Event handler for when the Ungulate menu entry is selected.
 /// </summary>
 private void UngulateMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     _currentUngulate++;
     if (_currentUngulate > Ungulate.Llama)
     {
         _currentUngulate = 0;
     }
     SetMenuEntryText();
 }
Пример #10
0
 /// <summary>
 /// Event handler for when the Language menu entry is selected.
 /// </summary>
 private void LanguageMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     _currentLanguage = (_currentLanguage + 1) % Languages.Length;
     SetMenuEntryText();
 }