public static void Browse()
        {
            OpenFileDialog dlg = new OpenFileDialog()
            {
                FileName = "DarkSoulsIII.exe",
                Filter   = "All Files (*.*)|*.*",
                Title    = "Select Game Executable (*.exe for PC, eboot.bin for PS4)",
            };

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (dlg.FileName.ToUpper().EndsWith("EBOOT.BIN"))
                {
                    Type = InterrootType.InterrootBloodborne;
                    string possibleInterroot = Path.Combine(new FileInfo(dlg.FileName).DirectoryName, "dvdroot_ps4");
                    if (Directory.Exists(possibleInterroot))
                    {
                        Interroot = possibleInterroot;
                        CFG.Save();
                    }
                    else
                    {
                        MessageBox.Show("A PS4 executable was selected but no /dvdroot_ps4/ folder was found next to it. Unable to determine data root path.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    MessageBox.Show("Automatically switched to Bloodborne game type since it is the PS4 exclusive one.\nIf this is incorrect, be sure to modify the \"Game Type\" option below");
                }
                else
                {
                    Interroot = new FileInfo(dlg.FileName).DirectoryName;

                    if (dlg.FileName.Contains("DARKSOULS.exe"))
                    {
                        Type = InterrootType.InterrootDS1;
                        MessageBox.Show("Automatically switched to Dark Souls game type based on selected file.\nIf this is incorrect, be sure to modify the \"Game Type\" option below");
                    }
                    else if (dlg.FileName.Contains("DarkSoulsRemastered.exe"))
                    {
                        Type = InterrootType.InterrootDS1R;
                        MessageBox.Show("Automatically switched to Dark Souls Remastered game type based on selected file.\nIf this is incorrect, be sure to modify the \"Game Type\" option below");
                    }
                    //else if (dlg.FileName.Contains("DarkSoulsII.exe"))
                    //{
                    //    Type = InterrootType.InterrootDS2;
                    //    MessageBox.Show("Automatically switched to Dark Souls II game type based on selected file.\nIf this is incorrect, be sure to modify the \"Game Type\" option below");
                    //}
                    else if (dlg.FileName.Contains("DarkSoulsIII.exe"))
                    {
                        Type = InterrootType.InterrootDS3;
                        MessageBox.Show("Automatically switched to Dark Souls III game type based on selected file.\nIf this is incorrect, be sure to modify the \"Game Type\" option below");
                    }

                    CFG.Save();
                }
            }
        }
Exemple #2
0
 protected override void OnExiting(object sender, EventArgs args)
 {
     CFG.Save();
     base.OnExiting(sender, args);
 }