Ejemplo n.º 1
0
        private async void LaunchWithUpdate(bool worldBuilderLaunch)
        {
            if (!noInternet && !worldBuilderLaunch)
            {
                await CheckAndApplyOptions();
            }

            DownloadWindow downloadWindow = new DownloadWindow(configuration);

            downloadWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            ReposWorker.DownloadStatusChanged += downloadWindow.UpdateInformation;
            downloadWindow.Show();

            this.Hide();

            await GameLauncher.PrepareWithUpdate(configuration);

            downloadWindow.Hide();

            LocalFilesWorker.ConvertBigsToGibs();
            foreach (var file in LocalFilesWorker.GetLatestPatchFileNames(configuration.Patch))
            {
                if (!String.IsNullOrEmpty(file))
                {
                    LocalFilesWorker.ActivateFileByName(file);
                }
            }

            SaveConfigAndOptions(this, null);
            await Task.Run(() => GameLauncher.Launch(configuration, options, worldBuilderLaunch));

            downloadWindow.Close();
            this.Close();
        }
Ejemplo n.º 2
0
        private async void LaunchManualSelectedFile(string fileName, bool worldBuilderLaunch)
        {
            if (!noInternet && !worldBuilderLaunch)
            {
                await CheckAndApplyOptions();
            }

            if (fileName.Contains("HP"))
            {
                configuration.Patch = new HPatch();
            }

            if (fileName.Contains("BP"))
            {
                configuration.Patch = new BPatch();
            }

            LocalFilesWorker.ActivateFileByName(fileName);

            this.Hide();

            SaveConfigAndOptions(this, null);
            await Task.Run(() => GameLauncher.Launch(configuration, options, worldBuilderLaunch));

            this.Close();
        }
Ejemplo n.º 3
0
        private async void LaunchWithoutUpdate(bool worldBuilderLaunch)
        {
            if (!noInternet && !worldBuilderLaunch)
            {
                await CheckAndApplyOptions();
            }

            this.Hide();

            await Task.Run(() =>
            {
                foreach (var file in LocalFilesWorker.GetLatestPatchFileNames(configuration.Patch))
                {
                    LocalFilesWorker.ActivateFileByName(file);
                }
            });

            SaveConfigAndOptions(this, null);
            await Task.Run(() => GameLauncher.Launch(configuration, options, worldBuilderLaunch));

            this.Close();
        }