Add engine version in Editor main window title

#1847
This commit is contained in:
Wojtek Figat
2023-11-07 00:13:13 +01:00
parent a685918e10
commit 42e8311736

View File

@@ -171,9 +171,13 @@ namespace FlaxEditor.Modules
var mainWindow = MainWindow; var mainWindow = MainWindow;
if (mainWindow) if (mainWindow)
{ {
var projectPath = Globals.ProjectFolder.Replace('/', '\\'); var projectPath = Globals.ProjectFolder;
var platformBit = Platform.Is64BitApp ? "64" : "32"; #if PLATFORM_WINDOWS
var title = string.Format("Flax Editor - \'{0}\' ({1}-bit)", projectPath, platformBit); projectPath = projectPath.Replace('/', '\\');
#endif
var engineVersion = Editor.EngineProject.Version;
var engineVersionText = engineVersion.Revision > 0 ? $"{engineVersion.Major}.{engineVersion.Minor}.{engineVersion.Revision}" : $"{engineVersion.Major}.{engineVersion.Minor}";
var title = $"Flax Editor {engineVersionText} - \'{projectPath}\'";
mainWindow.Title = title; mainWindow.Title = title;
} }
} }
@@ -735,7 +739,6 @@ namespace FlaxEditor.Modules
settings.Size = Platform.DesktopSize * 0.75f; settings.Size = Platform.DesktopSize * 0.75f;
settings.StartPosition = WindowStartPosition.CenterScreen; settings.StartPosition = WindowStartPosition.CenterScreen;
settings.ShowAfterFirstPaint = true; settings.ShowAfterFirstPaint = true;
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
if (!Editor.Instance.Options.Options.Interface.UseNativeWindowSystem) if (!Editor.Instance.Options.Options.Interface.UseNativeWindowSystem)
{ {
@@ -747,12 +750,9 @@ namespace FlaxEditor.Modules
#elif PLATFORM_LINUX #elif PLATFORM_LINUX
settings.HasBorder = false; settings.HasBorder = false;
#endif #endif
MainWindow = Platform.CreateWindow(ref settings); MainWindow = Platform.CreateWindow(ref settings);
if (MainWindow == null) if (MainWindow == null)
{ {
// Error
Editor.LogError("Failed to create editor main window!"); Editor.LogError("Failed to create editor main window!");
return; return;
} }