Beispiel #1
0
        private void Preload_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(100));
            ProcessFinished.Invoke(this, null);
            if (e.Error != null)
            {
                ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(0));
                UpdateProcessMessage(ModLoaderText.Process_Error + " " + e.Error.Message);
            }
            else if (!e.Cancelled)
            {
                UpdateProcessMessage("Preload complete!");
                GamePreloaded = true;
                ModMenuUpdated.Invoke(this, new EventValueArgs <bool>(false));
            }
            else
            {
                ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(0));
                UpdateProcessMessage(ModLoaderText.Process_Cancelled);
            }

            InteractionEnable.Invoke(this, null);

            BackgroundWorker a = sender as BackgroundWorker;

            a.DoWork             -= Preload_DoWork;
            a.RunWorkerCompleted -= Preload_RunWorkerCompleted;
            a.ProgressChanged    -= Preload_ProgressChanged;
        }
Beispiel #2
0
 private void Preload_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(e.ProgressPercentage));
     if (e.ProgressPercentage == 0)
     {
         UpdateProcessMessage(ModLoaderText.Process_Step0);
     }
     else if (e.ProgressPercentage == 33)
     {
         UpdateProcessMessage(ModLoaderText.Process_Step1_ROM);
     }
     else if (e.ProgressPercentage == 66)
     {
         UpdateProcessMessage("Processing game files...");
     }
     else if (e.ProgressPercentage == 90)
     {
         UpdateProcessMessage("Removing temporary files...");
     }
 }
Beispiel #3
0
 private void AsyncWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(e.ProgressPercentage));
     if (e.ProgressPercentage == 0)
     {
         UpdateProcessMessage(ModLoaderText.Process_Step0);
     }
     else if (e.ProgressPercentage == 25)
     {
         UpdateProcessMessage(ModLoaderText.Process_Step1_ROM);
     }
     else if (e.ProgressPercentage == 50)
     {
         UpdateProcessMessage(ModLoaderText.Process_Step2);
     }
     else if (e.ProgressPercentage == 75)
     {
         UpdateProcessMessage(ModLoaderText.Process_Step3_ROM);
     }
     else if (e.ProgressPercentage == 90)
     {
         UpdateProcessMessage("Removing temporary files...");
     }
 }