Bows & arrows (#19771)
This commit is contained in:
@@ -66,6 +66,11 @@ namespace Content.Shared.Storage.Components
|
||||
[DataField("containerWhitelist")]
|
||||
public HashSet<string>? ContainerWhitelist;
|
||||
|
||||
public readonly List<string> SpriteLayers = new();
|
||||
/// <summary>
|
||||
/// The list of map layer keys that are valid targets for changing in <see cref="MapLayers"/>
|
||||
/// Can be initialized if already existing on the sprite, or inferred automatically
|
||||
/// </summary>
|
||||
[DataField("spriteLayers")]
|
||||
public List<string> SpriteLayers = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
||||
if (component.Container == default)
|
||||
return;
|
||||
|
||||
RecalculateStorageUsed(component);
|
||||
RecalculateStorageUsed(uid, component);
|
||||
UpdateStorageVisualization(uid, component);
|
||||
UpdateUI(uid, component);
|
||||
Dirty(uid, component);
|
||||
@@ -394,7 +394,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
||||
_appearance.SetData(uid, StackVisuals.Hide, !storageComp.IsUiOpen);
|
||||
}
|
||||
|
||||
public void RecalculateStorageUsed(StorageComponent storageComp)
|
||||
public void RecalculateStorageUsed(EntityUid uid, StorageComponent storageComp)
|
||||
{
|
||||
storageComp.StorageUsed = 0;
|
||||
|
||||
@@ -406,6 +406,9 @@ public abstract class SharedStorageSystem : EntitySystem
|
||||
var size = itemComp.Size;
|
||||
storageComp.StorageUsed += size;
|
||||
}
|
||||
|
||||
_appearance.SetData(uid, StorageVisuals.StorageUsed, storageComp.StorageUsed);
|
||||
_appearance.SetData(uid, StorageVisuals.Capacity, storageComp.StorageCapacityMax);
|
||||
}
|
||||
|
||||
public int GetAvailableSpace(EntityUid uid, StorageComponent? component = null)
|
||||
|
||||
0
Content.Shared/Storage/SharedStorageComponent.cs
Normal file
0
Content.Shared/Storage/SharedStorageComponent.cs
Normal file
@@ -130,6 +130,8 @@ namespace Content.Shared.Storage
|
||||
Open,
|
||||
HasContents,
|
||||
CanLock,
|
||||
Locked
|
||||
Locked,
|
||||
StorageUsed,
|
||||
Capacity
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user