This commit is contained in:
Oscar
2025-06-10 23:24:50 +03:00
parent de85b85b13
commit 5c9be94aba
24 changed files with 1187 additions and 580 deletions

View File

@@ -0,0 +1,29 @@
using Sandbox.Gravity;
using Sasalka;
namespace Sandbox.UI;
[Icon( "skip_next" )]
public sealed class PickupItem : InteractionButton
{
[Property] public override string Label { get; set; } = "E";
public override bool Press( IPressable.Event e )
{
base.Press( e );
if ( e.Source.Components.TryGet<Dedugan>( out var dedugan ) )
{
dedugan.Inventory.AddItem( Components.Get<InventoryItem>() );
RpcDestroy();
}
return true;
}
[Rpc.Broadcast]
void RpcDestroy()
{
GameObject.Destroy();
}
}