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();
                }
            }
        }
예제 #2
0
 public static void Init()
 {
     if (File.Exists(FileName))
     {
         Load();
     }
     else
     {
         Current = new CFG();
         Save();
     }
 }
예제 #3
0
        protected override void LoadContent()
        {
            GFX.Init(Content);
            DBG.LoadContent(Content);
            InterrootLoader.OnLoadError += InterrootLoader_OnLoadError;

            DBG.CreateDebugPrimitives();

            GFX.World.ResetCameraLocation();

            DbgMenuItem.Init();

            UpdateMemoryUsage();

            CFG.Init();
        }
예제 #4
0
        public static void Load()
        {
            lock (_lock_SaveLoadCFG)
            {
                Current = Newtonsoft.Json.JsonConvert.DeserializeObject <CFG>(
                    File.ReadAllText(FileName));

                InterrootLoader.Interroot = Current.InterrootLoader_Interroot;
                InterrootLoader.Type      = Current.InterrootLoader_Type;

                GFX.LODMode              = Current.GFX_LODMode;
                GFX.LOD1Distance         = Current.GFX_LOD1Distance;
                GFX.LOD2Distance         = Current.GFX_LOD2Distance;
                GFX.EnableFrustumCulling = Current.GFX_EnableFrustumCulling;
                GFX.EnableTextures       = Current.GFX_EnableTextures;
                GFX.Wireframe            = Current.GFX_Wireframe;
                GFX.EnableLighting       = Current.GFX_EnableLighting;

                DBG.ShowModelNames                = Current.DBG_ShowModelNames;
                DBG.ShowModelBoundingBoxes        = Current.DBG_ShowModelBoundingBoxes;
                DBG.ShowModelSubmeshBoundingBoxes = Current.DBG_ShowModelSubmeshBoundingBoxes;
                DBG.ShowPrimitiveNametags         = Current.DBG_ShowPrimitiveNametags;
                DBG.ShowGrid            = Current.DBG_ShowGrid;
                DBG.ShowFancyTextLabels = Current.DBG_ShowFancyTextLabels;

                GFX.ModelDrawer.GoToModelsAsTheySpawn = Current.GFX_ModelDrawer_GoToModelsAsTheySpawn;

                GFX.World.CameraMoveSpeed        = Current.GFX_World_CameraMoveSpeed;
                GFX.World.CameraTurnSpeedGamepad = Current.GFX_World_CameraTurnSpeedGamepad;
                GFX.World.CameraTurnSpeedMouse   = Current.GFX_World_CameraTurnSpeedMouse;
                GFX.World.FieldOfView            = Current.GFX_World_FieldOfView;
                GFX.World.NearClipDistance       = Current.GFX_World_NearClipDistance;
                GFX.World.FarClipDistance        = Current.GFX_World_FarClipDistance;

                GFX.Display.Width      = Current.GFX_Display_Width;
                GFX.Display.Height     = Current.GFX_Display_Height;
                GFX.Display.Format     = Current.GFX_Display_Format;
                GFX.Display.Vsync      = Current.GFX_Display_Vsync;
                GFX.Display.Fullscreen = Current.GFX_Display_Fullscreen;
                GFX.Display.SimpleMSAA = Current.GFX_Display_SimpleMSAA;
            }
        }
        static InterrootLoader()
        {
            CFG.Init();

            TexturePool.OnLoadError += TexPool_OnLoadError;
        }
예제 #6
0
 protected override void OnExiting(object sender, EventArgs args)
 {
     CFG.Save();
     base.OnExiting(sender, args);
 }