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

@@ -6,6 +6,7 @@ using Content.Server.NodeContainer.Nodes;
using Content.Shared.Atmos.Piping;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Timing;
namespace Content.Server.Atmos.Piping.Unary.EntitySystems
@@ -15,6 +16,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize()
{
@@ -27,21 +29,21 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
private void OnMapInit(EntityUid uid, GasOutletInjectorComponent component, MapInitEvent args)
{
UpdateAppearance(component);
UpdateAppearance(uid, component);
}
private void OnActivate(EntityUid uid, GasOutletInjectorComponent component, ActivateInWorldEvent args)
{
component.Enabled = !component.Enabled;
UpdateAppearance(component);
UpdateAppearance(uid, component);
}
public void UpdateAppearance(GasOutletInjectorComponent component, AppearanceComponent? appearance = null)
public void UpdateAppearance(EntityUid uid, GasOutletInjectorComponent component, AppearanceComponent? appearance = null)
{
if (!Resolve(component.Owner, ref appearance, false))
return;
appearance.SetData(OutletInjectorVisuals.Enabled, component.Enabled);
_appearance.SetData(uid, OutletInjectorVisuals.Enabled, component.Enabled, appearance);
}
private void OnOutletInjectorUpdated(EntityUid uid, GasOutletInjectorComponent injector, AtmosDeviceUpdateEvent args)