diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 47cb3fad6..baf384dd3 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -41,6 +41,7 @@ END TEMPLATE--> * `RequiredMemberAttribute` and `SetsRequiredMembersAttribute` have been added to the sandbox whitelist. I.e., you can now use the `required` keyword in client/shared code. * Added `LineEdit.SelectAllOnFocus`. +* ``Gametitle``,``WindowIconSet`` and ``SplashLogo`` are exposed in IGameController. These will return said information set game options or whatever is set in manifest.yml. ### Bugfixes diff --git a/Robust.Client/GameController/GameController.cs b/Robust.Client/GameController/GameController.cs index bd162b653..4116fb52c 100644 --- a/Robust.Client/GameController/GameController.cs +++ b/Robust.Client/GameController/GameController.cs @@ -112,14 +112,28 @@ namespace Robust.Client _commandLineArgs = args; } + public string GameTitle() + { + return Options.DefaultWindowTitle ?? _resourceManifest!.DefaultWindowTitle ?? "RobustToolbox"; + } + + public string WindowIconSet() + { + return Options.WindowIconSet?.ToString() ?? _resourceManifest!.WindowIconSet ?? ""; + } + + public string SplashLogo() + { + return Options.SplashLogo?.ToString() ?? _resourceManifest!.SplashLogo ?? ""; + } + internal bool StartupContinue(DisplayMode displayMode) { DebugTools.AssertNotNull(_resourceManifest); _clyde.InitializePostWindowing(); _audio.InitializePostWindowing(); - _clyde.SetWindowTitle( - Options.DefaultWindowTitle ?? _resourceManifest!.DefaultWindowTitle ?? "RobustToolbox"); + _clyde.SetWindowTitle(GameTitle()); _taskManager.Initialize(); _parallelMgr.Initialize(); @@ -399,10 +413,8 @@ namespace Robust.Client // Handle GameControllerOptions implicit CVar overrides. _configurationManager.OverrideConVars(new[] { - (CVars.DisplayWindowIconSet.Name, - options.WindowIconSet?.ToString() ?? _resourceManifest.WindowIconSet ?? ""), - (CVars.DisplaySplashLogo.Name, - options.SplashLogo?.ToString() ?? _resourceManifest.SplashLogo ?? "") + (CVars.DisplayWindowIconSet.Name, WindowIconSet()), + (CVars.DisplaySplashLogo.Name, SplashLogo()) }); } diff --git a/Robust.Client/IGameController.cs b/Robust.Client/IGameController.cs index ee3190622..1212e26a6 100644 --- a/Robust.Client/IGameController.cs +++ b/Robust.Client/IGameController.cs @@ -26,5 +26,20 @@ public interface IGameController /// This exists to give content module more control over tick updating. /// event Action? TickUpdateOverride; + + /// + /// Get the games Title, if Options.DefaultWindowTitle or if defaultWindowTitle is not set in the manifest.yml, it will default to RobustToolbox. + /// + string GameTitle(); + + /// + /// Get the games Window Icon set, if Options.WindowIconSet or if windowIconSet is not set in the manifest.yml, it will default to an empty string. + /// + string WindowIconSet(); + + /// + /// Get the games Splash Logo, if Options.SplashLogo or if splashLogo is not set in the manifest.yml, it will default to an empty string. + /// + string SplashLogo(); } diff --git a/Robust.UnitTesting/GameControllerDummy.cs b/Robust.UnitTesting/GameControllerDummy.cs index a29ac8ae1..67c945e1a 100644 --- a/Robust.UnitTesting/GameControllerDummy.cs +++ b/Robust.UnitTesting/GameControllerDummy.cs @@ -66,5 +66,20 @@ namespace Robust.UnitTesting public void OverrideMainLoop(IGameLoop gameLoop) { } + + public string GameTitle() + { + return "RobustToolbox"; + } + + public string WindowIconSet() + { + return ""; + } + + public string SplashLogo() + { + return ""; + } } }