public MainWindow() { InitializeComponent(); this.Title = "GCManager V" + App.VERSION; ModManager.selectedModInfo.name = "GCManager"; ModManager.selectedModInfo.author = "Risk of Rain 2 Mod Manager"; ModManager.selectedModInfo.image = new BitmapImage(new System.Uri("pack://application:,,,/commando.png")); this.DataContext = ModManager.selectedModInfo; InstallDirText.Text = ManagerInfo.Get().installDir; ModManager.onlineModList = onlineModList; ModManager.downloadedModList = downloadedModList; ModManager.LocalModDeletionImminent += PreModDeletion; OnlineMods.SetModList(onlineModList); OnlineMods.RefreshList(); DownloadedMods.SetModList(downloadedModList); DownloadedMods.RefreshList(); }
private void OpenDownloads_Click(object sender, RoutedEventArgs e) { Process.Start("explorer.exe", ManagerInfo.Get().GetFullDownloadDirectory()); }
public void Install() { if (this.fullName == "bbepis-BepInExPack") //Special case { Utility.CopyDirectory(Path.Combine(GetDownloadDirectory(), "BepInExPack"), ManagerInfo.Get().installDir); } else { List <string> dirs = new List <string>(Directory.GetDirectories(GetDownloadDirectory(), "*", SearchOption.AllDirectories)); dirs.Add(GetDownloadDirectory()); foreach (string dir in dirs) { string destDir; if (new DirectoryInfo(dir).Name.ToLower() == "monomod") { destDir = GetMonoModPath(""); } else { destDir = GetPluginPath(""); } string[] dlls = Directory.GetFiles(dir, "*.dll"); if (dlls.Length > 0) { destDir = Path.Combine(destDir, this.fullName); Directory.CreateDirectory(destDir); foreach (string filepath in dlls) { string dest = Path.Combine(destDir, Path.GetFileName(filepath)); if (!File.Exists(dest)) { File.Copy(filepath, dest, true); } } } } } this.isInstalled = true; }
public static string GetMonoModPath(string fullName) { return(Path.Combine(ManagerInfo.Get().installDir, "BepInEx", "monomod", fullName)); }
public static string GetPluginPath(string fullName) { return(Path.Combine(ManagerInfo.Get().installDir, "BepInEx", "plugins", fullName)); }
public string GetDownloadDirectory() { return(Path.Combine(ManagerInfo.Get().GetFullDownloadDirectory(), this.fullName)); }
public bool CheckIfInstalled() { return(this.fullName == "bbepis-BepInExPack" ? Directory.Exists(Path.Combine(ManagerInfo.Get().installDir, "BepInEx", "core")) : (Directory.Exists(GetMonoModPath(this.fullName)) || Directory.Exists(GetPluginPath(this.fullName)))); }
public void Save() { File.WriteAllText(Path.Combine(ManagerInfo.Get().GetFullProfileDirectory(), (name + ".json")), GetJSON()); }