Beispiel #1
0
        /// <summary>
        /// Clears the workspace, removes and unloads the scene, cleanups up interface
        /// </summary>
        /// <returns>true if workspace is successfully cleared and false otherwise</returns>
        private bool ClearWorkspace()
        {
            if (_viewport.Scene != null)
            {
                DialogResult result = MessageBox.Show("Save current scene?", "Warning",
                                                      MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    //code for Yes
                }
                else if (result == DialogResult.No)
                {
                    //code for No
                }
                else if (result == DialogResult.Cancel)
                {
                    return(false);
                }
            }
            //TODO: save progress dialog

            ResetControls();

            MaterialEditor.Hide();
            ApplicationSettingsEditor.Hide();

            BoneTree.Nodes.Clear();
            MeshList.Items.Clear();
            Viewport.Scene = null;

            GC.Collect();
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Clears the workspace, removes and unloads the scene, cleanups up interface
        /// </summary>
        /// <returns>true if workspace is successfully cleared and false otherwise</returns>
        private bool ClearWorkspace()
        {
            if (viewportPanel.LoadedScene != null && ApplicationSettings.ShowSaveChangesPopup)
            {
                DialogResult result = MessageBox.Show("Discard current scene?", "Warning",
                                                      MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                if (result == DialogResult.OK)
                {
                }
                else if (result == DialogResult.Cancel)
                {
                    return(false);
                }
            }

            MaterialEditor.Hide();
            ApplicationSettingsEditor.Hide();

            viewportPanel.Clear();

            GC.Collect();
            return(true);
        }
Beispiel #3
0
 /// <summary>
 /// Opens the render settings menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void OpenRenderSettings(object sender, EventArgs args)
 {
     ApplicationSettingsEditor.Show();
 }