Beispiel #1
0
 private void SelectAllToolStripMenuItemOnClick(object sender, EventArgs e)
 {
     for (var i = 0; i < AvailableMapsBox.Items.Count; i++)
     {
         AvailableMapsBox.SetItemChecked(i, true);
     }
     InstallButton.Enabled = true;
 }
Beispiel #2
0
        private void InstallButton_Click(object sender, EventArgs e)
        {
            // Download and unzip each map into MordhauPath
            // Then delete the zip to keep it clean
            numMapsInstalling = AvailableMapsBox.CheckedItems.Count;
            numMapsInstalled  = 0;

            InstallButton.Enabled = false;
            foreach (Map m in AvailableMapsBox.CheckedItems)
            {
                Log("Beginning install for " + m.name);
                Task.Run(async() => {
                    await InstallMap(m);
                    lock (countingLocker)
                        CountInstallingMaps();
                });
            }

            for (var i = 0; i < AvailableMapsBox.Items.Count; i++)
            {
                AvailableMapsBox.SetItemChecked(i, false);
            }
        }
Beispiel #3
0
        private void InstallButton_Click(object sender, EventArgs e)
        {
            // Download and unzip each map into MordhauPath
            // Then delete the zip to keep it clean
            numMapsInstalling = AvailableMapsBox.CheckedItems.Count;
            numMapsInstalled  = 0;

            InstallButton.Enabled = false;
            int mapNum = 0;

            // Enable progress bars
            progressBar1.Visible    = true;
            progressBar1.Value      = 0;
            progressBar1.Maximum    = numMapsInstalling;
            progressBar1.CustomText = $"{Properties.Resources.str_Beginning_install_for}{numMapsInstalling} maps...";

            Refresh();

            foreach (Map m in AvailableMapsBox.CheckedItems)
            {
                m.installNumber = mapNum;
                Log(Properties.Resources.str_Beginning_install_for + m.name);
                Task.Run(() =>
                {
                    InstallMap(m);
                    lock (countingLocker)
                        CountInstallingMaps();
                });
                mapNum++;
            }

            for (var i = 0; i < AvailableMapsBox.Items.Count; i++)
            {
                AvailableMapsBox.SetItemChecked(i, false);
            }
        }