Remove some obsolete AppearanceComponent method usages (#13726)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user