Beispiel #1
0
        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();
        }
Beispiel #2
0
 private void OpenDownloads_Click(object sender, RoutedEventArgs e)
 {
     Process.Start("explorer.exe", ManagerInfo.Get().GetFullDownloadDirectory());
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
 public static string GetMonoModPath(string fullName)
 {
     return(Path.Combine(ManagerInfo.Get().installDir, "BepInEx", "monomod", fullName));
 }
Beispiel #5
0
 public static string GetPluginPath(string fullName)
 {
     return(Path.Combine(ManagerInfo.Get().installDir, "BepInEx", "plugins", fullName));
 }
Beispiel #6
0
 public string GetDownloadDirectory()
 {
     return(Path.Combine(ManagerInfo.Get().GetFullDownloadDirectory(), this.fullName));
 }
Beispiel #7
0
 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))));
 }
Beispiel #8
0
 public void Save()
 {
     File.WriteAllText(Path.Combine(ManagerInfo.Get().GetFullProfileDirectory(), (name + ".json")), GetJSON());
 }