mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# Description This PR adds the ability to transfer objects from one player's hand to another player's hand, as in SS13. I have little coding experience, so my solutions may not be ideal. --- # TODO - [x] Make the code work - [x] Add popup - [x] Write a summary of the code - [x] Сorrect inaccuracies <details><summary><h1>Media</h1></summary> <p> https://youtu.be/zTQWTsYm1gw </p> </details> --- # Changelog 🆑 - add: Added system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------- Co-authored-by: Danger Revolution! <142105406+DangerRevolution@users.noreply.github.com>
25 lines
626 B
C#
25 lines
626 B
C#
using Content.Shared.OfferItem;
|
|
using Content.Server.OfferItem;
|
|
using Content.Shared.Alert;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace Content.Server.Alert.Click;
|
|
|
|
/// <summary>
|
|
/// Accepting the offer and receive item
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
[DataDefinition]
|
|
public sealed partial class AcceptOffer : IAlertClick
|
|
{
|
|
public void AlertClicked(EntityUid player)
|
|
{
|
|
var entManager = IoCManager.Resolve<IEntityManager>();
|
|
|
|
if (entManager.TryGetComponent(player, out OfferItemComponent? offerItem))
|
|
{
|
|
entManager.System<OfferItemSystem>().Receive(player, offerItem);
|
|
}
|
|
}
|
|
}
|