Mark the last item stored in storage for smart-equip (#22236)

* mark the last item stored in grid inventory

* shift
This commit is contained in:
Nemanja
2023-12-08 13:43:57 -05:00
committed by GitHub
parent 736300d505
commit 8112f84c33
4 changed files with 23 additions and 2 deletions

View File

@@ -249,6 +249,7 @@ public sealed class StorageContainer : BaseWindow
var boundingGrid = storageComp.Grid.GetBoundingBox();
var size = _emptyTexture!.Size * 2;
var lastEntity = storageComp.Container.ContainedEntities.LastOrDefault();
//todo. at some point, we may want to only rebuild the pieces that have actually received new data.
@@ -278,6 +279,7 @@ public sealed class StorageContainer : BaseWindow
var gridPiece = new ItemGridPiece((itemEnt, itemEntComponent), item.Value, _entity)
{
MinSize = size,
Marked = itemEnt == lastEntity
};
gridPiece.OnPiecePressed += OnPiecePressed;
gridPiece.OnPieceUnpressed += OnPieceUnpressed;