T shaped pickaxe and grid UI fix (#22197)

This commit is contained in:
TemporalOroboros
2023-12-06 16:52:57 -08:00
committed by GitHub
parent 6ccce8b018
commit f98322ad5d
2 changed files with 11 additions and 8 deletions

View File

@@ -251,23 +251,23 @@ public sealed class StorageContainer : BaseWindow
{
for (var x = boundingGrid.Left; x <= boundingGrid.Right; x++)
{
var currentPosition = new Vector2i(x, y);
var item = storageComp.StoredItems
.Where(pair => pair.Value.Position == currentPosition)
.FirstOrNull();
var control = new Control
{
MinSize = size
};
if (item != null)
var currentPosition = new Vector2i(x, y);
foreach (var item in storageComp.StoredItems)
{
var itemEnt = _entity.GetEntity(item.Value.Key);
if (item.Value.Position != currentPosition)
continue;
var itemEnt = _entity.GetEntity(item.Key);
if (_entity.TryGetComponent<ItemComponent>(itemEnt, out var itemEntComponent))
{
var gridPiece = new ItemGridPiece((itemEnt, itemEntComponent), item.Value.Value, _entity)
var gridPiece = new ItemGridPiece((itemEnt, itemEntComponent), item.Value, _entity)
{
MinSize = size,
};

View File

@@ -27,6 +27,9 @@
Structural: 10
- type: Item
size: Normal
shape:
- 0,0,2,0
- 1,1,1,2
sprite: Objects/Weapons/Melee/pickaxe.rsi
- type: UseDelay
delay: 1