Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose GameTitle, WindowIconSet and SplashLogo to content #5475

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ END TEMPLATE-->
### New features

* `RequiredMemberAttribute` and `SetsRequiredMembersAttribute` have been added to the sandbox whitelist. I.e., you can now use the `required` keyword in client/shared code.
* ``Gametitle`` is exposed in IGameController. This will return a game title set within set game options or the whatever is set in manifest.yml.

### Bugfixes

Expand Down
8 changes: 6 additions & 2 deletions Robust.Client/GameController/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ public void SetCommandLineArgs(CommandLineArgs args)
_commandLineArgs = args;
}

public string GameTitle()
{
return Options.DefaultWindowTitle ?? _resourceManifest!.DefaultWindowTitle ?? "RobustToolbox";
}

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();
Expand Down
6 changes: 6 additions & 0 deletions Robust.Client/IGameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@ public interface IGameController
/// This exists to give content module more control over tick updating.
/// </summary>
event Action<FrameEventArgs>? TickUpdateOverride;


/// <summary>
/// Get the games title, if Options.DefaultWindowTitle or if DefaultWindowTitle is not set in the manifest.yml, it will default to RobustToolbox.
/// </summary>
string GameTitle();
}

5 changes: 5 additions & 0 deletions Robust.UnitTesting/GameControllerDummy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@ public void MouseWheel(MouseWheelEventArgs mouseWheelEventArgs)
public void OverrideMainLoop(IGameLoop gameLoop)
{
}

public string GameTitle()
{
return "RobustToolbox";
}
}
}
Loading