Beispiel #1
0
 private void btnUnpack_Click(object sender, EventArgs e)
 {
     enableControls(false);
     unpacker = new ArchiveUnpacker(txtGameDir.Text,
                                    cbxData1.Checked, cbxData2.Checked, cbxData3.Checked, cbxData4.Checked, cbxData5.Checked, cbxDLC1.Checked, cbxDLC2.Checked);
     unpackThread = unpacker.Start();
 }
Beispiel #2
0
 public FormMain()
 {
     InitializeComponent();
     abort        = false;
     pmData1      = new ProgressManager(lblData1Progress, pbrData1);
     pmData2      = new ProgressManager(lblData2Progress, pbrData2);
     pmData3      = new ProgressManager(lblData3Progress, pbrData3);
     pmData4      = new ProgressManager(lblData4Progress, pbrData4);
     pmData5      = new ProgressManager(lblData5Progress, pbrData5);
     pmDLC1       = new ProgressManager(lblDLC1Progress, pbrDLC1);
     pmDLC2       = new ProgressManager(lblDLC2Progress, pbrDLC2);
     unpacker     = null;
     unpackThread = null;
 }
Beispiel #3
0
        private void tmrProgress_Tick(object sender, EventArgs e)
        {
            if (unpacker != null)
            {
                if (unpackThread.ThreadState == System.Threading.ThreadState.Running)
                {
                    checkProgress();
                }
                else
                {
                    checkProgress();
                    bool   success = unpacker.Success;
                    string error   = unpacker.Error;
                    unpacker     = null;
                    unpackThread = null;

                    if (success)
                    {
                        SystemSounds.Asterisk.Play();
                    }
                    else if (!abort)
                    {
                        showError(error);
                    }

                    pmData1.Reset();
                    pmData2.Reset();
                    pmData3.Reset();
                    pmData4.Reset();
                    pmData5.Reset();
                    pmDLC1.Reset();
                    pmDLC2.Reset();
                    enableControls(true);

                    if (abort)
                    {
                        Close();
                    }
                }
            }
        }