Forensics (#8451)
* Port forensics from nyanotrasen * port updates * printing * Update Resources/Locale/en-US/forensics/forensics.ftl Co-authored-by: Veritius <veritiusgaming@gmail.com> * Update Content.Server/Forensics/Components/ForensicPadComponent.cs Co-authored-by: Kara <lunarautomaton6@gmail.com> * Update Content.Server/Forensics/Systems/ForensicPadSystem.cs Co-authored-by: Kara <lunarautomaton6@gmail.com> * Update Content.Server/Forensics/Systems/ForensicScannerSystem.cs Co-authored-by: Kara <lunarautomaton6@gmail.com> * partially address reviews * comments * redo the events * handle it * rewrite loc * master fixes Co-authored-by: ike709 <ike709@github.com> Co-authored-by: Veritius <veritiusgaming@gmail.com> Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -75,6 +75,9 @@ namespace Content.Shared.ActionBlocker
|
||||
var targetEv = new GettingInteractedWithAttemptEvent(user, target);
|
||||
RaiseLocalEvent(target.Value, targetEv, true);
|
||||
|
||||
if (!targetEv.Cancelled)
|
||||
InteractWithItem(user, target.Value);
|
||||
|
||||
return !targetEv.Cancelled;
|
||||
}
|
||||
|
||||
@@ -128,6 +131,10 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
var itemEv = new GettingPickedUpAttemptEvent(user, item);
|
||||
RaiseLocalEvent(item, itemEv, false);
|
||||
|
||||
if (!itemEv.Cancelled)
|
||||
InteractWithItem(user, item);
|
||||
|
||||
return !itemEv.Cancelled;
|
||||
|
||||
}
|
||||
@@ -171,5 +178,11 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
private void InteractWithItem(EntityUid user, EntityUid item)
|
||||
{
|
||||
var itemEvent = new UserInteractedWithItemEvent(user, item);
|
||||
RaiseLocalEvent(user, itemEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
Content.Shared/Forensics/ForensicScannerEvent.cs
Normal file
28
Content.Shared/Forensics/ForensicScannerEvent.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Forensics
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ForensicScannerUserMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly List<string> Fingerprints = new();
|
||||
public readonly List<string> Fibers = new();
|
||||
|
||||
public ForensicScannerUserMessage(List<string> fingerprints, List<string> fibers)
|
||||
{
|
||||
Fingerprints = fingerprints;
|
||||
Fibers = fibers;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum ForensicScannerUiKey : byte
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ForensicScannerPrintMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
17
Content.Shared/Item/UserInteractedWithItemEvent.cs
Normal file
17
Content.Shared/Item/UserInteractedWithItemEvent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Content.Shared.Item;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on the user after they do any sort of interaction with an item,
|
||||
/// useful for when you want a component on the user to do something to the item.
|
||||
/// E.g. forensics, disease, etc.
|
||||
/// </summary>
|
||||
public sealed class UserInteractedWithItemEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid User;
|
||||
public EntityUid Item;
|
||||
public UserInteractedWithItemEvent(EntityUid user, EntityUid item)
|
||||
{
|
||||
User = user;
|
||||
Item = item;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user