Allow mods to customize application title.
This commit is contained in:
committed by
abcdefg30
parent
3a8957c6f3
commit
f08a0b113e
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace OpenRA
|
||||
public string Version;
|
||||
public string Website;
|
||||
public string WebIcon32;
|
||||
public string WindowTitle;
|
||||
public bool Hidden;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user