decouple briefing from traitor (#19668)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-08-31 22:29:45 +01:00
committed by GitHub
parent 31282a3fc6
commit 7842f0d055
9 changed files with 70 additions and 14 deletions

View File

@@ -0,0 +1,25 @@
namespace Content.Server.Roles;
public sealed class RoleBriefingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoleBriefingComponent, GetBriefingEvent>(OnGetBriefing);
}
private void OnGetBriefing(EntityUid uid, RoleBriefingComponent comp, ref GetBriefingEvent args)
{
if (args.Briefing == null)
{
// no previous briefing so just set it
args.Briefing = comp.Briefing;
}
else
{
// there is a previous briefing so append to it
args.Briefing += "\n" + comp.Briefing;
}
}
}