示例#1
0
        private void OpenALDownloaded(IAsyncResult result)
        {
            HttpWebResponse response = (result.AsyncState as HttpWebRequest).EndGetResponse(result) as HttpWebResponse;

            if (response == null)
            {
                MessageDisplay.Add("Download failed.");
                return;
            }

            MessageDisplay.Add("Download completed. Launching installer...");
            Stream resStream = response.GetResponseStream();

            string     fileName = Path.Combine(Path.GetTempPath(), "oalinst.exe");
            FileStream fs       = new FileStream(fileName, FileMode.Create, FileAccess.Write);

            resStream.CopyTo(fs);
            fs.Close();

            var startInfo = new System.Diagnostics.ProcessStartInfo(fileName);

            startInfo.Verb = "runas";
            var process = System.Diagnostics.Process.Start(startInfo);

            process.WaitForExit();

            MessageDisplay.Add("Installation complete. Trying to enable sound...");
            InitAudio();
        }
示例#2
0
 internal void OnNoAudioHardwareException()
 {
     if (AudioEnabled)
     {
         DoNextUpdate(() => MessageDisplay.Add("No audio hardware was detected. All sound is disabled."));
         DisableAudio();
     }
 }
示例#3
0
        internal void OnNoAudioHardwareException()
        {
            MessageDisplay.Add("No audio hardware was detected. All sound is disabled.");
            //TODO: Can this still happen?
#if WINDOWS
            MessageDisplay.Add("You might need to install OpenAL drivers.");
            MessageDisplay.Add("Press Ctrl+Alt+I to try downloading and installing them now.");

            Keyboard.Listen(Key.I, ButtonState.Pressed, TryInstallOpenAL, null);
#endif
        }
示例#4
0
        private void TryInstallOpenAL()
        {
            if (!Keyboard.IsCtrlDown() || !Keyboard.IsAltDown())
            {
                return;
            }

            MessageDisplay.Add("Starting download of OpenAL installer...");
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://github.com/Mono-Game/MonoGame.Dependencies/raw/master/oalinst.exe");

            request.BeginGetResponse(OpenALDownloaded, request);
        }
示例#5
0
 /// <summary>
 /// Näyttää kontrollien ohjetekstit tietylle ohjaimelle.
 /// </summary>
 public void ShowControlHelp(IController controller)
 {
     MessageDisplay.Add(controller.GetHelpTexts());
 }
示例#6
0
 /// <summary>
 /// Näyttää kontrollien ohjetekstit.
 /// </summary>
 public void ShowControlHelp()
 {
     controllers.ForEach(c => MessageDisplay.Add(c.GetHelpTexts()));
 }