Revert "Storage TEST MERGE" (#21258)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user