Revert "Storage TEST MERGE" (#21258)

This commit is contained in:
metalgearsloth
2023-10-26 18:46:22 +11:00
committed by GitHub
parent a850b1f568
commit c08349a947
235 changed files with 1019 additions and 1072 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.Rounding;
using Content.Shared.Storage;
using Content.Shared.Storage.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
namespace Content.Server.Storage.EntitySystems;
@@ -12,12 +13,12 @@ public sealed class StorageFillVisualizerSystem : EntitySystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StorageFillVisualizerComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<StorageFillVisualizerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<StorageFillVisualizerComponent, EntInsertedIntoContainerMessage>(OnInserted);
SubscribeLocalEvent<StorageFillVisualizerComponent, EntRemovedFromContainerMessage>(OnRemoved);
}
private void OnStartup(EntityUid uid, StorageFillVisualizerComponent component, ComponentStartup args)
private void OnInit(EntityUid uid, StorageFillVisualizerComponent component, ComponentInit args)
{
UpdateAppearance(uid, component: component);
}
@@ -41,7 +42,7 @@ public sealed class StorageFillVisualizerSystem : EntitySystem
if (component.MaxFillLevels < 1)
return;
var level = ContentHelpers.RoundToEqualLevels(storage.Container.ContainedEntities.Count, storage.MaxSlots, component.MaxFillLevels);
var level = ContentHelpers.RoundToEqualLevels(storage.StorageUsed, storage.StorageCapacityMax, component.MaxFillLevels);
_appearance.SetData(uid, StorageFillVisuals.FillLevel, level, appearance);
}
}