Bows & arrows (#19771)

This commit is contained in:
Kara
2023-09-22 02:45:21 -07:00
committed by GitHub
parent 1ba1ab6d61
commit f8d194b117
51 changed files with 507 additions and 22 deletions

View File

@@ -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();
}
}

View File

@@ -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)

View File

@@ -130,6 +130,8 @@ namespace Content.Shared.Storage
Open,
HasContents,
CanLock,
Locked
Locked,
StorageUsed,
Capacity
}
}