decouple briefing from traitor (#19668)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
25
Content.Server/Roles/RoleBriefingSystem.cs
Normal file
25
Content.Server/Roles/RoleBriefingSystem.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user