Files
wwdpublic/Content.Server/Alert/Click/AcceptingOffer.cs
Spatison c8a9002efc Add Item Transfer System (#476)
# 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>
2024-07-05 20:19:35 -04:00

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);
}
}
}