Пример #1
0
        private void BrowseButton_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog _LLBFolderFinder = new FolderBrowserDialog();

            _LLBFolderFinder.Description = "Please select the LLBlaze_Data folder in the root directory of Lethal League Blaze";

            if (_config.LoadConfig().Count == 0)
            {
                _LLBFolderFinder.SelectedPath = Directory.GetCurrentDirectory();
            }
            else
            {
                _LLBFolderFinder.SelectedPath = _config.LoadConfig()[0];
            }

            if (_LLBFolderFinder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                _config.SaveConfig(_LLBFolderFinder.SelectedPath, showReadmeCheckbox.Checked);
                gameFolderPath.Text  = _LLBFolderFinder.SelectedPath + dataFolderEnding;
                gameFolderPathString = _LLBFolderFinder.SelectedPath + dataFolderEnding;
                if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
                {
                    GetInstalledModsAndAddThemToInstalledModsList();
                }
            }
        }
Пример #2
0
        private void BrowseButton_Click(object sender, EventArgs e)
        {
            string gameExecFilename = PathHelper.Get().GetLLBExecutableName();
            string gameDirName      = PathHelper.Get().GetLLBGameDirName();

            FolderBrowserDialog _LLBFolderFinder = new FolderBrowserDialog();

            _LLBFolderFinder.Description = "Please select the " + gameDirName + " folder (The folder where the .exe is located)";

            if (_config.LoadConfig().Count == 0)
            {
                _LLBFolderFinder.SelectedPath = Directory.GetCurrentDirectory();
            }
            else
            {
                _LLBFolderFinder.SelectedPath = _config.LoadConfig()[0];
            }

            if (_LLBFolderFinder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (!File.Exists(Path.Combine(_LLBFolderFinder.SelectedPath, gameExecFilename)))
                {
                    MessageBox.Show("The selected directory does not contain " + gameExecFilename + ", please select the folder containing said file.", "Warning");
                }
                _config.SaveConfig(_LLBFolderFinder.SelectedPath, showReadmeCheckbox.Checked);
                gameFolderPath.Text  = _LLBFolderFinder.SelectedPath + dataFolderEnding;
                gameFolderPathString = _LLBFolderFinder.SelectedPath + dataFolderEnding;
                if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
                {
                    InstalledModsDGV.Rows.Clear();
                    GetInstalledModsAndAddThemToInstalledModsList();
                }
            }
        }
Пример #3
0
        private void UninstallAllMods()
        {
            CleanerHelper _cleanerHelper = new CleanerHelper();
            BackupHelper  _backupHelper  = new BackupHelper();

            //copy pasted
            if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
            {
                var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString);
                if (installedModsList.Count > 0)
                {
                    _cleanerHelper.RemoveMods(gameFolderPathString, installedModsList);
                    _cleanerHelper.CleanGameFolder(gameFolderPathString);
                }

                try
                {
                    _cleanerHelper.RemoveMod(gameFolderPathString, "ModMenu");
                    _backupHelper.RestoreBackup(gameFolderPathString);
                    _backupHelper.DeleteBackup(gameFolderPathString);
                }
                catch { Console.WriteLine("Could not remove ModMenu. Please verify your files"); }
                Console.WriteLine("Uninstalled All mods");
            }
            else
            {
                Console.WriteLine("CheckModStatus failed");
                _cleanerHelper.CleanGameFolder(gameFolderPathString);
            }
        }
Пример #4
0
        private void UninstallMods(List <string> modsToUninstall)
        {
            CleanerHelper _cleanerHelper = new CleanerHelper();
            BackupHelper  _backupHelper  = new BackupHelper();

            // mostly copy pasted
            if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
            {
                foreach (var mod in modsToUninstall)
                {
                    if (_cleanerHelper.RemoveMod(gameFolderPathString, mod))
                    {
                        var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString);
                        if (installedModsList.Count == 0)
                        {
                            _cleanerHelper.RemoveMod(gameFolderPathString, "ModMenu");
                            _backupHelper.RestoreBackup(gameFolderPathString);
                            _backupHelper.DeleteBackup(gameFolderPathString);
                        }
                    }
                }
            }
        }