Literally Murder IExamine (#7352)
This commit is contained in:
@@ -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"
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user