]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove drag & drop dropping items from containers (#32706)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Wed, 20 Nov 2024 01:00:38 +0000 (02:00 +0100)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 01:00:38 +0000 (12:00 +1100)
* Initial commit

* Update based on maintainer discussion

* Forgot to remove this woops

Content.Client/UserInterface/Systems/Storage/StorageUIController.cs
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Content.Shared/Storage/StorageComponent.cs

index 97c9d8b7959976331faae5b12841cf3042120e5b..1e61ad9838066fb24d8bea4d0100dc48d07b7e49 100644 (file)
@@ -307,12 +307,6 @@ public sealed class StorageUIController : UIController, IOnSystemChanged<Storage
                     _entity.GetNetEntity(storageEnt),
                     new ItemStorageLocation(DraggingRotation, position)));
             }
-            else
-            {
-                _entity.RaisePredictiveEvent(new StorageRemoveItemEvent(
-                    _entity.GetNetEntity(draggingGhost.Entity),
-                    _entity.GetNetEntity(storageEnt)));
-            }
 
             _menuDragHelper.EndDrag();
             _container?.BuildItemPieces();
index fee4c1a0fb6eaeb3ddee207668b3231181510ed6..183420db9d154e037bbfe6423369d34fa9983c1c 100644 (file)
@@ -129,7 +129,6 @@ public abstract class SharedStorageSystem : EntitySystem
         SubscribeAllEvent<StorageInteractWithItemEvent>(OnInteractWithItem);
         SubscribeAllEvent<StorageSetItemLocationEvent>(OnSetItemLocation);
         SubscribeAllEvent<StorageInsertItemIntoLocationEvent>(OnInsertItemIntoLocation);
-        SubscribeAllEvent<StorageRemoveItemEvent>(OnRemoveItem);
         SubscribeAllEvent<StorageSaveItemLocationEvent>(OnSaveItemLocation);
 
         SubscribeLocalEvent<StorageComponent, GotReclaimedEvent>(OnReclaimed);
@@ -639,19 +638,6 @@ public abstract class SharedStorageSystem : EntitySystem
         TrySetItemStorageLocation(item!, storage!, msg.Location);
     }
 
-    private void OnRemoveItem(StorageRemoveItemEvent msg, EntitySessionEventArgs args)
-    {
-        if (!ValidateInput(args, msg.StorageEnt, msg.ItemEnt, out var player, out var storage, out var item))
-            return;
-
-        _adminLog.Add(
-            LogType.Storage,
-            LogImpact.Low,
-            $"{ToPrettyString(player):player} is removing {ToPrettyString(item):item} from {ToPrettyString(storage):storage}");
-        TransformSystem.DropNextTo(item.Owner, player.Owner);
-        Audio.PlayPredicted(storage.Comp.StorageRemoveSound, storage, player, _audioParams);
-    }
-
     private void OnInsertItemIntoLocation(StorageInsertItemIntoLocationEvent msg, EntitySessionEventArgs args)
     {
         if (!ValidateInput(args, msg.StorageEnt, msg.ItemEnt, out var player, out var storage, out var item, held: true))
index d2c607e57f765636a808ac5d41e3c5e9736e14c5..5683ae95a719f3cb63a1437b37c835a2ef892f7f 100644 (file)
@@ -169,20 +169,6 @@ namespace Content.Shared.Storage
         }
     }
 
-    [Serializable, NetSerializable]
-    public sealed class StorageRemoveItemEvent : EntityEventArgs
-    {
-        public readonly NetEntity ItemEnt;
-
-        public readonly NetEntity StorageEnt;
-
-        public StorageRemoveItemEvent(NetEntity itemEnt, NetEntity storageEnt)
-        {
-            ItemEnt = itemEnt;
-            StorageEnt = storageEnt;
-        }
-    }
-
     [Serializable, NetSerializable]
     public sealed class StorageInsertItemIntoLocationEvent : EntityEventArgs
     {