Ejemplo n.º 1
0
        private void OpenStartupDialog()
        {
            // Create startup dialog
              StartupDlg startupDlg = new StartupDlg();

              // Set MRU list of the to dialog
              mruList_RecentProjects.BuildItemDictionary(startupDlg.RecentProjects);
              mruList_RecentScenes.BuildItemDictionary(startupDlg.RecentScenes);

              // Startup Guide and Startup Project
              string startupGuideDirectory = FileHelper.ResolveFilename(Application.StartupPath + "\\..\\..\\..\\..\\Docs\\Vision\\windows\\VisionEngine_StartupGuide.CHM");
              string startupProject = FileHelper.ResolveFilename(Application.StartupPath + "\\..\\..\\..\\..\\Docs\\Vision\\StartupGuide\\Assets\\Startup_Tutorial.project");
              string sampleDirectory = FileHelper.ResolveFilename(Application.StartupPath + "\\..\\..\\..\\..\\Data\\Vision\\Samples\\Engine\\Maps");

              // Show open file dialog
              startupDlg.ShowDialog();

              // Get dialog result
              StartupDlg.StartupResult_e result = startupDlg.StartupDialogResult;
              switch (result)
              {
            case StartupDlg.StartupResult_e.CreateNewProject:
              {
            Menu_File_New_Project_Click(null, EventArgs.Empty);
              }
              break;
            case StartupDlg.StartupResult_e.OpenProject:
              {
            Menu_File_OpenProject_Click(null, EventArgs.Empty);
              }
              break;
            case StartupDlg.StartupResult_e.OpenScene:
              {
            if (EditorManager.Project != null)
              Menu_File_CloseProject_Click(null, EventArgs.Empty);
            Menu_File_OpenScene_Click(null, EventArgs.Empty);
              }
              break;
            case StartupDlg.StartupResult_e.OpenRecentProject:
              {
            //Make sure the current scene is saved
            if (EditorApp.PromptSaveScene() == DialogResult.Cancel)
              return;
            LoadProject(startupDlg.SelectedFile, true);
              }
              break;
            case StartupDlg.StartupResult_e.OpenRecentScene:
              {
            //Make sure the current scene is saved
            if (EditorApp.PromptSaveScene() == DialogResult.Cancel)
              return;
            LoadScene(startupDlg.SelectedFile, true);
              }
              break;
            case StartupDlg.StartupResult_e.LoadStartupGuide:
              {
            if (System.IO.File.Exists(startupGuideDirectory))
              Process.Start(startupGuideDirectory);
            else
              EditorManager.ShowMessageBox(this, "The Startup Guide could not be found at the predefined location (\"" +  startupGuideDirectory + "\"). Please make sure the Vison SDK is installed properly.", "Loading Startup Guide Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
              }
              break;
            case StartupDlg.StartupResult_e.LoadStartupProject:
              {
            if (System.IO.File.Exists(startupProject))
              LoadProject(startupProject, true);
            else
              EditorManager.ShowMessageBox(this, "The Startup Project could not be found at the predefined location. Please make sure the Vison SDK is installed properly.", "Loading Startup Project Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
              }
              break;
            case StartupDlg.StartupResult_e.OpenSampleMap:
              {
            if (System.IO.Directory.Exists(sampleDirectory))
              OpenProjectDialog(sampleDirectory);
            else
              EditorManager.ShowMessageBox(this, "The Engine Sample Map directory could not be found at the predefined location. Please make sure the Vison Engine Samples are installed.", "Loading Engine Sample Maps Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
              }
              break;
            case StartupDlg.StartupResult_e.Close:
            default:
              break;
              }
        }
Ejemplo n.º 2
0
        private void OpenStartupDialog()
        {
            // Create startup dialog
              StartupDlg startupDlg = new StartupDlg();

              // Set MRU list of the to dialog
              mruList_RecentProjects.BuildItemDictionary(startupDlg.RecentProjects);
              mruList_RecentScenes.BuildItemDictionary(startupDlg.RecentScenes);

              // Startup Guide and Startup Project
              string startupGuideDirectory = FileHelper.ResolveFilename(Application.StartupPath + "\\..\\..\\..\\..\\Docs\\Vision\\windows\\VisionEngine_StartupGuide.CHM");
              string startupProject = FileHelper.ResolveFilename(Application.StartupPath + "\\..\\..\\..\\..\\Docs\\Vision\\StartupGuide\\Assets\\Startup_Tutorial.project");
              string sampleDirectory = FileHelper.ResolveFilename(Application.StartupPath + "\\..\\..\\..\\..\\Data\\Vision\\Samples\\Engine\\Maps");

              // Show open file dialog
              startupDlg.ShowDialog();

              // Get dialog result
              StartupDlg.StartupResult_e result = startupDlg.StartupDialogResult;
              switch (result)
              {
            case StartupDlg.StartupResult_e.CreateNewProject:
              {
            Menu_File_New_Project_Click(null, EventArgs.Empty);
              }
              break;
            case StartupDlg.StartupResult_e.OpenProject:
              {
            Menu_File_OpenProject_Click(null, EventArgs.Empty);
              }
              break;
            case StartupDlg.StartupResult_e.OpenScene:
              {
            if (EditorManager.Project != null)
              Menu_File_CloseProject_Click(null, EventArgs.Empty);
            Menu_File_OpenScene_Click(null, EventArgs.Empty);
              }
              break;
            case StartupDlg.StartupResult_e.OpenRecentProject:
              {
            //Make sure the current scene is saved
            if (EditorApp.PromptSaveScene() == DialogResult.Cancel)
              return;
            LoadProject(startupDlg.SelectedFile, true);
              }
              break;
            case StartupDlg.StartupResult_e.OpenRecentScene:
              {
            //Make sure the current scene is saved
            if (EditorApp.PromptSaveScene() == DialogResult.Cancel)
              return;
            LoadScene(startupDlg.SelectedFile, true);
              }
              break;
            case StartupDlg.StartupResult_e.LoadStartupGuide:
              {
            if (System.IO.File.Exists(startupGuideDirectory))
              Process.Start(startupGuideDirectory);
            else
            {
              if (TestManager.Helpers.TestDataDirExists)
                EditorManager.ShowMessageBox(this, "The Startup Guide is only available in the installed SDK.", "Loading Startup Guide Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
              else
                EditorManager.ShowMessageBox(this, "The Startup Guide could not be found at the predefined location (\"" + startupGuideDirectory + "\"). Please make sure the Vision SDK is installed properly.", "Loading Startup Guide Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
              }
              break;
            case StartupDlg.StartupResult_e.LoadStartupProject:
              {
            if (System.IO.File.Exists(startupProject))
            {
              LoadProject(startupProject, true);
            }
            else
            {
              if (TestManager.Helpers.TestDataDirExists)
              {
                EditorManager.ShowMessageBox(this, "The Startup Project is located in a different directory within the repository to avoid people accidentally modifying it. If you need to modify the Startup Project you can find it in 'Docs/Vision/Documentation/StartupGuide/Startup_Tutorial_Project/Assets'", "Loading Startup Project Disallowed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
              }
              else
              {
            #if HK_ANARCHY
                EditorManager.ShowMessageBox(this, "The Startup Project could not be found at the predefined location. Please run the Anarchy Download Manager, select to download and install the 'Startup Guide Assets' and try again.", "Loading Startup Project Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            #else
                string sStartupGuideAssets;
                try
                {
                  string sProductVersion = Application.ProductVersion;
                  string[] parts = sProductVersion.Split('.');
                  sStartupGuideAssets = string.Format("'Havok_Vision_StartupGuideAssets_{0}_{1}_{2}.zip'", parts[0], parts[1], parts[2]);
                }
                catch
                {
                  sStartupGuideAssets = "'Startup Guide Assets'";
                }

                EditorManager.ShowMessageBox(this, "The Startup Project could not be found at the predefined location. Please download the " + sStartupGuideAssets + " from the Havok download center, extract it to the root of the SDK and try again.", "Loading Startup Project Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            #endif
              }
            }
              }
              break;
            case StartupDlg.StartupResult_e.OpenSampleMap:
              {
            if (System.IO.Directory.Exists(sampleDirectory))
              OpenProjectDialog(sampleDirectory);
            else
              EditorManager.ShowMessageBox(this, "The Engine Sample Map directory could not be found at the predefined location. Please make sure the Vison Engine Samples are installed.", "Loading Engine Sample Maps Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
              }
              break;
            case StartupDlg.StartupResult_e.Close:
            default:
              break;
              }
        }