Resolves StorageVisualizer is Obsolete (#13910)

This commit is contained in:
TemporalOroboros
2023-05-18 11:03:20 -07:00
committed by GitHub
parent a8b3dd8c87
commit f43683e3b9
20 changed files with 436 additions and 469 deletions

View File

@@ -62,6 +62,7 @@ public sealed class LockSystem : EntitySystem
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
{
_appearanceSystem.SetData(uid, StorageVisuals.CanLock, true);
_appearanceSystem.SetData(uid, StorageVisuals.Locked, lockComp.Locked);
}
private void OnActivated(EntityUid uid, LockComponent lockComp, ActivateInWorldEvent args)

View File

@@ -43,8 +43,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<SharedEntityStorageComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<SharedEntityStorageComponent, ActivateInWorldEvent>(OnInteract, after: new[]{typeof(LockSystem)});
SubscribeLocalEvent<SharedEntityStorageComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<SharedEntityStorageComponent, ComponentStartup>(OnComponentStartup);
SubscribeLocalEvent<SharedEntityStorageComponent, ActivateInWorldEvent>(OnInteract, after: new[] { typeof(LockSystem) });
SubscribeLocalEvent<SharedEntityStorageComponent, LockToggleAttemptEvent>(OnLockToggleAttempt);
SubscribeLocalEvent<SharedEntityStorageComponent, DestructionEventArgs>(OnDestruction);
SubscribeLocalEvent<SharedEntityStorageComponent, GetVerbsEvent<InteractionVerb>>(AddToggleOpenVerb);
@@ -76,13 +77,18 @@ public abstract class SharedEntityStorageSystem : EntitySystem
component.IsWeldedShut = state.IsWeldedShut;
}
protected virtual void OnInit(EntityUid uid, SharedEntityStorageComponent component, ComponentInit args)
protected virtual void OnComponentInit(EntityUid uid, SharedEntityStorageComponent component, ComponentInit args)
{
component.Contents = _container.EnsureContainer<Container>(uid, ContainerName);
component.Contents.ShowContents = component.ShowContents;
component.Contents.OccludesLight = component.OccludesLight;
}
protected virtual void OnComponentStartup(EntityUid uid, SharedEntityStorageComponent component, ComponentStartup args)
{
_appearance.SetData(uid, StorageVisuals.Open, component.Open);
}
private void OnInteract(EntityUid uid, SharedEntityStorageComponent component, ActivateInWorldEvent args)
{
if (args.Handled)