diff --git a/Content.Server/Objectives/ObjectivesSystem.cs b/Content.Server/Objectives/ObjectivesSystem.cs index 73bb74d524..7a995bd5cb 100644 --- a/Content.Server/Objectives/ObjectivesSystem.cs +++ b/Content.Server/Objectives/ObjectivesSystem.cs @@ -12,9 +12,11 @@ using Robust.Shared.Random; using System.Linq; using System.Text; using Content.Server.Objectives.Commands; +using Content.Shared.CCVar; using Content.Shared.Prototypes; using Content.Shared.Roles.Jobs; using Robust.Server.Player; +using Robust.Shared.Configuration; using Robust.Shared.Utility; namespace Content.Server.Objectives; @@ -27,15 +29,20 @@ public sealed class ObjectivesSystem : SharedObjectivesSystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!; [Dependency] private readonly SharedJobSystem _job = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; private IEnumerable? _objectives; + private bool _showGreentext; + public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnRoundEndText); + Subs.CVar(_cfg, CCVars.GameShowGreentext, value => _showGreentext = value, true); + _prototypeManager.PrototypesReloaded += CreateCompletions; } @@ -162,7 +169,11 @@ public sealed class ObjectivesSystem : SharedObjectivesSystem totalObjectives++; agentSummary.Append("- "); - if (progress > 0.99f) + if (!_showGreentext) + { + agentSummary.AppendLine(objectiveTitle); + } + else if (progress > 0.99f) { agentSummary.AppendLine(Loc.GetString( "objectives-objective-success", diff --git a/Content.Shared/CCVar/CCVars.Game.cs b/Content.Shared/CCVar/CCVars.Game.cs index 13e72b9e3c..a316577fc1 100644 --- a/Content.Shared/CCVar/CCVars.Game.cs +++ b/Content.Shared/CCVar/CCVars.Game.cs @@ -53,6 +53,12 @@ public sealed partial class CCVars public static readonly CVarDef GameLobbyEnableWin = CVarDef.Create("game.enablewin", true, CVar.ARCHIVE); + /// + /// Controls if round-end window shows whether the objective was completed or not. + /// + public static readonly CVarDef + GameShowGreentext = CVarDef.Create("game.showgreentext", true, CVar.ARCHIVE | CVar.SERVERONLY); + /// /// Controls the maximum number of character slots a player is allowed to have. ///