Exemplo n.º 1
0
        internal void Update()
        {
            bool updateUI = false;

            if (!sceneCommand.Executed)
            {
                switch (sceneCommand.CommandType)
                {
                case SceneEditorCommandType.NO_COMMAND:
                    break;

                case SceneEditorCommandType.NEW_SCENE:
                    currentScene = instance.SceneEditorInstance.NewScene();
                    updateUI     = true;
                    break;

                case SceneEditorCommandType.OPEN_SCENE:
                    currentScene = instance.SceneEditorInstance.OpenScene(sceneCommand.ScenePath);
                    updateUI     = true;
                    break;

                case SceneEditorCommandType.SAVE_SCENE:
                    instance.SceneEditorInstance.SaveScene(sceneCommand.ScenePath);
                    updateUI = true;
                    break;

                default:
                    Console.WriteLine("WARN: Invalid SceneCommandType");
                    break;
                }

                sceneCommand.Executed = true;
            }

            if (updateUI)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    foreach (Window window in Application.Current.Windows)
                    {
                        if (window.GetType() == typeof(MainWindow))
                        {
                            window.Title = OnyxMenuHeader.GetHeaderText();
                            //update scene graph
                            ((MainWindow)window).SceneGraph.UpdateSceneGraph();
                        }
                    }
                });
            }
        }
Exemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     this.Title = OnyxMenuHeader.GetHeaderText();
 }