Exemplo n.º 1
0
        private void openMODToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string[] modFiles = Gk3Main.FileSystem.GetFilesWithExtension("MOD");

            SceneChooser dialog = new SceneChooser();

            foreach (string model in modFiles)
            {
                dialog.AddFile(model);
            }

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (string.IsNullOrEmpty(dialog.SelectedScene) == false)
                {
                    loadInitialData();
                    Gk3Main.SceneManager.AddModel(dialog.SelectedScene, true);
                }

                // TODO: fix this!
                //IList<string> resources = Gk3Main.Resource.ResourceManager.GetLoadedResourceNames();
                //_resourceViewerForm.UpdateResources(resources);
            }
        }
Exemplo n.º 2
0
        private void openSCNToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string[] scnFiles = Gk3Main.FileSystem.GetFilesWithExtension("SCN");

            SceneChooser dialog = new SceneChooser();

            foreach (string scene in scnFiles)
            {
                dialog.AddFile(scene);
            }

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (string.IsNullOrEmpty(dialog.SelectedScene) == false)
                {
                    loadInitialData();
                    Gk3Main.SceneManager.LoadScene(dialog.SelectedScene);
                }

                IList <string> resources = Gk3Main.SceneManager.SceneContentManager.GetLoadedResourceNames();
                _resourceViewerForm.UpdateResources(resources);
            }
        }
Exemplo n.º 3
0
        private void openSifMenuItem_Click(object sender, EventArgs e)
        {
            string[] sifFiles = Gk3Main.FileSystem.GetFilesWithExtension("SIF");

            SceneChooser dialog = new SceneChooser();

            foreach (string sif in sifFiles)
            {
                dialog.AddFile(sif);
            }

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                //Gk3Main.Game.SifResource sif = null; // TODO: (Gk3Main.Game.SifResource)Gk3Main.Resource.ResourceManager.Load(dialog.SelectedScene);

                if (string.IsNullOrEmpty(dialog.SelectedScene) == false)
                {
                    loadInitialData();
                    Gk3Main.SceneManager.LoadSif(dialog.SelectedScene);

                    IList <string> resources = Gk3Main.SceneManager.SceneContentManager.GetLoadedResourceNames();
                    _resourceViewerForm.UpdateResources(resources);
                }

                //Gk3Main.SceneManager.LoadScene(sif.Scene);

                /*// load the models
                 * foreach (Gk3Main.Game.SifModel model in sif.Models)
                 * {
                 *  if (model.Type == Gk3Main.Game.SifModelType.Prop)
                 *  {
                 *      Gk3Main.SceneManager.AddModel(model.Name, !model.Hidden);
                 *  }
                 * }*/
            }
        }