AdminLogOnTrigger (#41474)
* commit * requested * also requested * Update Content.Shared/Trigger/Components/Effects/AdminLogOnTriggerComponent.cs --------- Co-authored-by: iaada <iaada@users.noreply.github.com> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
19
Content.Shared/Trigger/Systems/AdminLogOnTriggerSystem.cs
Normal file
19
Content.Shared/Trigger/Systems/AdminLogOnTriggerSystem.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Trigger.Components.Effects;
|
||||
|
||||
namespace Content.Shared.Trigger.Systems;
|
||||
|
||||
public sealed class AdminLogOnTriggerSystem : XOnTriggerSystem<AdminLogOnTriggerComponent>
|
||||
{
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
|
||||
protected override void OnTrigger(Entity<AdminLogOnTriggerComponent> ent, EntityUid target, ref TriggerEvent args)
|
||||
{
|
||||
_adminLogger.Add(
|
||||
ent.Comp.LogType,
|
||||
ent.Comp.LogImpact,
|
||||
$"{ToPrettyString(args.User)} sent a trigger using {ToPrettyString(ent)}: {Loc.GetString(ent.Comp.Message)}"
|
||||
);
|
||||
// Intentionally does not handle the event since this shouldn't affect the gamestate.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user