()
| 756 | |
| 757 | /// <inheritdoc /> |
| 758 | public override void OnInit() |
| 759 | { |
| 760 | Assert.IsNull(MainWindow); |
| 761 | |
| 762 | _windowsLayoutPath = StringUtils.CombinePaths(Globals.ProjectCacheFolder, "WindowsLayout.xml"); |
| 763 | |
| 764 | if (!Editor.IsHeadlessMode) |
| 765 | { |
| 766 | // Create main window |
| 767 | var settings = CreateWindowSettings.Default; |
| 768 | settings.Title = "Flax Editor"; |
| 769 | settings.Size = Platform.DesktopSize * 0.75f; |
| 770 | settings.MinimumSize = new Float2(200, 150); |
| 771 | settings.StartPosition = WindowStartPosition.CenterScreen; |
| 772 | settings.ShowAfterFirstPaint = true; |
| 773 | |
| 774 | if (Utilities.Utils.UseCustomWindowDecorations(isMainWindow: true)) |
| 775 | { |
| 776 | settings.HasBorder = false; |
| 777 | #if PLATFORM_WINDOWS && !PLATFORM_SDL |
| 778 | // Skip OS sizing frame and implement it using LeftButtonHit |
| 779 | settings.HasSizingFrame = false; |
| 780 | #endif |
| 781 | } |
| 782 | #if PLATFORM_LINUX && !PLATFORM_SDL |
| 783 | settings.HasBorder = false; |
| 784 | #endif |
| 785 | MainWindow = Platform.CreateWindow(ref settings); |
| 786 | if (MainWindow == null) |
| 787 | { |
| 788 | Editor.LogError("Failed to create editor main window!"); |
| 789 | return; |
| 790 | } |
| 791 | UpdateWindowTitle(); |
| 792 | |
| 793 | // Link for main window events |
| 794 | MainWindow.Closing += MainWindow_OnClosing; |
| 795 | MainWindow.Closed += MainWindow_OnClosed; |
| 796 | } |
| 797 | |
| 798 | // Create default editor windows |
| 799 | ContentWin = new ContentWindow(Editor); |
| 800 | EditWin = new EditGameWindow(Editor); |
| 801 | GameWin = new GameWindow(Editor); |
| 802 | PropertiesWin = new PropertiesWindow(Editor); |
| 803 | SceneWin = new SceneTreeWindow(Editor); |
| 804 | DebugLogWin = new DebugLogWindow(Editor); |
| 805 | OutputLogWin = new OutputLogWindow(Editor); |
| 806 | ToolboxWin = new ToolboxWindow(Editor); |
| 807 | GraphicsQualityWin = new GraphicsQualityWindow(Editor); |
| 808 | GameCookerWin = new GameCookerWindow(Editor); |
| 809 | ProfilerWin = new ProfilerWindow(Editor); |
| 810 | EditorOptionsWin = new EditorOptionsWindow(Editor); |
| 811 | PluginsWin = new PluginsWindow(Editor); |
| 812 | VisualScriptDebuggerWin = new VisualScriptDebuggerWindow(Editor); |
| 813 | |
| 814 | // Bind events |
| 815 | Level.SceneSaveError += OnSceneSaveError; |
no test coverage detected