biggest gridinv update OF ALL TIME (#25834)

* add SaveItemLocation keybind

* make item direction public to avoid having to change between Angle for no reason

* add item location saving

* show

* Added a better save keybind, made it draw saved positions, and trying to save in a position it has already been saved in removes that position.

* w

* code style

* Make taken spots appear blue

* style

* !

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: notquitehadouken <tripwiregamer@gmail.com>
Co-authored-by: I.K <45953835+notquitehadouken@users.noreply.github.com>
This commit is contained in:
deltanedas
2024-03-28 06:31:47 +00:00
committed by GitHub
parent 65fa3ae211
commit 6863a7cc26
10 changed files with 188 additions and 5 deletions

View File

@@ -32,6 +32,14 @@ namespace Content.Shared.Storage
[DataField, ViewVariables(VVAccess.ReadWrite)]
public Dictionary<EntityUid, ItemStorageLocation> StoredItems = new();
/// <summary>
/// A dictionary storing each saved item to its location in the grid.
/// When trying to quick insert an item, if there is an empty location with the same name it will be placed there.
/// Multiple items with the same name can be saved, they will be checked individually.
/// </summary>
[DataField]
public Dictionary<string, List<ItemStorageLocation>> SavedLocations = new();
/// <summary>
/// A list of boxes that comprise a combined grid that determines the location that items can be stored.
/// </summary>
@@ -171,6 +179,20 @@ namespace Content.Shared.Storage
}
}
[Serializable, NetSerializable]
public sealed class StorageSaveItemLocationEvent : EntityEventArgs
{
public readonly NetEntity Item;
public readonly NetEntity Storage;
public StorageSaveItemLocationEvent(NetEntity item, NetEntity storage)
{
Item = item;
Storage = storage;
}
}
/// <summary>
/// Network event for displaying an animation of entities flying into a storage entity