mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
Co-authored-by: Simon <63975668+Simyon264@users.noreply.github.com>
21 lines
625 B
C#
21 lines
625 B
C#
namespace Content.Shared.Paper;
|
|
|
|
/// <summary>
|
|
/// A system that prevents those with the IlliterateComponent from writing on paper.
|
|
/// Has no effect on reading ability.
|
|
/// </summary>
|
|
public sealed class BlockWritingSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<BlockWritingComponent, PaperWriteAttemptEvent>(OnPaperWriteAttempt);
|
|
}
|
|
|
|
private void OnPaperWriteAttempt(Entity<BlockWritingComponent> entity, ref PaperWriteAttemptEvent args)
|
|
{
|
|
args.FailReason = entity.Comp.FailWriteMessage;
|
|
args.Cancelled = true;
|
|
}
|
|
}
|