Remove some obsolete AppearanceComponent method usages (#13726)
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Content.Server.AirlockPainter
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -40,10 +41,10 @@ namespace Content.Server.AirlockPainter
|
||||
{
|
||||
ev.Component.IsSpraying = false;
|
||||
if (TryComp<AppearanceComponent>(ev.Target, out var appearance) &&
|
||||
TryComp(ev.Target, out PaintableAirlockComponent? airlock))
|
||||
TryComp(ev.Target, out PaintableAirlockComponent? _))
|
||||
{
|
||||
SoundSystem.Play(ev.Component.SpraySound.GetSound(), Filter.Pvs(ev.UsedTool, entityManager:EntityManager), ev.UsedTool);
|
||||
appearance.SetData(DoorVisuals.BaseRSI, ev.Sprite);
|
||||
_appearance.SetData(ev.Target, DoorVisuals.BaseRSI, ev.Sprite, appearance);
|
||||
|
||||
// Log success
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(ev.User):user} painted {ToPrettyString(ev.Target):target}");
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.AlertLevel;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.AlertLevel;
|
||||
|
||||
public sealed class AlertLevelDisplaySystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -17,7 +19,7 @@ public sealed class AlertLevelDisplaySystem : EntitySystem
|
||||
{
|
||||
foreach (var (_, appearance) in EntityManager.EntityQuery<AlertLevelDisplayComponent, AppearanceComponent>())
|
||||
{
|
||||
appearance.SetData(AlertLevelDisplay.CurrentLevel, args.AlertLevel);
|
||||
_appearance.SetData(appearance.Owner, AlertLevelDisplay.CurrentLevel, args.AlertLevel, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +30,7 @@ public sealed class AlertLevelDisplaySystem : EntitySystem
|
||||
var stationUid = _stationSystem.GetOwningStation(uid);
|
||||
if (stationUid != null && TryComp(stationUid, out AlertLevelComponent? alert))
|
||||
{
|
||||
appearance.SetData(AlertLevelDisplay.CurrentLevel, alert.CurrentLevel);
|
||||
_appearance.SetData(uid, AlertLevelDisplay.CurrentLevel, alert.CurrentLevel, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Cabinet;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
@@ -14,6 +15,7 @@ namespace Content.Server.Cabinet
|
||||
{
|
||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -54,8 +56,8 @@ namespace Content.Server.Cabinet
|
||||
if (!Resolve(uid, ref cabinet, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(ItemCabinetVisuals.IsOpen, cabinet.Opened);
|
||||
appearance.SetData(ItemCabinetVisuals.ContainsItem, cabinet.CabinetSlot.HasItem);
|
||||
_appearance.SetData(uid, ItemCabinetVisuals.IsOpen, cabinet.Opened, appearance);
|
||||
_appearance.SetData(uid, ItemCabinetVisuals.ContainsItem, cabinet.CabinetSlot.HasItem, appearance);
|
||||
}
|
||||
|
||||
private void OnContainerModified(EntityUid uid, ItemCabinetComponent cabinet, ContainerModifiedMessage args)
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Content.Server.Chat.TypingIndicator;
|
||||
public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
|
||||
{
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -58,6 +59,6 @@ public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
|
||||
if (!Resolve(uid, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(TypingIndicatorVisuals.IsTyping, isEnabled);
|
||||
_appearance.SetData(uid, TypingIndicatorVisuals.IsTyping, isEnabled, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Construction;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Reflection;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
@@ -9,6 +10,8 @@ namespace Content.Server.Construction.Completions
|
||||
[DataDefinition]
|
||||
public sealed class VisualizerDataInt : IGraphAction, ISerializationHooks
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
[DataField("key")] public string Key { get; private set; } = string.Empty;
|
||||
[DataField("data")] public int Data { get; private set; } = 0;
|
||||
|
||||
@@ -18,9 +21,9 @@ namespace Content.Server.Construction.Completions
|
||||
|
||||
if (entityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
if(IoCManager.Resolve<IReflectionManager>().TryParseEnumReference(Key, out var @enum))
|
||||
if (IoCManager.Resolve<IReflectionManager>().TryParseEnumReference(Key, out var @enum))
|
||||
{
|
||||
appearance.SetData(@enum, Data);
|
||||
_appearance.SetData(uid, @enum, Data, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ using Robust.Shared.Utility;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Disease
|
||||
{
|
||||
@@ -31,8 +32,8 @@ namespace Content.Server.Disease
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
[Dependency] private readonly PaperSystem _paperSystem = default!;
|
||||
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -298,8 +299,8 @@ namespace Content.Server.Disease
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(DiseaseMachineVisuals.IsOn, isOn);
|
||||
appearance.SetData(DiseaseMachineVisuals.IsRunning, isRunning);
|
||||
_appearance.SetData(uid, DiseaseMachineVisuals.IsOn, isOn, appearance);
|
||||
_appearance.SetData(uid, DiseaseMachineVisuals.IsRunning, isRunning, appearance);
|
||||
}
|
||||
/// <summary>
|
||||
/// Makes sure the machine is visually off/on.
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.Doors.Systems
|
||||
[Dependency] private readonly SharedDoorSystem _doorSystem = default!;
|
||||
[Dependency] private readonly AtmosAlarmableSystem _atmosAlarmable = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosSystem = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private static float _visualUpdateInterval = 0.5f;
|
||||
private float _accumulatedFrameTime;
|
||||
|
||||
@@ -20,6 +20,7 @@ using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -34,6 +35,7 @@ namespace Content.Server.Drone
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly InnateToolSystem _innateToolSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -120,7 +122,7 @@ namespace Content.Server.Drone
|
||||
{
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
appearance.SetData(DroneVisuals.Status, status);
|
||||
_appearance.SetData(uid, DroneVisuals.Status, status, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Explosion;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -15,6 +16,7 @@ public sealed class ClusterGrenadeSystem : EntitySystem
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly TriggerSystem _trigger = default!;
|
||||
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -35,7 +37,7 @@ public sealed class ClusterGrenadeSystem : EntitySystem
|
||||
if (component.FillPrototype != null)
|
||||
{
|
||||
component.UnspawnedCount = Math.Max(0, component.MaxGrenades - component.GrenadesContainer.ContainedEntities.Count);
|
||||
UpdateAppearance(component);
|
||||
UpdateAppearance(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +51,7 @@ public sealed class ClusterGrenadeSystem : EntitySystem
|
||||
return;
|
||||
|
||||
component.GrenadesContainer.Insert(args.Used);
|
||||
UpdateAppearance(component);
|
||||
UpdateAppearance(uid, component);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -122,10 +124,10 @@ public sealed class ClusterGrenadeSystem : EntitySystem
|
||||
return false;
|
||||
}
|
||||
|
||||
private void UpdateAppearance(ClusterGrenadeComponent component)
|
||||
private void UpdateAppearance(EntityUid uid, ClusterGrenadeComponent component)
|
||||
{
|
||||
if (!TryComp<AppearanceComponent>(component.Owner, out var appearance)) return;
|
||||
|
||||
appearance.SetData(ClusterGrenadeVisuals.GrenadesCounter, component.GrenadesContainer.ContainedEntities.Count + component.UnspawnedCount);
|
||||
_appearance.SetData(uid, ClusterGrenadeVisuals.GrenadesCounter, component.GrenadesContainer.ContainedEntities.Count + component.UnspawnedCount, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Explosion.Components;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Trigger;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Physics.Events;
|
||||
@@ -10,6 +11,8 @@ namespace Content.Server.Explosion.EntitySystems;
|
||||
|
||||
public sealed partial class TriggerSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Anything that has stuff touching it (to check speed) or is on cooldown.
|
||||
/// </summary>
|
||||
@@ -86,9 +89,9 @@ public sealed partial class TriggerSystem
|
||||
|
||||
private void SetProximityAppearance(EntityUid uid, TriggerOnProximityComponent component)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearanceComponent.SetData(ProximityTriggerVisualState.State, component.Enabled ? ProximityTriggerVisuals.Inactive : ProximityTriggerVisuals.Off);
|
||||
_appearance.SetData(uid, ProximityTriggerVisualState.State, component.Enabled ? ProximityTriggerVisuals.Inactive : ProximityTriggerVisuals.Off, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,9 +110,9 @@ public sealed partial class TriggerSystem
|
||||
component.Accumulator += component.Cooldown;
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearanceComponent))
|
||||
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearanceComponent.SetData(ProximityTriggerVisualState.State, ProximityTriggerVisuals.Active);
|
||||
_appearance.SetData(appearance.Owner, ProximityTriggerVisualState.State, ProximityTriggerVisuals.Active, appearance);
|
||||
}
|
||||
|
||||
Trigger(component.Owner);
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
active.TimeUntilBeep = initialBeepDelay == null ? active.BeepInterval : initialBeepDelay.Value;
|
||||
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Primed);
|
||||
_appearance.SetData(uid, TriggerVisuals.VisualState, TriggerVisualState.Primed, appearance);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -219,7 +219,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
|
||||
// In case this is a re-usable grenade, un-prime it.
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Unprimed);
|
||||
_appearance.SetData(uid, TriggerVisuals.VisualState, TriggerVisualState.Unprimed, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -17,6 +18,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -123,7 +125,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
|
||||
|
||||
if (comp.HasSafety)
|
||||
{
|
||||
appearance.SetData(FireExtinguisherVisuals.Safety, comp.Safety);
|
||||
_appearance.SetData(uid, FireExtinguisherVisuals.Safety, comp.Safety, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Cooldown;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Vapor;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
@@ -25,6 +26,7 @@ public sealed class SpraySystem : EntitySystem
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly VaporSystem _vaporSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -108,8 +110,8 @@ public sealed class SpraySystem : EntitySystem
|
||||
|
||||
if (TryComp(vapor, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(VaporVisuals.Color, solution.GetColor(_proto).WithAlpha(1f));
|
||||
appearance.SetData(VaporVisuals.State, true);
|
||||
_appearance.SetData(uid, VaporVisuals.Color, solution.GetColor(_proto).WithAlpha(1f), appearance);
|
||||
_appearance.SetData(uid, VaporVisuals.State, true, appearance);
|
||||
}
|
||||
|
||||
// Add the solution to the vapor and actually send the thing
|
||||
|
||||
@@ -18,6 +18,7 @@ using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Kitchen.EntitySystems
|
||||
{
|
||||
@@ -28,6 +29,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
[Dependency] private readonly IAdminLogManager _logger = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -171,7 +173,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
if (!Resolve(uid, ref component, ref appearance, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(KitchenSpikeVisuals.Status, (component.PrototypesToSpawn?.Count > 0) ? KitchenSpikeStatus.Bloody : KitchenSpikeStatus.Empty);
|
||||
_appearance.SetData(uid, KitchenSpikeVisuals.Status, (component.PrototypesToSpawn?.Count > 0 ? KitchenSpikeStatus.Bloody : KitchenSpikeStatus.Empty, appearance));
|
||||
}
|
||||
|
||||
private bool Spikeable(EntityUid uid, EntityUid userUid, EntityUid victimUid,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Kudzu;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Kudzu;
|
||||
@@ -6,6 +7,7 @@ namespace Content.Server.Kudzu;
|
||||
public sealed class GrowingKudzuSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private float _accumulatedFrameTime = 0.0f;
|
||||
|
||||
@@ -21,8 +23,8 @@ public sealed class GrowingKudzuSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
appearance.SetData(KudzuVisuals.Variant, _robustRandom.Next(1, 3));
|
||||
appearance.SetData(KudzuVisuals.GrowthLevel, 1);
|
||||
_appearance.SetData(uid, KudzuVisuals.Variant, _robustRandom.Next(1, 3), appearance);
|
||||
_appearance.SetData(uid, KudzuVisuals.GrowthLevel, 1, appearance);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -46,7 +48,7 @@ public sealed class GrowingKudzuSystem : EntitySystem
|
||||
EntityManager.RemoveComponent<GrowingKudzuComponent>((kudzu).Owner);
|
||||
}
|
||||
|
||||
appearance.SetData(KudzuVisuals.GrowthLevel, kudzu.GrowthLevel);
|
||||
_appearance.SetData(kudzu.Owner, KudzuVisuals.GrowthLevel, kudzu.GrowthLevel, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Labels;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -16,6 +17,7 @@ namespace Content.Server.Labels
|
||||
public sealed class LabelSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public const string ContainerName = "paper_label";
|
||||
|
||||
@@ -71,7 +73,7 @@ namespace Content.Server.Labels
|
||||
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(PaperLabelVisuals.HasLabel, false);
|
||||
_appearance.SetData(uid, PaperLabelVisuals.HasLabel, false, appearance);
|
||||
}
|
||||
|
||||
private void OnComponentRemove(EntityUid uid, PaperLabelComponent component, ComponentRemove args)
|
||||
@@ -128,7 +130,7 @@ namespace Content.Server.Labels
|
||||
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(PaperLabelVisuals.HasLabel, label.LabelSlot.HasItem);
|
||||
_appearance.SetData(uid, PaperLabelVisuals.HasLabel, label.LabelSlot.HasItem, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -110,7 +111,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
continue;
|
||||
|
||||
pointLight.Color = details.EmergencyLightColor;
|
||||
appearance.SetData(EmergencyLightVisuals.Color, details.EmergencyLightColor);
|
||||
_appearance.SetData(appearance.Owner, EmergencyLightVisuals.Color, details.EmergencyLightColor, appearance);
|
||||
|
||||
if (details.ForceEnableEmergencyLights && !light.ForciblyEnabled)
|
||||
{
|
||||
@@ -198,7 +199,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
}
|
||||
|
||||
if (TryComp(component.Owner, out AppearanceComponent? appearance))
|
||||
appearance.SetData(EmergencyLightVisuals.On, false);
|
||||
_appearance.SetData(appearance.Owner, EmergencyLightVisuals.On, false, appearance);
|
||||
|
||||
_ambient.SetAmbience(component.Owner, false);
|
||||
}
|
||||
@@ -212,7 +213,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
if (TryComp(component.Owner, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(EmergencyLightVisuals.On, true);
|
||||
_appearance.SetData(appearance.Owner, EmergencyLightVisuals.On, true, appearance);
|
||||
}
|
||||
|
||||
_ambient.SetAmbience(component.Owner, true);
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
[Dependency] private readonly ClothingSystem _clothing = default!;
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -107,20 +108,20 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
if (!Resolve(component.Owner, ref appearance, false)) return;
|
||||
|
||||
appearance.SetData(ExpendableLightVisuals.State, component.CurrentState);
|
||||
_appearance.SetData(appearance.Owner, ExpendableLightVisuals.State, component.CurrentState, appearance);
|
||||
|
||||
switch (component.CurrentState)
|
||||
{
|
||||
case ExpendableLightState.Lit:
|
||||
appearance.SetData(ExpendableLightVisuals.Behavior, component.TurnOnBehaviourID);
|
||||
_appearance.SetData(appearance.Owner, ExpendableLightVisuals.Behavior, component.TurnOnBehaviourID, appearance);
|
||||
break;
|
||||
|
||||
case ExpendableLightState.Fading:
|
||||
appearance.SetData(ExpendableLightVisuals.Behavior, component.FadeOutBehaviourID);
|
||||
_appearance.SetData(appearance.Owner, ExpendableLightVisuals.Behavior, component.FadeOutBehaviourID, appearance);
|
||||
break;
|
||||
|
||||
case ExpendableLightState.Dead:
|
||||
appearance.SetData(ExpendableLightVisuals.Behavior, string.Empty);
|
||||
_appearance.SetData(appearance.Owner, ExpendableLightVisuals.Behavior, string.Empty, appearance);
|
||||
var isHotEvent = new IsHotEvent() {IsHot = true};
|
||||
RaiseLocalEvent(component.Owner, isHotEvent);
|
||||
break;
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Server.Light.Components;
|
||||
using Content.Shared.Destructible;
|
||||
using Content.Shared.Light;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -9,6 +10,8 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
public sealed class LightBulbSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -75,8 +78,8 @@ namespace Content.Server.Light.EntitySystems
|
||||
return;
|
||||
|
||||
// try to update appearance and color
|
||||
appearance.SetData(LightBulbVisuals.State, bulb.State);
|
||||
appearance.SetData(LightBulbVisuals.Color, bulb.Color);
|
||||
_appearance.SetData(uid, LightBulbVisuals.State, bulb.State, appearance);
|
||||
_appearance.SetData(uid, LightBulbVisuals.Color, bulb.Color, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
&& EntityManager.TryGetComponent<MatchstickComponent?>(args.Used, out var matchstick)
|
||||
&& matchstick.CurrentState == SmokableState.Unlit)
|
||||
{
|
||||
_stickSystem.Ignite(matchstick, args.User);
|
||||
_stickSystem.Ignite(uid, matchstick, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,12 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
public sealed class MatchstickSystem : EntitySystem
|
||||
{
|
||||
private HashSet<MatchstickComponent> _litMatches = new();
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private HashSet<MatchstickComponent> _litMatches = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -61,7 +63,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (!isHotEvent.IsHot)
|
||||
return;
|
||||
|
||||
Ignite(component, args.User);
|
||||
Ignite(uid, component, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -70,23 +72,23 @@ namespace Content.Server.Light.EntitySystems
|
||||
args.IsHot = component.CurrentState == SmokableState.Lit;
|
||||
}
|
||||
|
||||
public void Ignite(MatchstickComponent component, EntityUid user)
|
||||
public void Ignite(EntityUid uid, MatchstickComponent component, EntityUid user)
|
||||
{
|
||||
// Play Sound
|
||||
SoundSystem.Play(component.IgniteSound.GetSound(), Filter.Pvs(component.Owner),
|
||||
component.Owner, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
|
||||
|
||||
// Change state
|
||||
SetState(component, SmokableState.Lit);
|
||||
SetState(uid, component, SmokableState.Lit);
|
||||
_litMatches.Add(component);
|
||||
component.Owner.SpawnTimer(component.Duration * 1000, delegate
|
||||
{
|
||||
SetState(component, SmokableState.Burnt);
|
||||
SetState(uid, component, SmokableState.Burnt);
|
||||
_litMatches.Remove(component);
|
||||
});
|
||||
}
|
||||
|
||||
private void SetState(MatchstickComponent component, SmokableState value)
|
||||
private void SetState(EntityUid uid, MatchstickComponent component, SmokableState value)
|
||||
{
|
||||
component.CurrentState = value;
|
||||
|
||||
@@ -110,7 +112,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(SmokingVisuals.Smoking, component.CurrentState);
|
||||
_appearance.SetData(uid, SmokingVisuals.Smoking, component.CurrentState, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
[Dependency] private readonly SignalLinkerSystem _signalSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private static readonly TimeSpan ThunkDelay = TimeSpan.FromSeconds(2);
|
||||
public const string LightBulbContainer = "light_bulb";
|
||||
@@ -270,7 +271,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
SetLight(uid, false, light: light);
|
||||
powerReceiver.Load = 0;
|
||||
appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.Empty);
|
||||
_appearance.SetData(uid, PoweredLightVisuals.BulbState, PoweredLightState.Empty, appearance);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,7 +281,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (powerReceiver.Powered && light.On)
|
||||
{
|
||||
SetLight(uid, true, lightBulb.Color, light, lightBulb.LightRadius, lightBulb.LightEnergy, lightBulb.LightSoftness);
|
||||
appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.On);
|
||||
_appearance.SetData(uid, PoweredLightVisuals.BulbState, PoweredLightState.On, appearance);
|
||||
var time = _gameTiming.CurTime;
|
||||
if (time > light.LastThunk + ThunkDelay)
|
||||
{
|
||||
@@ -291,16 +292,16 @@ namespace Content.Server.Light.EntitySystems
|
||||
else
|
||||
{
|
||||
SetLight(uid, false, light: light);
|
||||
appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.Off);
|
||||
_appearance.SetData(uid, PoweredLightVisuals.BulbState, PoweredLightState.Off, appearance);
|
||||
}
|
||||
break;
|
||||
case LightBulbState.Broken:
|
||||
SetLight(uid, false, light: light);
|
||||
appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.Broken);
|
||||
_appearance.SetData(uid, PoweredLightVisuals.BulbState, PoweredLightState.Broken, appearance);
|
||||
break;
|
||||
case LightBulbState.Burned:
|
||||
SetLight(uid, false, light: light);
|
||||
appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.Burned);
|
||||
_appearance.SetData(uid, PoweredLightVisuals.BulbState, PoweredLightState.Burned, appearance);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -335,10 +336,10 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
light.LastGhostBlink = time;
|
||||
|
||||
ToggleBlinkingLight(light, true);
|
||||
ToggleBlinkingLight(uid, light, true);
|
||||
light.Owner.SpawnTimer(light.GhostBlinkingTime, () =>
|
||||
{
|
||||
ToggleBlinkingLight(light, false);
|
||||
ToggleBlinkingLight(uid, light, false);
|
||||
});
|
||||
|
||||
args.Handled = true;
|
||||
@@ -349,7 +350,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
UpdateLight(uid, component);
|
||||
}
|
||||
|
||||
public void ToggleBlinkingLight(PoweredLightComponent light, bool isNowBlinking)
|
||||
public void ToggleBlinkingLight(EntityUid uid, PoweredLightComponent light, bool isNowBlinking)
|
||||
{
|
||||
if (light.IsBlinking == isNowBlinking)
|
||||
return;
|
||||
@@ -358,7 +359,8 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
if (!EntityManager.TryGetComponent(light.Owner, out AppearanceComponent? appearance))
|
||||
return;
|
||||
appearance.SetData(PoweredLightVisuals.Blinking, isNowBlinking);
|
||||
|
||||
_appearance.SetData(uid, PoweredLightVisuals.Blinking, isNowBlinking, appearance);
|
||||
}
|
||||
|
||||
private void OnSignalReceived(EntityUid uid, PoweredLightComponent component, SignalReceivedEvent args)
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
public sealed class UnpoweredFlashlightSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
ToggleLight(component);
|
||||
ToggleLight(uid, component);
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
@@ -48,7 +49,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
ActivationVerb verb = new();
|
||||
verb.Text = Loc.GetString("toggle-flashlight-verb-get-data-text");
|
||||
verb.IconTexture = "/Textures/Interface/VerbIcons/light.svg.192dpi.png";
|
||||
verb.Act = () => ToggleLight(component);
|
||||
verb.Act = () => ToggleLight(uid, component);
|
||||
verb.Priority = -1; // For things like PDA's, Open-UI and other verbs that should be higher priority.
|
||||
|
||||
args.Verbs.Add(verb);
|
||||
@@ -58,7 +59,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
_actionsSystem.AddAction(uid, component.ToggleAction, null);
|
||||
}
|
||||
public void ToggleLight(UnpoweredFlashlightComponent flashlight)
|
||||
public void ToggleLight(EntityUid uid, UnpoweredFlashlightComponent flashlight)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(flashlight.Owner, out PointLightComponent? light))
|
||||
return;
|
||||
@@ -67,7 +68,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
light.Enabled = flashlight.LightOn;
|
||||
|
||||
if (EntityManager.TryGetComponent(flashlight.Owner, out AppearanceComponent? appearance))
|
||||
appearance.SetData(UnpoweredFlashlightVisuals.LightOn, flashlight.LightOn);
|
||||
_appearance.SetData(uid, UnpoweredFlashlightVisuals.LightOn, flashlight.LightOn, appearance);
|
||||
|
||||
SoundSystem.Play(flashlight.ToggleSound.GetSound(), Filter.Pvs(light.Owner), flashlight.Owner);
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@ using Content.Server.MachineLinking.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.MachineLinking;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.MachineLinking.System
|
||||
{
|
||||
public sealed class TwoWayLeverSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SignalLinkerSystem _signalSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
const string _leftToggleImage = "rotate_ccw.svg.192dpi.png";
|
||||
const string _rightToggleImage = "rotate_cw.svg.192dpi.png";
|
||||
@@ -96,8 +98,8 @@ namespace Content.Server.MachineLinking.System
|
||||
if (component.State == TwoWayLeverState.Middle)
|
||||
component.NextSignalLeft = !component.NextSignalLeft;
|
||||
|
||||
if (TryComp(uid, out AppearanceComponent? appearanceComponent))
|
||||
appearanceComponent.SetData(TwoWayLeverVisuals.State, component.State);
|
||||
if (TryComp(uid, out AppearanceComponent? appearance))
|
||||
_appearance.SetData(uid, TwoWayLeverVisuals.State, component.State, appearance);
|
||||
|
||||
var port = component.State switch
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ using Content.Server.Construction;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Robust.Server.Containers;
|
||||
|
||||
using Robust.Server.GameObjects;
|
||||
using static Content.Shared.MedicalScanner.SharedMedicalScannerComponent; // Hmm...
|
||||
|
||||
namespace Content.Server.Medical
|
||||
@@ -28,6 +28,7 @@ namespace Content.Server.Medical
|
||||
[Dependency] private readonly CloningConsoleSystem _cloningConsoleSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly ContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private const float UpdateRate = 1f;
|
||||
private float _updateDif;
|
||||
@@ -181,7 +182,7 @@ namespace Content.Server.Medical
|
||||
{
|
||||
if (TryComp<AppearanceComponent>(scannerComponent.Owner, out var appearance))
|
||||
{
|
||||
appearance.SetData(MedicalScannerVisuals.Status, GetStatus(scannerComponent));
|
||||
_appearance.SetData(uid, MedicalScannerVisuals.Status, GetStatus(scannerComponent), appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,12 +41,17 @@ public sealed class CrematoriumSystem : EntitySystem
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
if (appearance.TryGetData(CrematoriumVisuals.Burning, out bool isBurning) && isBurning)
|
||||
if (_appearance.TryGetData<bool>(uid, CrematoriumVisuals.Burning, out var isBurning, appearance) && isBurning)
|
||||
args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-is-burning", ("owner", uid)));
|
||||
if (appearance.TryGetData(StorageVisuals.HasContents, out bool hasContents) && hasContents)
|
||||
|
||||
if (_appearance.TryGetData<bool>(uid, StorageVisuals.HasContents, out var hasContents, appearance) && hasContents)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-has-contents"));
|
||||
}
|
||||
else
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-empty"));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAttemptOpen(EntityUid uid, ActiveCrematoriumComponent component, StorageOpenAttemptEvent args)
|
||||
|
||||
@@ -24,13 +24,10 @@ public sealed class MorgueSystem : EntitySystem
|
||||
/// </summary>
|
||||
private void OnExamine(EntityUid uid, MorgueComponent component, ExaminedEvent args)
|
||||
{
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
if (!args.IsInDetailsRange)
|
||||
return;
|
||||
|
||||
appearance.TryGetData(MorgueVisuals.Contents, out MorgueContents contents);
|
||||
_appearance.TryGetData<MorgueContents>(uid, MorgueVisuals.Contents, out var contents);
|
||||
|
||||
var text = contents switch
|
||||
{
|
||||
@@ -92,7 +89,7 @@ public sealed class MorgueSystem : EntitySystem
|
||||
|
||||
comp.AccumulatedFrameTime -= comp.BeepTime;
|
||||
|
||||
if (comp.DoSoulBeep && appearance.TryGetData(MorgueVisuals.Contents, out MorgueContents contents) && contents == MorgueContents.HasSoul)
|
||||
if (comp.DoSoulBeep && _appearance.TryGetData<MorgueContents>(appearance.Owner, MorgueVisuals.Contents, out var contents, appearance) && contents == MorgueContents.HasSoul)
|
||||
{
|
||||
_audio.PlayPvs(comp.OccupantHasSoulAlarmSound, comp.Owner);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Shared.Inventory;
|
||||
using Content.Shared.Mousetrap;
|
||||
using Content.Shared.StepTrigger;
|
||||
using Content.Shared.StepTrigger.Systems;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -14,6 +15,7 @@ namespace Content.Server.Mousetrap;
|
||||
public sealed class MousetrapSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -66,7 +68,7 @@ public sealed class MousetrapSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
appearance.SetData(MousetrapVisuals.Visual,
|
||||
mousetrap.IsActive ? MousetrapVisuals.Armed : MousetrapVisuals.Unarmed);
|
||||
_appearance.SetData(uid, MousetrapVisuals.Visual,
|
||||
mousetrap.IsActive ? MousetrapVisuals.Armed : MousetrapVisuals.Unarmed, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
[Dependency] private readonly ClothingSystem _clothing = default!;
|
||||
[Dependency] private readonly SharedItemSystem _items = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private const float UpdateTimer = 3f;
|
||||
|
||||
@@ -54,7 +55,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
return;
|
||||
|
||||
smokable.State = state;
|
||||
appearance.SetData(SmokingVisuals.Smoking, state);
|
||||
_appearance.SetData(uid, SmokingVisuals.Smoking, state, appearance);
|
||||
|
||||
var newState = state switch
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Content.Server.PAI
|
||||
{
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly InstrumentSystem _instrumentSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -75,7 +76,7 @@ namespace Content.Server.PAI
|
||||
// But having the pda's name permanently be "old lady's PAI" is weird.
|
||||
// Changing the PAI's identity in a way that ties it to the owner's identity also seems weird.
|
||||
// Cause then you could remotely figure out information about the owner's equipped items.
|
||||
|
||||
|
||||
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName = val;
|
||||
|
||||
var ghostFinder = EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid);
|
||||
@@ -126,7 +127,7 @@ namespace Content.Server.PAI
|
||||
{
|
||||
if (EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
appearance.SetData(PAIVisuals.Status, status);
|
||||
_appearance.SetData(uid, PAIVisuals.Status, status, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Content.Server.PDA
|
||||
case PDAToggleFlashlightMessage _:
|
||||
{
|
||||
if (EntityManager.TryGetComponent(pda.Owner, out UnpoweredFlashlightComponent? flashlight))
|
||||
_unpoweredFlashlight.ToggleLight(flashlight);
|
||||
_unpoweredFlashlight.ToggleLight(flashlight.Owner, flashlight);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Content.Server.Paper
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -40,10 +41,10 @@ namespace Content.Server.Paper
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
if (paperComp.Content != "")
|
||||
appearance.SetData(PaperVisuals.Status, PaperStatus.Written);
|
||||
_appearance.SetData(uid, PaperVisuals.Status, PaperStatus.Written, appearance);
|
||||
|
||||
if (paperComp.StampState != null)
|
||||
appearance.SetData(PaperVisuals.Stamp, paperComp.StampState);
|
||||
_appearance.SetData(uid, PaperVisuals.Stamp, paperComp.StampState, appearance);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -111,7 +112,7 @@ namespace Content.Server.Paper
|
||||
paperComp.Content += text + '\n';
|
||||
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
appearance.SetData(PaperVisuals.Status, PaperStatus.Written);
|
||||
_appearance.SetData(uid, PaperVisuals.Status, PaperStatus.Written, appearance);
|
||||
|
||||
if (TryComp<MetaDataComponent>(uid, out var meta))
|
||||
meta.EntityDescription = "";
|
||||
@@ -137,7 +138,7 @@ namespace Content.Server.Paper
|
||||
if (paperComp.StampState == null && TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
paperComp.StampState = stampState;
|
||||
appearance.SetData(PaperVisuals.Stamp, paperComp.StampState);
|
||||
_appearance.SetData(uid, PaperVisuals.Stamp, paperComp.StampState, appearance);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -158,7 +159,7 @@ namespace Content.Server.Paper
|
||||
? PaperStatus.Blank
|
||||
: PaperStatus.Written;
|
||||
|
||||
appearance.SetData(PaperVisuals.Status, status);
|
||||
_appearance.SetData(uid, PaperVisuals.Status, status, appearance);
|
||||
}
|
||||
|
||||
public void UpdateUserInterface(EntityUid uid, PaperComponent? paperComp = null)
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly ExplosionSystem _explosion = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private EntityUid? RandomNearbyPlayer(EntityUid uid, RoguePointingArrowComponent? component = null, TransformComponent? transform = null)
|
||||
{
|
||||
@@ -39,7 +40,7 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
if (!Resolve(uid, ref component, ref transform, ref appearance) || component.Chasing == null)
|
||||
return;
|
||||
|
||||
appearance.SetData(RoguePointingArrowVisuals.Rotation, transform.LocalRotation.Degrees);
|
||||
_appearance.SetData(uid, RoguePointingArrowVisuals.Rotation, transform.LocalRotation.Degrees, appearance);
|
||||
}
|
||||
|
||||
public void SetTarget(EntityUid arrow, EntityUid target, RoguePointingArrowComponent? component = null)
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private const float ScrewTime = 2f;
|
||||
|
||||
@@ -114,7 +115,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
|
||||
if (appearance != null)
|
||||
{
|
||||
appearance.SetData(ApcVisuals.ChargeState, newState);
|
||||
_appearance.SetData(uid, ApcVisuals.ChargeState, newState, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +232,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
if (!Resolve(uid, ref appearance, ref apc, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(ApcVisuals.PanelState, GetPanelState(apc));
|
||||
_appearance.SetData(uid, ApcVisuals.PanelState, GetPanelState(apc), appearance);
|
||||
}
|
||||
|
||||
private sealed class ApcToolFinishedEvent : EntityEventArgs
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Server.Power.Components;
|
||||
using Content.Server.Power.Nodes;
|
||||
using Content.Shared.Wires;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Power.EntitySystems
|
||||
@@ -12,6 +13,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
public sealed class CableVisSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -55,7 +57,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
};
|
||||
}
|
||||
|
||||
appearance.SetData(WireVisVisuals.ConnectedMask, mask);
|
||||
_appearance.SetData(uid, WireVisVisuals.ConnectedMask, mask, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
public override StatusLightState? GetLightState(Wire wire)
|
||||
{
|
||||
if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.MainWire, out int main)
|
||||
if (WiresSystem.TryGetData<int>(wire.Owner, PowerWireActionKey.MainWire, out var main)
|
||||
&& main != wire.Id)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!AllWiresMended(wire.Owner)
|
||||
|| WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed)
|
||||
|| WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsed)
|
||||
&& pulsed)
|
||||
{
|
||||
return StatusLightState.BlinkingSlow;
|
||||
@@ -40,14 +40,14 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
private bool AllWiresCut(EntityUid owner)
|
||||
{
|
||||
return WiresSystem.TryGetData(owner, PowerWireActionKey.CutWires, out int? cut)
|
||||
&& WiresSystem.TryGetData(owner, PowerWireActionKey.WireCount, out int? count)
|
||||
return WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.CutWires, out var cut)
|
||||
&& WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.WireCount, out var count)
|
||||
&& count == cut;
|
||||
}
|
||||
|
||||
private bool AllWiresMended(EntityUid owner)
|
||||
{
|
||||
return WiresSystem.TryGetData(owner, PowerWireActionKey.CutWires, out int? cut)
|
||||
return WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.CutWires, out var cut)
|
||||
&& cut == 0;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WiresSystem.TryGetData(owner, PowerWireActionKey.Pulsed, out bool isPulsed)
|
||||
if (WiresSystem.TryGetData<bool>(owner, PowerWireActionKey.Pulsed, out var isPulsed)
|
||||
&& isPulsed)
|
||||
{
|
||||
return;
|
||||
@@ -84,8 +84,8 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
private void SetWireCuts(EntityUid owner, bool isCut)
|
||||
{
|
||||
if (WiresSystem.TryGetData(owner, PowerWireActionKey.CutWires, out int? cut)
|
||||
&& WiresSystem.TryGetData(owner, PowerWireActionKey.WireCount, out int? count))
|
||||
if (WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.CutWires, out var cut)
|
||||
&& WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.WireCount, out var count))
|
||||
{
|
||||
if (cut == count && isCut
|
||||
|| cut <= 0 && !isCut)
|
||||
@@ -131,7 +131,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
var activePulse = false;
|
||||
|
||||
if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed))
|
||||
if (WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsed))
|
||||
{
|
||||
activePulse = pulsed;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
var electrocuted = !TrySetElectrocution(user, wire, true);
|
||||
|
||||
if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsedKey) && pulsedKey)
|
||||
if (WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsedKey) && pulsedKey)
|
||||
return;
|
||||
|
||||
WiresSystem.SetData(wire.Owner, PowerWireActionKey.Pulsed, true);
|
||||
@@ -236,7 +236,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
if (!IsPowered(wire.Owner))
|
||||
{
|
||||
if (!WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed)
|
||||
if (!WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsed)
|
||||
|| !pulsed)
|
||||
{
|
||||
WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.ElectrifiedCancel);
|
||||
|
||||
@@ -26,7 +26,7 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
[Dependency] private readonly ChatSystem _chat = default!;
|
||||
[Dependency] private readonly RadioSystem _radio = default!;
|
||||
[Dependency] private readonly InteractionSystem _interaction = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
// Used to prevent a shitter from using a bunch of radios to spam chat.
|
||||
private HashSet<(string, EntityUid)> _recentlySent = new();
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.RandomAppearance;
|
||||
|
||||
public sealed class RandomAppearanceSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -17,7 +19,7 @@ public sealed class RandomAppearanceSystem : EntitySystem
|
||||
{
|
||||
if (TryComp(uid, out AppearanceComponent? appearance) && component.EnumKey != null)
|
||||
{
|
||||
appearance.SetData(component.EnumKey, _random.Pick(component.SpriteStates));
|
||||
_appearance.SetData(uid, component.EnumKey, _random.Pick(component.SpriteStates), appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace Content.Server.Security.Systems
|
||||
{
|
||||
public sealed class DeployableBarrierSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -19,23 +21,23 @@ namespace Content.Server.Security.Systems
|
||||
if (!EntityManager.TryGetComponent(component.Owner, out LockComponent? lockComponent))
|
||||
return;
|
||||
|
||||
ToggleBarrierDeploy(component, lockComponent.Locked);
|
||||
ToggleBarrierDeploy(uid, component, lockComponent.Locked);
|
||||
}
|
||||
|
||||
private void OnLockToggled(EntityUid uid, DeployableBarrierComponent component, LockToggledEvent args)
|
||||
{
|
||||
ToggleBarrierDeploy(component, args.Locked);
|
||||
ToggleBarrierDeploy(uid, component, args.Locked);
|
||||
}
|
||||
|
||||
private void ToggleBarrierDeploy(DeployableBarrierComponent component, bool isDeployed)
|
||||
private void ToggleBarrierDeploy(EntityUid uid, DeployableBarrierComponent component, bool isDeployed)
|
||||
{
|
||||
EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored = isDeployed;
|
||||
|
||||
if (!EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearanceComponent))
|
||||
if (!EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
var state = isDeployed ? DeployableBarrierState.Deployed : DeployableBarrierState.Idle;
|
||||
appearanceComponent.SetData(DeployableBarrierVisuals.State, state);
|
||||
_appearance.SetData(uid, DeployableBarrierVisuals.State, state, appearance);
|
||||
|
||||
if (EntityManager.TryGetComponent(component.Owner, out PointLightComponent? light))
|
||||
light.Enabled = isDeployed;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Content.Server.Audio;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.Power.Components;
|
||||
@@ -14,10 +13,8 @@ using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Temperature;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -26,11 +23,12 @@ namespace Content.Server.Shuttles.Systems
|
||||
{
|
||||
public sealed class ThrusterSystem : EntitySystem
|
||||
{
|
||||
[Robust.Shared.IoC.Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Robust.Shared.IoC.Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
|
||||
[Robust.Shared.IoC.Dependency] private readonly AmbientSoundSystem _ambient = default!;
|
||||
[Robust.Shared.IoC.Dependency] private readonly FixtureSystem _fixtureSystem = default!;
|
||||
[Robust.Shared.IoC.Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
|
||||
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
|
||||
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
// Essentially whenever thruster enables we update the shuttle's available impulses which are used for movement.
|
||||
// This is done for each direction available.
|
||||
@@ -276,9 +274,9 @@ namespace Content.Server.Shuttles.Systems
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearanceComponent.SetData(ThrusterVisualState.State, true);
|
||||
_appearance.SetData(uid, ThrusterVisualState.State, true, appearance);
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out PointLightComponent? pointLightComponent))
|
||||
@@ -329,9 +327,9 @@ namespace Content.Server.Shuttles.Systems
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearanceComponent.SetData(ThrusterVisualState.State, false);
|
||||
_appearance.SetData(uid, ThrusterVisualState.State, false, appearance);
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out PointLightComponent? pointLightComponent))
|
||||
@@ -439,11 +437,8 @@ namespace Content.Server.Shuttles.Systems
|
||||
|
||||
foreach (var comp in component.LinearThrusters[index])
|
||||
{
|
||||
if (!EntityManager.TryGetComponent((comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = true;
|
||||
appearanceComponent.SetData(ThrusterVisualState.Thrusting, true);
|
||||
_appearance.SetData(comp.Owner, ThrusterVisualState.Thrusting, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,11 +455,8 @@ namespace Content.Server.Shuttles.Systems
|
||||
|
||||
foreach (var comp in component.LinearThrusters[index])
|
||||
{
|
||||
if (!EntityManager.TryGetComponent((comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = false;
|
||||
appearanceComponent.SetData(ThrusterVisualState.Thrusting, false);
|
||||
_appearance.SetData(comp.Owner, ThrusterVisualState.Thrusting, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,22 +476,16 @@ namespace Content.Server.Shuttles.Systems
|
||||
{
|
||||
foreach (var comp in component.AngularThrusters)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent((comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = true;
|
||||
appearanceComponent.SetData(ThrusterVisualState.Thrusting, true);
|
||||
_appearance.SetData(comp.Owner, ThrusterVisualState.Thrusting, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var comp in component.AngularThrusters)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent((comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = false;
|
||||
appearanceComponent.SetData(ThrusterVisualState.Thrusting, false);
|
||||
_appearance.SetData(comp.Owner, ThrusterVisualState.Thrusting, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -518,7 +504,6 @@ namespace Content.Server.Shuttles.Systems
|
||||
|
||||
#endregion
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private int GetFlagIndex(DirectionFlag flag)
|
||||
{
|
||||
return (int) Math.Log2((int) flag);
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Singularity.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Shared.Radiation.Events;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -13,6 +14,8 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -78,7 +81,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
return;
|
||||
|
||||
var state = component.Enabled ? RadiationCollectorVisualState.Active : RadiationCollectorVisualState.Deactive;
|
||||
appearance.SetData(RadiationCollectorVisuals.VisualState, state);
|
||||
_appearance.SetData(uid, RadiationCollectorVisuals.VisualState, state, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Sticky.Components;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -18,6 +19,7 @@ public sealed class StickySystem : EntitySystem
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private const string StickerSlotId = "stickers_container";
|
||||
|
||||
@@ -172,7 +174,7 @@ public sealed class StickySystem : EntitySystem
|
||||
// send information to appearance that entity is stuck
|
||||
if (TryComp(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(StickyVisuals.IsStuck, true);
|
||||
_appearance.SetData(uid, StickyVisuals.IsStuck, true, appearance);
|
||||
}
|
||||
|
||||
component.StuckTo = target;
|
||||
@@ -200,7 +202,7 @@ public sealed class StickySystem : EntitySystem
|
||||
// send information to appearance that entity isn't stuck
|
||||
if (TryComp(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(StickyVisuals.IsStuck, false);
|
||||
_appearance.SetData(uid, StickyVisuals.IsStuck, false, appearance);
|
||||
}
|
||||
|
||||
// show message to user
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Rounding;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Storage.EntitySystems;
|
||||
|
||||
public sealed class StorageFillVisualizerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -40,6 +43,6 @@ public sealed class StorageFillVisualizerSystem : EntitySystem
|
||||
return;
|
||||
|
||||
var level = ContentHelpers.RoundToEqualLevels(storage.StorageUsed, storage.StorageCapacityMax, component.MaxFillLevels);
|
||||
appearance.SetData(StorageFillVisuals.FillLevel, level);
|
||||
_appearance.SetData(uid, StorageFillVisuals.FillLevel, level, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize()
|
||||
@@ -470,11 +471,11 @@ namespace Content.Server.Storage.EntitySystems
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(StorageVisuals.Open, storageComp.IsOpen);
|
||||
appearance.SetData(SharedBagOpenVisuals.BagState, storageComp.IsOpen ? SharedBagState.Open : SharedBagState.Closed);
|
||||
_appearance.SetData(uid, StorageVisuals.Open, storageComp.IsOpen, appearance);
|
||||
_appearance.SetData(uid, SharedBagOpenVisuals.BagState, storageComp.IsOpen ? SharedBagState.Open : SharedBagState.Closed, appearance);
|
||||
|
||||
if (HasComp<ItemCounterComponent>(uid))
|
||||
appearance.SetData(StackVisuals.Hide, !storageComp.IsOpen);
|
||||
_appearance.SetData(uid, StackVisuals.Hide, !storageComp.IsOpen, appearance);
|
||||
}
|
||||
|
||||
private void RecalculateStorageUsed(ServerStorageComponent storageComp)
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Item;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Toggleable;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -17,6 +18,7 @@ namespace Content.Server.Stunnable.Systems
|
||||
public sealed class StunbatonSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -50,7 +52,7 @@ namespace Content.Server.Stunnable.Systems
|
||||
if (battery.CurrentCharge < component.EnergyPerUse)
|
||||
{
|
||||
SoundSystem.Play(component.SparksSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), uid, AudioHelpers.WithVariation(0.25f));
|
||||
TurnOff(component);
|
||||
TurnOff(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +60,11 @@ namespace Content.Server.Stunnable.Systems
|
||||
{
|
||||
if (comp.Activated)
|
||||
{
|
||||
TurnOff(comp);
|
||||
TurnOff(uid, comp);
|
||||
}
|
||||
else
|
||||
{
|
||||
TurnOn(comp, args.User);
|
||||
TurnOn(uid, comp, args.User);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +79,7 @@ namespace Content.Server.Stunnable.Systems
|
||||
("charge", (int)((battery.CurrentCharge/battery.MaxCharge) * 100))));
|
||||
}
|
||||
|
||||
private void TurnOff(StunbatonComponent comp)
|
||||
private void TurnOff(EntityUid uid, StunbatonComponent comp)
|
||||
{
|
||||
if (!comp.Activated)
|
||||
return;
|
||||
@@ -86,7 +88,7 @@ namespace Content.Server.Stunnable.Systems
|
||||
TryComp<ItemComponent>(comp.Owner, out var item))
|
||||
{
|
||||
_item.SetHeldPrefix(comp.Owner, "off", item);
|
||||
appearance.SetData(ToggleVisuals.Toggled, false);
|
||||
_appearance.SetData(uid, ToggleVisuals.Toggled, false, appearance);
|
||||
}
|
||||
|
||||
SoundSystem.Play(comp.SparksSound.GetSound(), Filter.Pvs(comp.Owner), comp.Owner, AudioHelpers.WithVariation(0.25f));
|
||||
@@ -94,7 +96,7 @@ namespace Content.Server.Stunnable.Systems
|
||||
comp.Activated = false;
|
||||
}
|
||||
|
||||
private void TurnOn(StunbatonComponent comp, EntityUid user)
|
||||
private void TurnOn(EntityUid uid, StunbatonComponent comp, EntityUid user)
|
||||
{
|
||||
if (comp.Activated)
|
||||
return;
|
||||
@@ -111,7 +113,7 @@ namespace Content.Server.Stunnable.Systems
|
||||
EntityManager.TryGetComponent<ItemComponent>(comp.Owner, out var item))
|
||||
{
|
||||
_item.SetHeldPrefix(comp.Owner, "on", item);
|
||||
appearance.SetData(ToggleVisuals.Toggled, true);
|
||||
_appearance.SetData(uid, ToggleVisuals.Toggled, true, appearance);
|
||||
}
|
||||
|
||||
SoundSystem.Play(comp.SparksSound.GetSound(), playerFilter, comp.Owner, AudioHelpers.WithVariation(0.25f));
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.DeviceNetwork;
|
||||
using Content.Server.DeviceNetwork.Components;
|
||||
using Content.Server.DeviceNetwork.Systems;
|
||||
using Content.Server.Ghost.Components;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.DeviceNetwork;
|
||||
@@ -20,6 +18,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem
|
||||
[Dependency] private readonly ViewSubscriberSystem _viewSubscriberSystem = default!;
|
||||
[Dependency] private readonly DeviceNetworkSystem _deviceNetworkSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
// Pings a surveillance camera subnet. All cameras will always respond
|
||||
// with a data message if they are on the same subnet.
|
||||
@@ -371,10 +370,10 @@ public sealed class SurveillanceCameraSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateVisuals(EntityUid camera, SurveillanceCameraComponent? component = null, AppearanceComponent? appearance = null)
|
||||
private void UpdateVisuals(EntityUid uid, SurveillanceCameraComponent? component = null, AppearanceComponent? appearance = null)
|
||||
{
|
||||
// Don't log missing, because otherwise tests fail.
|
||||
if (!Resolve(camera, ref component, ref appearance, false))
|
||||
if (!Resolve(uid, ref component, ref appearance, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -391,7 +390,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem
|
||||
key = SurveillanceCameraVisuals.InUse;
|
||||
}
|
||||
|
||||
appearance.SetData(SurveillanceCameraVisualsKey.Key, key);
|
||||
_appearance.SetData(uid, SurveillanceCameraVisualsKey.Key, key, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Database;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Tools.Systems;
|
||||
|
||||
@@ -11,6 +12,7 @@ public sealed class WeldableSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -102,7 +104,7 @@ public sealed class WeldableSystem : EntitySystem
|
||||
|
||||
if (!TryComp(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
appearance.SetData(WeldableVisuals.IsWelded, component.IsWelded);
|
||||
_appearance.SetData(uid, WeldableVisuals.IsWelded, component.IsWelded, appearance);
|
||||
}
|
||||
|
||||
public void ForceWeldedState(EntityUid uid, bool state, WeldableComponent? component = null)
|
||||
|
||||
@@ -172,7 +172,7 @@ public sealed class WiresSystem : EntitySystem
|
||||
if (!d.Action.AddWire(d, types[actionType]))
|
||||
d.Action = null;
|
||||
}
|
||||
|
||||
|
||||
data.Add(id, new WireLayout.WireData(d.Letter, d.Color, i));
|
||||
wires.WiresList[i] = wireSet[id];
|
||||
}
|
||||
@@ -261,7 +261,7 @@ public sealed class WiresSystem : EntitySystem
|
||||
/// <param name="key">The key used to cancel the action.</param>
|
||||
public bool TryCancelWireAction(EntityUid owner, object key)
|
||||
{
|
||||
if (TryGetData(owner, key, out CancellationTokenSource? token))
|
||||
if (TryGetData<CancellationTokenSource?>(owner, key, out var token))
|
||||
{
|
||||
token.Cancel();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user