Ejemplo n.º 1
0
        public void OpenFileFromWorkingDir(string workDir, bool surpressMRU = false)
        {
            //Iterate through the sub folders (dzb, dzr, bdl, etc.) and construct an appropriate data
            //structure for each one out of it. Then stick them all in a WorldspaceProject and save that
            //into our list of open projects. Then we can operate out of the WorldspaceProject references
            //and save and stuff.

            //Scan loaded projects to make sure we haven't already loaded it.
            if (_loadedWorldspaceProject != null)
            {
                Console.WriteLine("Trying to open new worldspacedir while one is open. Unloading!");
                UnloadLoadedWorldspaceProject();
            }
            toolStripStatusLabel1.Text                       = "Loading Worldspace Project...";
            saveAllToolStripMenuItem.Enabled                 = true;
            exportArchivesToolStripMenuItem.Enabled          = true;
            unloadWorldspaceProjectToolStripMenuItem.Enabled = true;

            _loadedWorldspaceProject = new WorldspaceProject();
            _loadedWorldspaceProject.LoadFromDirectory(workDir);

            UpdateProjectFolderTreeview();

            if (!surpressMRU)
            {
                _mruMenu.AddFile(_loadedWorldspaceProject.ProjectFilePath);
            }

            if (WorldspaceProjectLoaded != null)
            {
                WorldspaceProjectLoaded(_loadedWorldspaceProject);
            }
        }
Ejemplo n.º 2
0
        public void OpenFileFromWorkingDir(string workDir, bool surpressMRU = false)
        {
            //Iterate through the sub folders (dzb, dzr, bdl, etc.) and construct an appropriate data
            //structure for each one out of it. Then stick them all in a WorldspaceProject and save that
            //into our list of open projects. Then we can operate out of the WorldspaceProject references
            //and save and stuff.

            //Scan loaded projects to make sure we haven't already loaded it.
            if (_loadedWorldspaceProject != null)
            {
                Console.WriteLine("Trying to open new worldspacedir while one is open. Unloading!");
                UnloadLoadedWorldspaceProject();
            }
            toolStripStatusLabel1.Text = "Loading Worldspace Project...";
            saveAllToolStripMenuItem.Enabled = true;
            exportArchivesToolStripMenuItem.Enabled = true;
            unloadWorldspaceProjectToolStripMenuItem.Enabled = true;

            _loadedWorldspaceProject = new WorldspaceProject();
            _loadedWorldspaceProject.LoadFromDirectory(workDir);

            UpdateProjectFolderTreeview();

            if (!surpressMRU)
                _mruMenu.AddFile(_loadedWorldspaceProject.ProjectFilePath);

            if (WorldspaceProjectLoaded != null)
                WorldspaceProjectLoaded(_loadedWorldspaceProject);
        }