Remove some obsolete AppearanceComponent method usages (#13726)

This commit is contained in:
Visne
2023-02-02 17:34:53 +01:00
committed by GitHub
parent 23b90de34d
commit 5a5a3afbb1
111 changed files with 428 additions and 349 deletions

View File

@@ -7,6 +7,7 @@ namespace Content.Shared.PDA
public abstract class SharedPDASystem : EntitySystem
{
[Dependency] protected readonly ItemSlotsSystem ItemSlotsSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize()
{
@@ -27,7 +28,7 @@ namespace Content.Shared.PDA
ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAIdSlotId, pda.IdSlot);
ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAPenSlotId, pda.PenSlot);
UpdatePDAAppearance(pda);
UpdatePdaAppearance(uid, pda);
}
private void OnComponentRemove(EntityUid uid, PDAComponent pda, ComponentRemove args)
@@ -41,7 +42,7 @@ namespace Content.Shared.PDA
if (args.Container.ID == PDAComponent.PDAIdSlotId)
pda.ContainedID = CompOrNull<IdCardComponent>(args.Entity);
UpdatePDAAppearance(pda);
UpdatePdaAppearance(uid, pda);
}
protected virtual void OnItemRemoved(EntityUid uid, PDAComponent pda, EntRemovedFromContainerMessage args)
@@ -49,13 +50,13 @@ namespace Content.Shared.PDA
if (args.Container.ID == pda.IdSlot.ID)
pda.ContainedID = null;
UpdatePDAAppearance(pda);
UpdatePdaAppearance(uid, pda);
}
private void UpdatePDAAppearance(PDAComponent pda)
private void UpdatePdaAppearance(EntityUid uid, PDAComponent pda)
{
if (TryComp(pda.Owner, out AppearanceComponent ? appearance))
appearance.SetData(PDAVisuals.IDCardInserted, pda.ContainedID != null);
_appearance.SetData(uid, PDAVisuals.IDCardInserted, pda.ContainedID != null, appearance);
}
}
}