Exemple #1
0
        public CamView RequestCamView(string initStateTypeName = null)
        {
            CamView cam = new CamView(this.camViews.Count, initStateTypeName);

            this.camViews.Add(cam);
            cam.FormClosed += delegate(object sender, FormClosedEventArgs e) { this.camViews.Remove(sender as CamView); };

            if (!this.isLoading)
            {
                cam.Show(DualityEditorApp.MainForm.MainDockPanel);
                if (cam.Pane != null)
                {
                    cam.Pane.Activate();
                    if (cam.LocalGLControl != null)
                    {
                        cam.LocalGLControl.Focus();
                    }
                    else
                    {
                        cam.Focus();
                    }
                }
            }
            return(cam);
        }
Exemple #2
0
        private void Sandbox_Entering(object sender, EventArgs e)
        {
            CamView gameView = null;

            if (this.camViews.Count == 0)
            {
                gameView = this.RequestCamView();
                gameView.SetCurrentState(typeof(CamViewStates.GameViewCamViewState));
            }
            else
            {
                gameView = this.camViews.FirstOrDefault(v => v.ActiveState.GetType() == typeof(CamViewStates.GameViewCamViewState));
                if (gameView != null && gameView.LocalGLControl != null)
                {
                    gameView.LocalGLControl.Focus();
                }
            }
        }
        public CamView RequestCamView(string initStateTypeName = null)
        {
            CamView cam = new CamView(this.camViews.Count, initStateTypeName);
            this.camViews.Add(cam);
            cam.FormClosed += delegate(object sender, FormClosedEventArgs e) { this.camViews.Remove(sender as CamView); };

            if (!this.isLoading)
            {
                cam.Show(DualityEditorApp.MainForm.MainDockPanel);
                if (cam.Pane != null)
                {
                    cam.Pane.Activate();
                    if (cam.LocalGLControl != null)
                        cam.LocalGLControl.Focus();
                    else
                        cam.Focus();
                }
            }
            return cam;
        }