Files
tbd-station-14/Content.Server/Paper/PaperSystem.cs
2022-04-08 14:17:25 -07:00

37 lines
1.1 KiB
C#

using Content.Server.UserInterface;
using Content.Shared.Examine;
using Content.Shared.Paper;
namespace Content.Server.Paper
{
public sealed class PaperSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PaperComponent, BeforeActivatableUIOpenEvent>(AfterUIOpen);
SubscribeLocalEvent<PaperComponent, ExaminedEvent>(OnExamined);
}
private void AfterUIOpen(EntityUid uid, PaperComponent component, BeforeActivatableUIOpenEvent args)
{
component.Mode = SharedPaperComponent.PaperAction.Read;
component.UpdateUserInterface();
}
private void OnExamined(EntityUid uid, PaperComponent component, ExaminedEvent args)
{
if (!args.IsInDetailsRange)
return;
if (component.Content == "")
return;
args.PushMarkup(
Loc.GetString(
"paper-component-examine-detail-has-words"
)
);
}
}
}