Skip to content

Commit

Permalink
Add ShowDevelopmentBuildWarnings option
Browse files Browse the repository at this point in the history
  • Loading branch information
SadPencil committed Nov 27, 2024
1 parent 0152035 commit f4f7568
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ClientCore/ClientConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ public IEnumerable<string> SupplementalMapFileExtensions
/// </summary>
public bool DisallowJoiningIncompatibleGames => clientDefinitionsIni.GetBooleanValue(SETTINGS, nameof(DisallowJoiningIncompatibleGames), false);

/// <summary>
/// Activates warnings for non-release build of XNA Client
/// </summary>
public bool ShowDevelopmentBuildWarnings => clientDefinitionsIni.GetBooleanValue(SETTINGS, nameof(ShowDevelopmentBuildWarnings), true);

#endregion

#region Network definitions
Expand Down
8 changes: 5 additions & 3 deletions DXMainClient/DXGUI/GameClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ protected override void Initialize()
Window.Title = string.IsNullOrEmpty(windowTitle) ?
string.Format("{0} Client", MainClientConstants.GAME_NAME_SHORT) : windowTitle;

#if DEVELOPMENT_BUILD
{
string developBuildTitle = "(Development Build)".L10N("Client:Main:DevelopmentBuildTitle");
Window.Title += " " + developBuildTitle;
}

#if DEVELOPMENT_BUILD
if (ClientConfiguration.Instance.ShowDevelopmentBuildWarnings)
Window.Title += " " + developBuildTitle;
#endif
}

base.Initialize();

Expand Down
8 changes: 6 additions & 2 deletions DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,13 @@ private void PostUIInit()

{
string developBuildWarningMessage = "This is a development build of the client. Stability and reliability may not be fully guaranteed.".L10N("Client:Main:DevelopmentBuildWarning");

#if DEVELOPMENT_BUILD
connectionManager.MainChannel.AddMessage(new ChatMessage(Color.Red, Renderer.GetSafeString(
developBuildWarningMessage, lbChatMessages.FontIndex)));
if (ClientConfiguration.Instance.ShowDevelopmentBuildWarnings)
{
connectionManager.MainChannel.AddMessage(new ChatMessage(Color.Red, Renderer.GetSafeString(
developBuildWarningMessage, lbChatMessages.FontIndex)));
}
#endif
}

Expand Down

0 comments on commit f4f7568

Please sign in to comment.