diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 2c9eeff87c..02f87a76e5 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -482,9 +482,12 @@ namespace OpenRA Renderer.InitializeDepthBuffer(grid); Cursor?.Dispose(); - Cursor = new CursorManager(ModData.CursorProvider); + var metadata = ModData.Manifest.Metadata; + if (!string.IsNullOrEmpty(metadata.WindowTitle)) + Renderer.Window.SetWindowTitle(metadata.WindowTitle); + PerfHistory.Items["render"].HasNormalTick = false; PerfHistory.Items["batches"].HasNormalTick = false; PerfHistory.Items["render_world"].HasNormalTick = false; diff --git a/OpenRA.Game/Graphics/PlatformInterfaces.cs b/OpenRA.Game/Graphics/PlatformInterfaces.cs index 4ec2ed8107..2fbfe1d2fa 100644 --- a/OpenRA.Game/Graphics/PlatformInterfaces.cs +++ b/OpenRA.Game/Graphics/PlatformInterfaces.cs @@ -72,6 +72,7 @@ namespace OpenRA IHardwareCursor CreateHardwareCursor(string name, Size size, byte[] data, int2 hotspot, bool pixelDouble); void SetHardwareCursor(IHardwareCursor cursor); + void SetWindowTitle(string title); void SetRelativeMouseMode(bool mode); void SetScaleModifier(float scale); diff --git a/OpenRA.Game/Manifest.cs b/OpenRA.Game/Manifest.cs index 1be311b7dd..915aa32648 100644 --- a/OpenRA.Game/Manifest.cs +++ b/OpenRA.Game/Manifest.cs @@ -60,6 +60,7 @@ namespace OpenRA public string Version; public string Website; public string WebIcon32; + public string WindowTitle; public bool Hidden; } diff --git a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs index 11259f1ff3..ca4032b0ff 100644 --- a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs +++ b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs @@ -31,7 +31,7 @@ namespace OpenRA.Platforms.Default bool disposed; readonly object syncObject = new object(); - Size windowSize; + readonly Size windowSize; Size surfaceSize; float windowScale = 1f; int2? lockedMousePosition; @@ -405,6 +405,12 @@ namespace OpenRA.Platforms.Default SDL.SDL_ShowCursor((int)SDL.SDL_bool.SDL_FALSE); } + public void SetWindowTitle(string title) + { + VerifyThreadAffinity(); + SDL.SDL_SetWindowTitle(window, title); + } + public void SetRelativeMouseMode(bool mode) { if (mode) diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index eb51506252..6869d12525 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -3,6 +3,7 @@ Metadata: Version: {DEV_VERSION} Website: https://www.openra.net WebIcon32: https://www.openra.net/images/icons/cnc_32x32.png + WindowTitle: OpenRA - Tiberian Dawn PackageFormats: Mix diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 0fcff6a995..097234c5b1 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -3,6 +3,7 @@ Metadata: Version: {DEV_VERSION} Website: https://www.openra.net WebIcon32: https://www.openra.net/images/icons/d2k_32x32.png + WindowTitle: OpenRA - Dune 2000 PackageFormats: D2kSoundResources diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 0989c401ed..b46925fa21 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -3,6 +3,7 @@ Metadata: Version: {DEV_VERSION} Website: https://www.openra.net WebIcon32: https://www.openra.net/images/icons/ra_32x32.png + WindowTitle: OpenRA - Red Alert PackageFormats: Mix diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 973f8dcdb0..87b35d7e9f 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -3,6 +3,7 @@ Metadata: Version: {DEV_VERSION} Website: https://www.openra.net WebIcon32: https://www.openra.net/images/icons/ts_32x32.png + WindowTitle: OpenRA - Tiberian Sun PackageFormats: Mix