diff --git a/Content.Client/CharacterInfo/Components/CharacterInfoSystem.cs b/Content.Client/CharacterInfo/Components/CharacterInfoSystem.cs index b1f6b8c98b..965260a3a1 100644 --- a/Content.Client/CharacterInfo/Components/CharacterInfoSystem.cs +++ b/Content.Client/CharacterInfo/Components/CharacterInfoSystem.cs @@ -35,7 +35,7 @@ public class CharacterInfoSystem : EntitySystem if (!EntityManager.TryGetComponent(msg.EntityUid, out CharacterInfoComponent characterInfoComponent)) return; - UpdateUI(characterInfoComponent, msg.JobTitle, msg.Objectives); + UpdateUI(characterInfoComponent, msg.JobTitle, msg.Objectives, msg.Briefing); if (EntityManager.TryGetComponent(msg.EntityUid, out ISpriteComponent? spriteComponent)) { characterInfoComponent.Control.SpriteView.Sprite = spriteComponent; @@ -46,7 +46,7 @@ public class CharacterInfoSystem : EntitySystem characterInfoComponent.Control.NameLabel.Text = metadata.EntityName; } - private void UpdateUI(CharacterInfoComponent comp, string jobTitle, Dictionary> objectives) + private void UpdateUI(CharacterInfoComponent comp, string jobTitle, Dictionary> objectives, string briefing) { comp.Control.SubText.Text = jobTitle; @@ -93,6 +93,18 @@ public class CharacterInfoSystem : EntitySystem ); vbox.AddChild(hbox); } + var briefinghBox = new BoxContainer + { + Orientation = BoxContainer.LayoutOrientation.Horizontal + }; + + briefinghBox.AddChild(new Label + { + Text = briefing, + Modulate = Color.Yellow + }); + + vbox.AddChild(briefinghBox); comp.Control.ObjectivesContainer.AddChild(vbox); } } diff --git a/Content.Server/CharacterInfo/CharacterInfoSystem.cs b/Content.Server/CharacterInfo/CharacterInfoSystem.cs index a8047d8792..f1f3b7613e 100644 --- a/Content.Server/CharacterInfo/CharacterInfoSystem.cs +++ b/Content.Server/CharacterInfo/CharacterInfoSystem.cs @@ -27,6 +27,7 @@ public class CharacterInfoSystem : EntitySystem var conditions = new Dictionary>(); var jobTitle = "No Profession"; + var briefing = "!!ERROR: No Briefing!!"; //should never show on the UI unless there's a bug if (EntityManager.TryGetComponent(entity, out MindComponent? mindComponent) && mindComponent.Mind != null) { var mind = mindComponent.Mind; @@ -51,9 +52,12 @@ public class CharacterInfoSystem : EntitySystem jobTitle = role.Name; break; } + + // Get briefing + briefing = mind.Briefing; } - RaiseNetworkEvent(new CharacterInfoEvent(entity, jobTitle, conditions), + RaiseNetworkEvent(new CharacterInfoEvent(entity, jobTitle, conditions, briefing), Filter.SinglePlayer(args.SenderSession)); } } diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index cb089c5f07..e5c78e4b07 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -186,6 +186,9 @@ public class TraitorRuleSystem : GameRuleSystem if (traitor.Mind.TryAddObjective(objective)) difficulty += objective.Difficulty; } + + //give traitors their codewords to keep in their character info menu + traitor.Mind.Briefing = Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ",codewords))); } SoundSystem.Play(Filter.Empty().AddWhere(s => ((IPlayerSession)s).Data.ContentData()?.Mind?.HasRole() ?? false), _addedSound.GetSound(), AudioParams.Default); diff --git a/Content.Server/Mind/Mind.cs b/Content.Server/Mind/Mind.cs index bdf7d29d45..77a9004ab7 100644 --- a/Content.Server/Mind/Mind.cs +++ b/Content.Server/Mind/Mind.cs @@ -35,6 +35,8 @@ namespace Content.Server.Mind private readonly ISet _roles = new HashSet(); private readonly List _objectives = new(); + + public string Briefing = String.Empty; /// /// Creates the new mind. diff --git a/Content.Shared/CharacterInfo/SharedCharacterInfoSystem.cs b/Content.Shared/CharacterInfo/SharedCharacterInfoSystem.cs index d887c6ac22..693f56284f 100644 --- a/Content.Shared/CharacterInfo/SharedCharacterInfoSystem.cs +++ b/Content.Shared/CharacterInfo/SharedCharacterInfoSystem.cs @@ -23,11 +23,13 @@ public class CharacterInfoEvent : EntityEventArgs public readonly EntityUid EntityUid; public readonly string JobTitle; public readonly Dictionary> Objectives; + public readonly string Briefing; - public CharacterInfoEvent(EntityUid entityUid, string jobTitle, Dictionary> objectives) + public CharacterInfoEvent(EntityUid entityUid, string jobTitle, Dictionary> objectives, string briefing) { EntityUid = entityUid; JobTitle = jobTitle; Objectives = objectives; + Briefing = briefing; } }