Пример #1
0
 private void Uninstall_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to uninstall D2Moddin from your computer? This will remove all mods and the mod manager itself.", "Uninstall confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         D2MP.Uninstall();
     }
 }
Пример #2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     XmlConfigurator.Configure();
     D2MP.main();
 }
Пример #3
0
        private void setActiveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var mod = (RemoteMod)modsGridView.SelectedRows[0].Tag;

            D2MP.SetMod(new ClientCommon.Methods.SetMod {
                Mod = new ClientCommon.Data.ClientMod {
                    name = mod.name, version = mod.version
                }
            });
        }
Пример #4
0
        private void btnResetSettings_Click(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("Are you sure you want to reset all settings of the client and restart it?", "Reset confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (r == DialogResult.Yes)
            {
                Settings.Reset();
                D2MP.Restart();
            }
        }
Пример #5
0
        private void btnUninstallAll_Click(object sender, EventArgs e)
        {
            var clientMods = new List <ClientCommon.Data.ClientMod>(modController.getLocalMods());

            foreach (var mod in clientMods)
            {
                D2MP.DeleteMod(new ClientCommon.Methods.DeleteMod {
                    Mod = mod
                });
            }
        }
Пример #6
0
        private void removeModToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var mod          = (RemoteMod)modsGridView.SelectedRows[0].Tag;
            var parameterMod = new ClientCommon.Data.ClientMod {
                name = mod.name
            };

            D2MP.DeleteMod(new ClientCommon.Methods.DeleteMod {
                Mod = parameterMod
            });
        }
Пример #7
0
        private void updateModToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var mod          = (RemoteMod)modsGridView.SelectedRows[0].Tag;
            var parameterMod = new ClientCommon.Data.ClientMod {
                name = mod.name
            };

            D2MP.DeleteMod(new ClientCommon.Methods.DeleteMod {
                Mod = parameterMod
            });
            if (!modController.installQueue.Contains(mod))
            {
                modController.installQueue.Enqueue(mod);
            }

            modController.InstallQueued();
        }
Пример #8
0
        private static void InstallProcess(object o)
        {
            RemoteMod currentMod = null;

            while (installQueue.Count > 0 && !D2MP.shutDown)
            {
                Thread.Sleep(1000);

                if (!D2MP.isInstalling && !D2MP.dlRetry)
                {
                    currentMod = installQueue.Dequeue();
                    D2MP.SendRequestMod(currentMod.name);
                    Thread.Sleep(1000);
                }
            }

            installing = false;
        }
Пример #9
0
        private void btnUpdateAll_Click(object sender, EventArgs e)
        {
            List <RemoteMod> needsUpdate = modController.checkUpdates();

            foreach (var mod in needsUpdate)
            {
                var parameterMod = new ClientCommon.Data.ClientMod {
                    name = mod.name
                };
                D2MP.DeleteMod(new ClientCommon.Methods.DeleteMod {
                    Mod = parameterMod
                });
                installModBrowser(mod.name);
                //D2MP.InstallMod(new ClientCommon.Methods.InstallMod { Mod = parameterMod, url = mod.url });
            }
            btnUpdateAll.Text    = "Update All";
            btnUpdateAll.Enabled = false;
            refreshTable();
        }
Пример #10
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //check to see if we are already running
            string pid = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), D2MP.PIDFile);

            //delete the pid to shut down the other instance
            if (File.Exists(pid))
            {
                File.Delete(pid);
            }

            if (CheckSettings())
            {
                MessageBox.Show("Your user.config file was corrupted and needed to be deleted.\nAll your settings have been reset to default.\nNo further action is required.",
                                "D2Moddin", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            XmlConfigurator.Configure();
            D2MP.main();
        }
Пример #11
0
        private void btnUpdateAll_Click(object sender, EventArgs e)
        {
            List <RemoteMod> needsUpdate = modController.checkUpdates();

            foreach (var mod in needsUpdate)
            {
                var parameterMod = new ClientCommon.Data.ClientMod {
                    name = mod.name
                };
                D2MP.DeleteMod(new ClientCommon.Methods.DeleteMod {
                    Mod = parameterMod
                });

                if (!modController.installQueue.Contains(mod))
                {
                    modController.installQueue.Enqueue(mod);
                }
            }
            btnUpdateAll.Text    = "Update All";
            btnUpdateAll.Enabled = false;
            modController.InstallQueued();
            refreshTable();
        }
Пример #12
0
 private void About_Click(object sender, EventArgs e)
 {
     D2MP.showCredits();
 }
Пример #13
0
 private void ModManager_Click(object sender, EventArgs e)
 {
     D2MP.showModManager();
 }
Пример #14
0
 private void Restart_Click(object sender, EventArgs e)
 {
     D2MP.Restart();
 }
Пример #15
0
        public void refreshTable()
        {
            modsGridView.Rows.Clear();
            modController.getLocalMods();
            List <RemoteMod> remoteMods;

            try
            {
                remoteMods = modController.getRemoteMods();
            }
            catch (Exception)
            {
                MessageBox.Show("Could not connect to the update server.");
                Close();
                throw;
            }
            List <RemoteMod> needsUpdate  = modController.checkUpdates();
            List <RemoteMod> needsInstall = modController.checkAvailable();
            var activeMod = D2MP.GetActiveMod();

            foreach (var mod in remoteMods)
            {
                int             rowIndex = modsGridView.Rows.Add(new Object[] { mod.fullname, mod.version, mod.author, "Up to date" });
                DataGridViewRow row      = modsGridView.Rows[rowIndex];
                row.Tag = mod;
                if (activeMod != null && mod.name == activeMod.name)
                {
                    row.Cells[3].Value = "Active mod";
                }
                if (mod.needsUpdate)
                {
                    DataGridViewCellStyle boldStyle = new DataGridViewCellStyle();
                    boldStyle.Font       = new Font(modsGridView.Font, FontStyle.Bold);
                    row.DefaultCellStyle = boldStyle;
                    row.Cells[3].Value   = "Needs update";
                }
                else
                {
                    DataGridViewCellStyle normalStyle = new DataGridViewCellStyle();
                    //normalStyle.Font = new Font(modsGridView.Font, FontStyle.Regular);
                    modsGridView.Rows[rowIndex].DefaultCellStyle = normalStyle;
                }
                if (mod.needsInstall)
                {
                    modsGridView.Rows[rowIndex].DefaultCellStyle.ForeColor = Color.Gray;
                    row.Cells[3].Value = "Not installed";
                }
                else
                {
                    modsGridView.Rows[rowIndex].DefaultCellStyle.ForeColor = Color.Black;
                }
                //modsGridView.Rows[rowIndex].DefaultCellStyle = boldStyle;
            }
            modsGridView.CurrentRow.Selected = false;
            if (needsUpdate.Count > 0)
            {
                btnUpdateAll.Text    = String.Format("Update All ({0})", needsUpdate.Count);
                btnUpdateAll.Enabled = true;
            }
            else
            {
                btnUpdateAll.Text    = "Update All";
                btnUpdateAll.Enabled = false;
            }
        }
Пример #16
0
 private void Preferences_Click(object sender, EventArgs e)
 {
     D2MP.showPreferences();
 }
Пример #17
0
 private void ModManualInstall_Click(object sender, EventArgs e)
 {
     D2MP.manualInstallMod();
 }
Пример #18
0
 private void Uninstall_Click(object sender, EventArgs e)
 {
     D2MP.Uninstall();
 }
Пример #19
0
 private void ModList_Click(object sender, EventArgs e)
 {
     D2MP.ShowModList();
 }