Beispiel #1
0
        protected override void OnCancel(PlayerIndex playerIndex)
        {
            const string message = "Are you sure you want to exit?";

            MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(message);

            confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmExitMessageBox, playerIndex);
        }
Beispiel #2
0
        /// <summary>
        /// Event handler for when a game menu item is selected.
        /// </summary>
        void OnLaunch(object sender, PlayerIndexEventArgs e)
        {
            // Launch Game via Steam URL
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo.FileName = (((ShortcutMenuEntry)sender).ShortcutPath);
            process.StartInfo.UseShellExecute = true;
            process.StartInfo.RedirectStandardOutput = false;

            try
            {
                process.Start();
            }
            catch (Exception exception)
            {
                MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(exception.Message + "\n(" + process.StartInfo.FileName + ")");
                confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
                ScreenManager.AddScreen(confirmExitMessageBox, e.PlayerIndex);
            }
        }