Ejemplo n.º 1
0
        private void bDeactivateAll_Click(object sender, EventArgs e)
        {
            if (
                MessageBox.Show("This will deactivate all fomods.\nAre you sure you want to continue?", "Warning",
                                MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            foreach (ListViewItem lvi in lvModList.Items)
            {
                var mod = (fomod)lvi.Tag;
                if (!mod.IsActive)
                {
                    continue;
                }
                var mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall(true);
            }

            foreach (ListViewItem lvi in lvModList.Items)
            {
                lvi.Checked = false;
            }

            mf.RefreshPluginList();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Activates, Reactivates, or Deactivates the selected mod as appropriate.
        /// </summary>
        /// <param name="mod">The mod to act upon.</param>
        /// <param name="p_booReactivate">If this is a reativation request.</param>
        private void ToggleActivation(fomod mod, bool p_booReactivate)
        {
            if (!mod.IsActive)
            {
                ActivateFomod(mod);
            }
            else if (p_booReactivate)
            {
                var mraReactivator = new ModReactivator(mod);
                mraReactivator.Upgrade();
            }
            else
            {
                var mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall();
            }
            if (cbGroups.Checked)
            {
                foreach (ListViewItem lvi in lvModList.Items)
                {
                    if (lvi.Tag == mod)
                    {
                        lvi.Checked = mod.IsActive;
                    }
                }
            }
            else
            {
                lvModList.SelectedItems[0].Checked = mod.IsActive;
            }
            butDeactivate.Enabled = mod.IsActive;
            bActivate.Text        = !mod.IsActive ? "Activate" : "Reactivate";

            mf.RefreshPluginList();
        }
Ejemplo n.º 3
0
        private void bDeactivateGroup_Click(object sender, EventArgs e)
        {
            if (lvModList.SelectedItems.Count != 1)
            {
                return;
            }
            if (!cbGroups.Checked)
            {
                return;
            }
            foreach (ListViewItem lvi in lvModList.SelectedItems[0].Group.Items)
            {
                var mod = (fomod)lvi.Tag;
                if (!mod.IsActive)
                {
                    continue;
                }
                var mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall(true);
                if (cbGroups.Checked)
                {
                    foreach (ListViewItem lvi2 in lvModList.Items)
                    {
                        if (lvi2.Tag == mod)
                        {
                            lvi2.Checked = mod.IsActive;
                        }
                    }
                }
                else
                {
                    lvModList.SelectedItems[0].Checked = mod.IsActive;
                }
            }

            mf.RefreshPluginList();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Activates, Reactivates, or Deactivates the selected mod as appropriate.
        /// </summary>
        /// <param name="mod">The mod to act upon.</param>
        /// <param name="p_booReactivate">If this is a reativation request.</param>
        private void ToggleActivation(fomod mod, bool p_booReactivate)
        {
            if (!mod.IsActive)
            {
                ActivateFomod(mod);
            }
            else if (p_booReactivate)
            {
                ModReactivator mraReactivator = new ModReactivator(mod);
                mraReactivator.Upgrade();
            }
            else
            {
                ModUninstaller mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall();
            }
            if (cbGroups.Checked)
            {
                foreach (ListViewItem lvi in lvModList.Items)
                {
                    if (lvi.Tag == mod) lvi.Checked = mod.IsActive;
                }
            }
            else
            {
                lvModList.SelectedItems[0].Checked = mod.IsActive;
            }
            butDeactivate.Enabled = mod.IsActive;
            if (!mod.IsActive) bActivate.Text = "Activate";
            else bActivate.Text = "Reactivate";

            mf.RefreshPluginList();
        }
Ejemplo n.º 5
0
        private void bDeactivateGroup_Click(object sender, EventArgs e)
        {
            if (lvModList.SelectedItems.Count != 1) return;
            if (!cbGroups.Checked) return;
            foreach (ListViewItem lvi in lvModList.SelectedItems[0].Group.Items)
            {
                fomod mod = (fomod)lvi.Tag;
                if (!mod.IsActive) continue;
                ModUninstaller mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall(true);
                if (cbGroups.Checked)
                {
                    foreach (ListViewItem lvi2 in lvModList.Items)
                    {
                        if (lvi2.Tag == mod) lvi2.Checked = mod.IsActive;
                    }
                }
                else
                {
                    lvModList.SelectedItems[0].Checked = mod.IsActive;
                }
            }

            mf.RefreshPluginList();
        }
Ejemplo n.º 6
0
        private void bDeactivateAll_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("This will deactivate all fomods.\nAre you sure you want to continue?", "Warning", MessageBoxButtons.YesNo) != DialogResult.Yes) return;
            foreach (ListViewItem lvi in lvModList.Items)
            {
                fomod mod = (fomod)lvi.Tag;
                if (!mod.IsActive)
                    continue;
                ModUninstaller mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall(true);
            }
            foreach (ListViewItem lvi in lvModList.Items) lvi.Checked = false;

            mf.RefreshPluginList();
        }