예제 #1
0
        void MenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            MenuEntry selected = sender as MenuEntry;
            ToDelete = selected.Text;
            string message = Langue.tr("MapDel") + ToDelete + " ?\n";
            MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(message);
            confirmExitMessageBox.Accepted += MessageBoxAccepted;

            ScreenManager.AddScreen(confirmExitMessageBox, e.PlayerIndex);
        }
예제 #2
0
        /// <summary>
        /// Event handler for when the Quit Game menu entry is selected.
        /// </summary>
        void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            string message;

            if (mod == 2)
                message = Langue.tr("EditMsgBox");

            else
                message = Langue.tr("GameMsgBox");

            MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);

            confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
        }
예제 #3
0
        /// <summary>
        /// When the user cancels the main menu, ask if they want to exit the sample.
        /// </summary>
        protected override void OnCancel(PlayerIndex playerIndex)
        {
            string message = Langue.tr("MainQuitMsg");

            MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(message);

            confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmExitMessageBox, playerIndex);
        }
예제 #4
0
 void EraseMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     if (!eraselected)
     {
         eraselected = true;
         MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(Langue.tr("SaveDel"));
         confirmExitMessageBox.Accepted += MessageBoxAccepted;
         confirmExitMessageBox.Accepted += MessageBoxCancelled;
         confirmExitMessageBox.Cancelled += MessageBoxCancelled;
         ScreenManager.AddScreen(confirmExitMessageBox, e.PlayerIndex);
     }
 }