Literally Murder IExamine (#7352)

This commit is contained in:
Rane
2022-04-08 17:17:25 -04:00
committed by GitHub
parent 427f7378c3
commit 7900abb888
27 changed files with 372 additions and 469 deletions

View File

@@ -1,4 +1,5 @@
using Content.Server.UserInterface;
using Content.Shared.Examine;
using Content.Shared.Paper;
namespace Content.Server.Paper
@@ -9,6 +10,7 @@ namespace Content.Server.Paper
{
base.Initialize();
SubscribeLocalEvent<PaperComponent, BeforeActivatableUIOpenEvent>(AfterUIOpen);
SubscribeLocalEvent<PaperComponent, ExaminedEvent>(OnExamined);
}
private void AfterUIOpen(EntityUid uid, PaperComponent component, BeforeActivatableUIOpenEvent args)
@@ -16,5 +18,19 @@ namespace Content.Server.Paper
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"
)
);
}
}
}