Ejemplo n.º 1
0
        /// <summary>
        /// Launcher main window. Creates main window and displays for user interaction.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            var xmlDataProvider = Resources["DataProvider"] as XmlDataProvider;

            if (xmlDataProvider != null)
            {
                xmlDataProvider.Source = new Uri(Path.GetFullPath("UserOptions.xml"));
            }

            Background = new ImageBrush
            {
                ImageSource = new BitmapImage(new Uri(@"assets\textures\Launcher_MainBackground.png", UriKind.Relative))
            };
            MusicVolumeMedia.Source = new Uri(@"assets\sounds\launcher\Music.mp3", UriKind.Relative);
            MusicVolumeMedia.Play();

            RefreshGameList();
        }
Ejemplo n.º 2
0
        private void LaunchButton_OnClick(object sender, RoutedEventArgs e)
        {
            var dataProvider = (Resources["DataProvider"] as XmlDataProvider);

            if (dataProvider == null)
            {
                return;
            }

            string source = dataProvider.Source.LocalPath;

            dataProvider.Document.Save(source);
            try
            {
                MusicVolumeMedia.Stop();
                Process.Start(ClientExec);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString(), "Failed to start game");
            }
        }
Ejemplo n.º 3
0
 protected override void OnActivated(EventArgs e)
 {
     base.OnActivated(e);
     MusicVolumeMedia.Play();
 }