Remove some obsolete AppearanceComponent method usages (#13726)
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Content.Server.Atmos.Components
|
||||
set
|
||||
{
|
||||
Type = value;
|
||||
EntitySystem.Get<AtmosPlaqueSystem>().UpdateSign(this);
|
||||
EntitySystem.Get<AtmosPlaqueSystem>().UpdateSign(Owner, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Shared.Atmos.Visuals;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Atmos.EntitySystems;
|
||||
@@ -7,6 +8,7 @@ namespace Content.Server.Atmos.EntitySystems;
|
||||
public sealed class AtmosPlaqueSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -27,10 +29,10 @@ public sealed class AtmosPlaqueSystem : EntitySystem
|
||||
// 45% LINDA
|
||||
else component.Type = PlaqueType.Linda;
|
||||
|
||||
UpdateSign(component);
|
||||
UpdateSign(uid, component);
|
||||
}
|
||||
|
||||
public void UpdateSign(AtmosPlaqueComponent component)
|
||||
public void UpdateSign(EntityUid uid, AtmosPlaqueComponent component)
|
||||
{
|
||||
var metaData = MetaData(component.Owner);
|
||||
|
||||
@@ -70,7 +72,7 @@ public sealed class AtmosPlaqueSystem : EntitySystem
|
||||
{
|
||||
var state = component.Type == PlaqueType.Zumos ? "zumosplaque" : "atmosplaque";
|
||||
|
||||
appearance.SetData(AtmosPlaqueVisuals.State, state);
|
||||
_appearance.SetData(uid, AtmosPlaqueVisuals.State, state, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
[Dependency] private readonly FixtureSystem _fixture = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public const float MinimumFireStacks = -10f;
|
||||
public const float MaximumFireStacks = 20f;
|
||||
@@ -176,8 +177,8 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!Resolve(uid, ref flammable, ref appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(FireVisuals.OnFire, flammable.OnFire);
|
||||
appearance.SetData(FireVisuals.FireStacks, flammable.FireStacks);
|
||||
_appearance.SetData(uid, FireVisuals.OnFire, flammable.OnFire, appearance);
|
||||
_appearance.SetData(uid, FireVisuals.FireStacks, flammable.FireStacks, appearance);
|
||||
}
|
||||
|
||||
public void AdjustFireStacks(EntityUid uid, float relativeFireStacks, FlammableComponent? flammable = null)
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -146,7 +147,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
if (!Resolve(uid, ref pump, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(PumpVisuals.Enabled, pump.Enabled);
|
||||
_appearance.SetData(uid, PumpVisuals.Enabled, pump.Enabled, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Shared.Audio;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -15,6 +16,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
public sealed class GasValveSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -58,7 +60,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
{
|
||||
if (TryComp<AppearanceComponent>(component.Owner,out var appearance))
|
||||
{
|
||||
appearance.SetData(FilterVisuals.Enabled, component.Open);
|
||||
_appearance.SetData(uid, FilterVisuals.Enabled, component.Open, appearance);
|
||||
}
|
||||
if (component.Open)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -160,7 +161,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
if (!Resolve(uid, ref pump, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(PumpVisuals.Enabled, pump.Enabled);
|
||||
_appearance.SetData(uid, PumpVisuals.Enabled, pump.Enabled, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Server.NodeContainer.EntitySystems;
|
||||
using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.EntitySystems;
|
||||
@@ -10,6 +11,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems;
|
||||
public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -69,6 +71,6 @@ public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||
};
|
||||
}
|
||||
|
||||
appearance.SetData(PipeVisuals.VisualState, netConnectedDirections);
|
||||
_appearance.SetData(uid, PipeVisuals.VisualState, netConnectedDirections, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using Content.Server.Atmos.Piping.Components;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.EntitySystems
|
||||
{
|
||||
public sealed class AtmosPipeColorSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -18,7 +21,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
||||
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(PipeColorVisuals.Color, component.Color);
|
||||
_appearance.SetData(uid, PipeColorVisuals.Color, component.Color, appearance);
|
||||
}
|
||||
|
||||
private void OnShutdown(EntityUid uid, AtmosPipeColorComponent component, ComponentShutdown args)
|
||||
@@ -26,7 +29,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
||||
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(PipeColorVisuals.Color, Color.White);
|
||||
_appearance.SetData(uid, PipeColorVisuals.Color, Color.White, appearance);
|
||||
}
|
||||
|
||||
public void SetColor(EntityUid uid, AtmosPipeColorComponent component, Color color)
|
||||
@@ -36,7 +39,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
||||
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(PipeColorVisuals.Color, color);
|
||||
_appearance.SetData(uid, PipeColorVisuals.Color, color, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
[Dependency] private IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -174,7 +175,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
if (!Resolve(uid, ref mixer, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(FilterVisuals.Enabled, mixer.Enabled);
|
||||
_appearance.SetData(uid, FilterVisuals.Enabled, mixer.Enabled, appearance);
|
||||
}
|
||||
|
||||
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
using Content.Shared.Audio;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
@@ -16,6 +17,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
[Dependency] private IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -90,7 +92,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
if (!Resolve(uid, ref comp, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(FilterVisuals.Enabled, comp.Enabled);
|
||||
_appearance.SetData(uid, FilterVisuals.Enabled, comp.Enabled, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||
using Content.Shared.Construction.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
@@ -14,6 +15,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
public sealed class GasPortableSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -46,7 +48,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(GasPortableVisuals.ConnectedState, args.Anchored);
|
||||
_appearance.SetData(uid, GasPortableVisuals.ConnectedState, args.Anchored, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ using Content.Shared.Atmos.Visuals;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
@@ -30,6 +31,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
[Dependency] private readonly SignalLinkerSystem _signalSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -243,20 +245,20 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (!vent.Enabled)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
appearance.SetData(VentPumpVisuals.State, VentPumpState.Off);
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Off, appearance);
|
||||
}
|
||||
else if (vent.PumpDirection == VentPumpDirection.Releasing)
|
||||
{
|
||||
appearance.SetData(VentPumpVisuals.State, VentPumpState.Out);
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
|
||||
}
|
||||
else if (vent.PumpDirection == VentPumpDirection.Siphoning)
|
||||
{
|
||||
appearance.SetData(VentPumpVisuals.State, VentPumpState.In);
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.In, appearance);
|
||||
}
|
||||
else if (vent.Welded)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
appearance.SetData(VentPumpVisuals.State, VentPumpState.Welded);
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Welded, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
[Dependency] private readonly DeviceNetworkSystem _deviceNetSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -185,20 +186,20 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (!scrubber.Enabled)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
appearance.SetData(ScrubberVisuals.State, ScrubberState.Off);
|
||||
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Off, appearance);
|
||||
}
|
||||
else if (scrubber.PumpDirection == ScrubberPumpDirection.Scrubbing)
|
||||
{
|
||||
appearance.SetData(ScrubberVisuals.State, scrubber.WideNet ? ScrubberState.WideScrub : ScrubberState.Scrub);
|
||||
_appearance.SetData(uid, ScrubberVisuals.State, scrubber.WideNet ? ScrubberState.WideScrub : ScrubberState.Scrub, appearance);
|
||||
}
|
||||
else if (scrubber.PumpDirection == ScrubberPumpDirection.Siphoning)
|
||||
{
|
||||
appearance.SetData(ScrubberVisuals.State, ScrubberState.Siphon);
|
||||
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Siphon, appearance);
|
||||
}
|
||||
else if (scrubber.Welded)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
appearance.SetData(ScrubberVisuals.State, ScrubberState.Welded);
|
||||
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Welded, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user