Remove some obsolete AppearanceComponent method usages (#13726)
This commit is contained in:
@@ -15,7 +15,7 @@ public sealed class AMEControllerVisualizerSystem : VisualizerSystem<AMEControll
|
||||
|
||||
private void OnComponentInit(EntityUid uid, AMEControllerVisualsComponent component, ComponentInit args)
|
||||
{
|
||||
if(TryComp<SpriteComponent>(uid, out var sprite))
|
||||
if (TryComp<SpriteComponent>(uid, out var sprite))
|
||||
{
|
||||
sprite.LayerMapSet(AMEControllerVisualLayers.Display, sprite.AddLayerState("control_on"));
|
||||
sprite.LayerSetVisible(AMEControllerVisualLayers.Display, false);
|
||||
@@ -26,30 +26,32 @@ public sealed class AMEControllerVisualizerSystem : VisualizerSystem<AMEControll
|
||||
{
|
||||
base.OnAppearanceChange(uid, component, ref args);
|
||||
|
||||
if(args.Sprite != null
|
||||
&& args.Component.TryGetData<string>(AMEControllerVisuals.DisplayState, out var state))
|
||||
if (args.Sprite == null
|
||||
|| !AppearanceSystem.TryGetData<string>(uid, AMEControllerVisuals.DisplayState, out var state, args.Component))
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case "on":
|
||||
args.Sprite.LayerSetState(AMEControllerVisualLayers.Display, "control_on");
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, true);
|
||||
break;
|
||||
case "critical":
|
||||
args.Sprite.LayerSetState(AMEControllerVisualLayers.Display, "control_critical");
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, true);
|
||||
break;
|
||||
case "fuck":
|
||||
args.Sprite.LayerSetState(AMEControllerVisualLayers.Display, "control_fuck");
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, true);
|
||||
break;
|
||||
case "off":
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, false);
|
||||
break;
|
||||
default:
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, false);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case "on":
|
||||
args.Sprite.LayerSetState(AMEControllerVisualLayers.Display, "control_on");
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, true);
|
||||
break;
|
||||
case "critical":
|
||||
args.Sprite.LayerSetState(AMEControllerVisualLayers.Display, "control_critical");
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, true);
|
||||
break;
|
||||
case "fuck":
|
||||
args.Sprite.LayerSetState(AMEControllerVisualLayers.Display, "control_fuck");
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, true);
|
||||
break;
|
||||
case "off":
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, false);
|
||||
break;
|
||||
default:
|
||||
args.Sprite.LayerSetVisible(AMEControllerVisualLayers.Display, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public sealed class AMEShieldingVisualizerSystem : VisualizerSystem<AMEShielding
|
||||
|
||||
private void OnComponentInit(EntityUid uid, AMEShieldingVisualsComponent component, ComponentInit args)
|
||||
{
|
||||
if(TryComp<SpriteComponent>(uid, out var sprite))
|
||||
if (TryComp<SpriteComponent>(uid, out var sprite))
|
||||
{
|
||||
sprite.LayerMapSet(AMEShieldingVisualsLayer.Core, sprite.AddLayerState("core"));
|
||||
sprite.LayerSetVisible(AMEShieldingVisualsLayer.Core, false);
|
||||
@@ -26,10 +26,10 @@ public sealed class AMEShieldingVisualizerSystem : VisualizerSystem<AMEShielding
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, AMEShieldingVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if(args.Sprite == null)
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if(args.Component.TryGetData<string>(AMEShieldVisuals.Core, out var core))
|
||||
if (AppearanceSystem.TryGetData<string>(uid, AMEShieldVisuals.Core, out var core, args.Component))
|
||||
{
|
||||
if (core == "isCore")
|
||||
{
|
||||
@@ -43,9 +43,9 @@ public sealed class AMEShieldingVisualizerSystem : VisualizerSystem<AMEShielding
|
||||
}
|
||||
}
|
||||
|
||||
if(args.Component.TryGetData<string>(AMEShieldVisuals.CoreState, out var coreState))
|
||||
if (AppearanceSystem.TryGetData<string>(uid, AMEShieldVisuals.CoreState, out var coreState, args.Component))
|
||||
{
|
||||
switch(coreState)
|
||||
switch (coreState)
|
||||
{
|
||||
case "weak":
|
||||
args.Sprite.LayerSetState(AMEShieldingVisualsLayer.CoreState, "core_weak");
|
||||
|
||||
@@ -22,10 +22,10 @@ public sealed class AnomalySystem : SharedAnomalySystem
|
||||
if (args.Sprite is not { } sprite)
|
||||
return;
|
||||
|
||||
if (!Appearance.TryGetData(uid, AnomalyVisuals.IsPulsing, out bool pulsing, args.Component))
|
||||
if (!Appearance.TryGetData<bool>(uid, AnomalyVisuals.IsPulsing, out var pulsing, args.Component))
|
||||
pulsing = false;
|
||||
|
||||
if (Appearance.TryGetData(uid, AnomalyVisuals.Supercritical, out bool super, args.Component) && super)
|
||||
if (Appearance.TryGetData<bool>(uid, AnomalyVisuals.Supercritical, out var super, args.Component) && super)
|
||||
pulsing = super;
|
||||
|
||||
if (HasComp<AnomalySupercriticalComponent>(uid))
|
||||
|
||||
@@ -2,7 +2,6 @@ using Content.Client.SubFloor;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Components;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
using Content.Shared.SubFloor;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.ResourceManagement;
|
||||
@@ -13,6 +12,7 @@ namespace Content.Client.Atmos.EntitySystems;
|
||||
public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -56,10 +56,10 @@ public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.Component.TryGetData(PipeColorVisuals.Color, out Color color))
|
||||
if (!_appearance.TryGetData<Color>(uid, PipeColorVisuals.Color, out var color, args.Component))
|
||||
color = Color.White;
|
||||
|
||||
if (!args.Component.TryGetData(PipeVisuals.VisualState, out PipeDirection worldConnectedDirections))
|
||||
if (!_appearance.TryGetData<PipeDirection>(uid, PipeVisuals.VisualState, out var worldConnectedDirections, args.Component))
|
||||
return;
|
||||
|
||||
// transform connected directions to local-coordinates
|
||||
|
||||
@@ -56,8 +56,8 @@ public sealed class FireVisualizerSystem : VisualizerSystem<FireVisualsComponent
|
||||
if (!sprite.LayerMapTryGet(FireVisualLayers.Fire, out var index))
|
||||
return;
|
||||
|
||||
appearance.TryGetData(FireVisuals.OnFire, out bool onFire);
|
||||
appearance.TryGetData(FireVisuals.FireStacks, out float fireStacks);
|
||||
AppearanceSystem.TryGetData<bool>(uid, FireVisuals.OnFire, out var onFire, appearance);
|
||||
AppearanceSystem.TryGetData<float>(uid, FireVisuals.FireStacks, out var fireStacks, appearance);
|
||||
sprite.LayerSetVisible(index, onFire);
|
||||
|
||||
if (!onFire)
|
||||
|
||||
@@ -8,8 +8,8 @@ public sealed class PipeColorVisualizerSystem : VisualizerSystem<PipeColorVisual
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, PipeColorVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if(TryComp<SpriteComponent>(uid, out var sprite)
|
||||
&& args.Component.TryGetData<Color>(PipeColorVisuals.Color, out var color))
|
||||
if (TryComp<SpriteComponent>(uid, out var sprite)
|
||||
&& AppearanceSystem.TryGetData<Color>(uid, PipeColorVisuals.Color, out var color, args.Component))
|
||||
{
|
||||
// T-ray scanner / sub floor runs after this visualizer. Lets not bulldoze transparency.
|
||||
var layer = sprite[PipeVisualLayers.Pipe];
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace Content.Client.Atmos.Visualizers
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(PortableScrubberVisuals.IsFull, out bool isFull)
|
||||
&& args.Component.TryGetData(PortableScrubberVisuals.IsRunning, out bool isRunning))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, PortableScrubberVisuals.IsFull, out var isFull, args.Component)
|
||||
&& AppearanceSystem.TryGetData<bool>(uid, PortableScrubberVisuals.IsRunning, out var isRunning, args.Component))
|
||||
{
|
||||
var runningState = isRunning ? component.RunningState : component.IdleState;
|
||||
args.Sprite.LayerSetState(PortableScrubberVisualLayers.IsRunning, runningState);
|
||||
@@ -24,7 +24,7 @@ namespace Content.Client.Atmos.Visualizers
|
||||
args.Sprite.LayerSetState(PowerDeviceVisualLayers.Powered, fullState);
|
||||
}
|
||||
|
||||
if (args.Component.TryGetData(PortableScrubberVisuals.IsDraining, out bool isDraining))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, PortableScrubberVisuals.IsDraining, out var isDraining, args.Component))
|
||||
{
|
||||
args.Sprite.LayerSetVisible(PortableScrubberVisualLayers.IsDraining, isDraining);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public sealed class BarSignSystem : VisualizerSystem<BarSignComponent>
|
||||
if (!Resolve(sign.Owner, ref appearance, ref sprite))
|
||||
return;
|
||||
|
||||
appearance.TryGetData(PowerDeviceVisuals.Powered, out bool powered);
|
||||
AppearanceSystem.TryGetData<bool>(sign.Owner, PowerDeviceVisuals.Powered, out var powered, appearance);
|
||||
|
||||
if (powered
|
||||
&& sign.CurrentSign != null
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
using Content.Shared.Bed;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Bed
|
||||
namespace Content.Client.Bed;
|
||||
|
||||
public sealed class StasisBedSystem : VisualizerSystem<StasisBedVisualsComponent>
|
||||
{
|
||||
public sealed class StasisBedSystem : VisualizerSystem<StasisBedVisualsComponent>
|
||||
protected override void OnAppearanceChange(EntityUid uid, StasisBedVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, StasisBedVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
if (args.Sprite != null
|
||||
&& AppearanceSystem.TryGetData<bool>(uid, StasisBedVisuals.IsOn, out var isOn, args.Component))
|
||||
{
|
||||
if (args.Sprite != null
|
||||
&& args.Component.TryGetData(StasisBedVisuals.IsOn, out bool isOn))
|
||||
{
|
||||
args.Sprite.LayerSetVisible(StasisBedVisualLayers.IsOn, isOn);
|
||||
}
|
||||
args.Sprite.LayerSetVisible(StasisBedVisualLayers.IsOn, isOn);
|
||||
}
|
||||
}
|
||||
|
||||
public enum StasisBedVisualLayers : byte
|
||||
{
|
||||
IsOn,
|
||||
}
|
||||
}
|
||||
|
||||
public enum StasisBedVisualLayers : byte
|
||||
{
|
||||
IsOn,
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ public sealed class PlantHolderVisualizerSystem : VisualizerSystem<PlantHolderVi
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData<string>(PlantHolderVisuals.PlantRsi, out var rsi)
|
||||
&& args.Component.TryGetData<string>(PlantHolderVisuals.PlantState, out var state))
|
||||
if (AppearanceSystem.TryGetData<string>(uid, PlantHolderVisuals.PlantRsi, out var rsi, args.Component)
|
||||
&& AppearanceSystem.TryGetData<string>(uid, PlantHolderVisuals.PlantState, out var state, args.Component))
|
||||
{
|
||||
var valid = !string.IsNullOrWhiteSpace(state);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public sealed class PotencyVisualsSystem : VisualizerSystem<PotencyVisualsCompon
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(ProduceVisuals.Potency, out float potency))
|
||||
if (AppearanceSystem.TryGetData<float>(uid, ProduceVisuals.Potency, out var potency, args.Component))
|
||||
{
|
||||
var scale = MathHelper.Lerp(component.MinimumScale, component.MaximumScale, potency / 100);
|
||||
args.Sprite.Scale = new Vector2(scale, scale);
|
||||
|
||||
@@ -10,8 +10,8 @@ public sealed class ItemCabinetSystem : VisualizerSystem<ItemCabinetVisualsCompo
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(ItemCabinetVisuals.IsOpen, out bool isOpen)
|
||||
&& args.Component.TryGetData(ItemCabinetVisuals.ContainsItem, out bool contains))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, ItemCabinetVisuals.IsOpen, out var isOpen, args.Component)
|
||||
&& AppearanceSystem.TryGetData<bool>(uid, ItemCabinetVisuals.ContainsItem, out var contains, args.Component))
|
||||
{
|
||||
var state = isOpen ? component.OpenState : component.ClosedState;
|
||||
args.Sprite.LayerSetState(ItemCabinetVisualLayers.Door, state);
|
||||
|
||||
@@ -67,7 +67,7 @@ public sealed partial class CargoSystem
|
||||
if (!Resolve(component.Owner, ref sprite))
|
||||
return;
|
||||
|
||||
_appearance.TryGetData(component.Owner, CargoTelepadVisuals.State, out CargoTelepadState? state);
|
||||
_appearance.TryGetData<CargoTelepadState?>(component.Owner, CargoTelepadVisuals.State, out var state);
|
||||
AnimationPlayerComponent? player = null;
|
||||
|
||||
switch (state)
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed class TypingIndicatorVisualizerSystem : VisualizerSystem<TypingInd
|
||||
return;
|
||||
}
|
||||
|
||||
args.Component.TryGetData(TypingIndicatorVisuals.IsTyping, out bool isTyping);
|
||||
AppearanceSystem.TryGetData<bool>(uid, TypingIndicatorVisuals.IsTyping, out var isTyping, args.Component);
|
||||
var layerExists = args.Sprite.LayerMapTryGet(TypingIndicatorLayers.Base, out var layer);
|
||||
if (!layerExists)
|
||||
layer = args.Sprite.LayerMapReserveBlank(TypingIndicatorLayers.Base);
|
||||
|
||||
@@ -5,11 +5,9 @@ namespace Content.Client.Chemistry.Visualizers;
|
||||
|
||||
public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionContainerVisualsComponent>
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (!_appearance.TryGetData(uid, SolutionContainerVisuals.FillFraction, out float fraction, args.Component))
|
||||
if (!AppearanceSystem.TryGetData<float>(uid, SolutionContainerVisuals.FillFraction, out var fraction, args.Component))
|
||||
return;
|
||||
|
||||
if (args.Sprite == null)
|
||||
@@ -39,7 +37,7 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
|
||||
var stateName = component.FillBaseName + closestFillSprite;
|
||||
args.Sprite.LayerSetState(fillLayer, stateName);
|
||||
|
||||
if (component.ChangeColor && _appearance.TryGetData(uid, SolutionContainerVisuals.Color, out Color color, args.Component))
|
||||
if (component.ChangeColor && AppearanceSystem.TryGetData<Color>(uid, SolutionContainerVisuals.Color, out var color, args.Component))
|
||||
args.Sprite.LayerSetColor(fillLayer, color);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -45,7 +45,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
|
||||
[Dependency] private readonly IResourceCache _cache = default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -345,7 +345,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
|
||||
// If this was passed into the component, we update
|
||||
// the data to ensure that the current disabled
|
||||
// bool matches.
|
||||
if (args.Component.TryGetData<bool>(DamageVisualizerKeys.Disabled, out var disabledStatus))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, DamageVisualizerKeys.Disabled, out var disabledStatus, args.Component))
|
||||
damageVisComp.Disabled = disabledStatus;
|
||||
|
||||
if (damageVisComp.Disabled)
|
||||
@@ -366,7 +366,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
|
||||
if (damageVisComp.Overlay && damageVisComp.DamageOverlayGroups != null && damageVisComp.TargetLayers == null)
|
||||
CheckOverlayOrdering(spriteComponent, damageVisComp);
|
||||
|
||||
if (component.TryGetData<bool>(DamageVisualizerKeys.ForceUpdate, out var update)
|
||||
if (AppearanceSystem.TryGetData<bool>(component.Owner, DamageVisualizerKeys.ForceUpdate, out var update, component)
|
||||
&& update)
|
||||
{
|
||||
ForceUpdateLayers(damageComponent, spriteComponent, damageVisComp);
|
||||
@@ -377,7 +377,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
|
||||
{
|
||||
UpdateDamageVisuals(damageComponent, spriteComponent, damageVisComp);
|
||||
}
|
||||
else if (component.TryGetData(DamageVisualizerKeys.DamageUpdateGroups, out DamageVisualizerGroupData data))
|
||||
else if (AppearanceSystem.TryGetData<DamageVisualizerGroupData>(component.Owner, DamageVisualizerKeys.DamageUpdateGroups, out var data, component))
|
||||
{
|
||||
UpdateDamageVisuals(data.GroupList, damageComponent, spriteComponent, damageVisComp);
|
||||
}
|
||||
@@ -394,7 +394,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
|
||||
foreach (var layer in damageVisComp.TargetLayerMapKeys)
|
||||
{
|
||||
bool? layerStatus = null;
|
||||
if (component.TryGetData<bool>(layer, out var layerStateEnum))
|
||||
if (AppearanceSystem.TryGetData<bool>(component.Owner, layer, out var layerStateEnum, component))
|
||||
layerStatus = layerStateEnum;
|
||||
|
||||
if (layerStatus == null)
|
||||
|
||||
@@ -10,7 +10,7 @@ public sealed class DamageStateVisualizerSystem : VisualizerSystem<DamageStateVi
|
||||
{
|
||||
var sprite = args.Sprite;
|
||||
|
||||
if (sprite == null || !args.Component.TryGetData(MobStateVisuals.State, out MobState data))
|
||||
if (sprite == null || !AppearanceSystem.TryGetData<MobState>(uid, MobStateVisuals.State, out var data, args.Component))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace Content.Client.Disease
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(DiseaseMachineVisuals.IsOn, out bool isOn)
|
||||
&& args.Component.TryGetData(DiseaseMachineVisuals.IsRunning, out bool isRunning))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, DiseaseMachineVisuals.IsOn, out var isOn, args.Component)
|
||||
&& AppearanceSystem.TryGetData<bool>(uid, DiseaseMachineVisuals.IsRunning, out var isRunning, args.Component))
|
||||
{
|
||||
var state = isRunning ? component.RunningState : component.IdleState;
|
||||
args.Sprite.LayerSetVisible(DiseaseMachineVisualLayers.IsOn, isOn);
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace Content.Client.Ensnaring.Visualizers;
|
||||
|
||||
public sealed class EnsnareableSystem : SharedEnsnareableSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -28,7 +30,7 @@ public sealed class EnsnareableSystem : SharedEnsnareableSystem
|
||||
if (args.Sprite == null || !args.Sprite.LayerMapTryGet(EnsnaredVisualLayers.Ensnared, out var layer))
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(EnsnareableVisuals.IsEnsnared, out bool isEnsnared))
|
||||
if (_appearance.TryGetData<bool>(uid, EnsnareableVisuals.IsEnsnared, out var isEnsnared, args.Component))
|
||||
{
|
||||
if (component.Sprite != null)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Content.Client.Explosion;
|
||||
public sealed partial class TriggerSystem
|
||||
{
|
||||
[Dependency] private readonly AnimationPlayerSystem _player = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
/*
|
||||
* Currently all of the appearance stuff is hardcoded for portable flashers
|
||||
@@ -53,7 +54,7 @@ public sealed partial class TriggerSystem
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance)) return;
|
||||
|
||||
// So animation doesn't get spammed if no server state comes in.
|
||||
appearance.SetData(ProximityTriggerVisualState.State, ProximityTriggerVisuals.Inactive);
|
||||
_appearance.SetData(uid, ProximityTriggerVisualState.State, ProximityTriggerVisuals.Inactive, appearance);
|
||||
OnChangeData(uid, component, appearance);
|
||||
}
|
||||
|
||||
@@ -73,7 +74,7 @@ public sealed partial class TriggerSystem
|
||||
return;
|
||||
|
||||
TryComp<AnimationPlayerComponent>(component.Owner, out var player);
|
||||
appearance.TryGetData(ProximityTriggerVisualState.State, out ProximityTriggerVisuals state);
|
||||
_appearance.TryGetData<ProximityTriggerVisuals>(appearance.Owner, ProximityTriggerVisualState.State, out var state, appearance);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
|
||||
@@ -22,11 +22,6 @@ namespace Content.Client.Fluids
|
||||
|
||||
private void OnComponentInit(EntityUid uid, PuddleVisualizerComponent puddleVisuals, ComponentInit args)
|
||||
{
|
||||
if (!TryComp(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
@@ -45,10 +40,10 @@ namespace Content.Client.Fluids
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale)
|
||||
|| !args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume)
|
||||
|| !args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor)
|
||||
|| !args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating))
|
||||
if (!AppearanceSystem.TryGetData<float>(uid, PuddleVisuals.VolumeScale, out var volumeScale)
|
||||
|| !AppearanceSystem.TryGetData<FixedPoint2>(uid, PuddleVisuals.CurrentVolume, out var currentVolume)
|
||||
|| !AppearanceSystem.TryGetData<Color>(uid, PuddleVisuals.SolutionColor, out var solutionColor)
|
||||
|| !AppearanceSystem.TryGetData<bool>(uid, PuddleVisuals.IsEvaporatingVisual, out var isEvaporating))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
using Content.Shared.Kudzu;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Kudzu
|
||||
namespace Content.Client.Kudzu;
|
||||
|
||||
public sealed class KudzuVisualsSystem : VisualizerSystem<KudzuVisualsComponent>
|
||||
{
|
||||
|
||||
public sealed class KudzuVisualsSystem : VisualizerSystem<KudzuVisualsComponent>
|
||||
protected override void OnAppearanceChange(EntityUid uid, KudzuVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, KudzuVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
if (args.Component.TryGetData(KudzuVisuals.Variant, out int var)
|
||||
&& args.Component.TryGetData(KudzuVisuals.GrowthLevel, out int level))
|
||||
{
|
||||
var index = args.Sprite.LayerMapReserveBlank(component.Layer);
|
||||
args.Sprite.LayerSetState(index, $"kudzu_{level}{var}");
|
||||
}
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
if (AppearanceSystem.TryGetData<int>(uid, KudzuVisuals.Variant, out var var, args.Component)
|
||||
&& AppearanceSystem.TryGetData<int>(uid, KudzuVisuals.GrowthLevel, out var level, args.Component))
|
||||
{
|
||||
var index = args.Sprite.LayerMapReserveBlank(component.Layer);
|
||||
args.Sprite.LayerSetState(index, $"kudzu_{level}{var}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Client.Lathe;
|
||||
|
||||
public sealed class LatheSystem : SharedLatheSystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -22,14 +22,14 @@ public sealed class LatheSystem : SharedLatheSystem
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (_appearance.TryGetData(uid, PowerDeviceVisuals.Powered, out bool powered, args.Component) &&
|
||||
if (_appearance.TryGetData<bool>(uid, PowerDeviceVisuals.Powered, out var powered, args.Component) &&
|
||||
args.Sprite.LayerMapTryGet(PowerDeviceVisualLayers.Powered, out _))
|
||||
{
|
||||
args.Sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
|
||||
}
|
||||
|
||||
// Lathe specific stuff
|
||||
if (_appearance.TryGetData(uid, LatheVisuals.IsRunning, out bool isRunning, args.Component))
|
||||
if (_appearance.TryGetData<bool>(uid, LatheVisuals.IsRunning, out var isRunning, args.Component))
|
||||
{
|
||||
var state = isRunning ? component.RunningState : component.IdleState;
|
||||
args.Sprite.LayerSetAnimationTime(LatheVisualLayers.IsRunning, 0f);
|
||||
|
||||
@@ -32,12 +32,12 @@ public sealed class HandheldLightSystem : SharedHandheldLightSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_appearance.TryGetData(uid, ToggleableLightVisuals.Enabled, out bool enabled, args.Component))
|
||||
if (!_appearance.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, args.Component))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_appearance.TryGetData(uid, HandheldLightVisuals.Power, out HandheldLightPowerStates state, args.Component))
|
||||
if (!_appearance.TryGetData<HandheldLightPowerStates>(uid, HandheldLightVisuals.Power, out var state, args.Component))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem
|
||||
if (!args.Sprite.LayerMapTryGet(MaterialStorageVisualLayers.Inserting, out var layer))
|
||||
return;
|
||||
|
||||
if (!_appearance.TryGetData(uid, MaterialStorageVisuals.Inserting, out bool inserting, args.Component))
|
||||
if (!_appearance.TryGetData<bool>(uid, MaterialStorageVisuals.Inserting, out var inserting, args.Component))
|
||||
return;
|
||||
|
||||
if (inserting && TryComp<InsertingMaterialStorageComponent>(uid, out var insertingComp))
|
||||
|
||||
@@ -14,7 +14,7 @@ public sealed class MechAssemblyVisualizerSystem : VisualizerSystem<MechAssembly
|
||||
{
|
||||
base.OnAppearanceChange(uid, component, ref args);
|
||||
|
||||
if (!args.Component.TryGetData(MechAssemblyVisuals.State, out int stage))
|
||||
if (!AppearanceSystem.TryGetData<int>(uid, MechAssemblyVisuals.State, out var stage, args.Component))
|
||||
return;
|
||||
|
||||
var state = component.StatePrefix + stage;
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace Content.Client.Mech;
|
||||
/// <inheritdoc/>
|
||||
public sealed class MechSystem : SharedMechSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -26,12 +28,12 @@ public sealed class MechSystem : SharedMechSystem
|
||||
|
||||
var state = component.BaseState;
|
||||
var drawDepth = DrawDepth.Mobs;
|
||||
if (component.BrokenState != null && args.Component.TryGetData(MechVisuals.Broken, out bool broken) && broken)
|
||||
if (component.BrokenState != null && _appearance.TryGetData<bool>(uid, MechVisuals.Broken, out var broken, args.Component) && broken)
|
||||
{
|
||||
state = component.BrokenState;
|
||||
drawDepth = DrawDepth.SmallMobs;
|
||||
}
|
||||
else if (component.OpenState != null && args.Component.TryGetData(MechVisuals.Open, out bool open) && open)
|
||||
else if (component.OpenState != null && _appearance.TryGetData<bool>(uid, MechVisuals.Open, out var open, args.Component) && open)
|
||||
{
|
||||
state = component.OpenState;
|
||||
drawDepth = DrawDepth.SmallMobs;
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace Content.Client.Medical.Cryogenics;
|
||||
|
||||
public sealed class CryoPodSystem: SharedCryoPodSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -54,8 +56,8 @@ public sealed class CryoPodSystem: SharedCryoPodSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.Component.TryGetData(SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, out bool isOpen)
|
||||
|| !args.Component.TryGetData(SharedCryoPodComponent.CryoPodVisuals.IsOn, out bool isOn))
|
||||
if (!_appearance.TryGetData<bool>(uid, SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component)
|
||||
|| !_appearance.TryGetData<bool>(uid, SharedCryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public sealed class JetpackSystem : SharedJetpackSystem
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly ClothingSystem _clothing = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -29,7 +30,7 @@ public sealed class JetpackSystem : SharedJetpackSystem
|
||||
|
||||
private void OnJetpackAppearance(EntityUid uid, JetpackComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
args.Component.TryGetData(JetpackVisuals.Enabled, out bool enabled);
|
||||
_appearance.TryGetData<bool>(uid, JetpackVisuals.Enabled, out var enabled, args.Component);
|
||||
|
||||
var state = "icon" + (enabled ? "-on" : "");
|
||||
args.Sprite?.LayerSetState(0, state);
|
||||
|
||||
@@ -11,10 +11,10 @@ public sealed class PaperSystem : VisualizerSystem<PaperVisualsComponent>
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(PaperVisuals.Status , out PaperStatus writingStatus))
|
||||
if (AppearanceSystem.TryGetData<PaperStatus>(uid, PaperVisuals.Status , out var writingStatus, args.Component))
|
||||
args.Sprite.LayerSetVisible(PaperVisualLayers.Writing, writingStatus == PaperStatus.Written);
|
||||
|
||||
if (args.Component.TryGetData(PaperVisuals.Stamp, out string stampState))
|
||||
if (AppearanceSystem.TryGetData<string>(uid, PaperVisuals.Stamp, out var stampState, args.Component))
|
||||
{
|
||||
args.Sprite.LayerSetState(PaperVisualLayers.Stamp, stampState);
|
||||
args.Sprite.LayerSetVisible(PaperVisualLayers.Stamp, true);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Client.Pinpointer
|
||||
public sealed class ClientPinpointerSystem : SharedPinpointerSystem
|
||||
{
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Client.Pinpointer
|
||||
return;
|
||||
|
||||
// check if pinpointer screen is active
|
||||
if (!args.Component.TryGetData(PinpointerVisuals.IsActive, out bool isActive) || !isActive)
|
||||
if (!AppearanceSystem.TryGetData<bool>(uid, PinpointerVisuals.IsActive, out var isActive, args.Component) || !isActive)
|
||||
{
|
||||
sprite.LayerSetVisible(PinpointerLayers.Screen, false);
|
||||
return;
|
||||
@@ -24,8 +24,8 @@ namespace Content.Client.Pinpointer
|
||||
sprite.LayerSetVisible(PinpointerLayers.Screen, true);
|
||||
|
||||
// check distance and direction to target
|
||||
if (!args.Component.TryGetData(PinpointerVisuals.TargetDistance, out Distance dis) ||
|
||||
!args.Component.TryGetData(PinpointerVisuals.ArrowAngle, out Angle angle))
|
||||
if (!AppearanceSystem.TryGetData<Distance>(uid, PinpointerVisuals.TargetDistance, out var dis, args.Component) ||
|
||||
!AppearanceSystem.TryGetData<Angle>(uid, PinpointerVisuals.ArrowAngle, out var angle, args.Component))
|
||||
{
|
||||
sprite.LayerSetState(PinpointerLayers.Screen, "pinonnull");
|
||||
sprite.LayerSetRotation(PinpointerLayers.Screen, Angle.Zero);
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
using Content.Client.SubFloor;
|
||||
using Content.Shared.SubFloor;
|
||||
using Content.Shared.Wires;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Power.Visualizers;
|
||||
|
||||
public sealed partial class CableVisualizerSystem : EntitySystem
|
||||
public sealed class CableVisualizerSystem : VisualizerSystem<CableVisualizerComponent>
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CableVisualizerComponent, AppearanceChangeEvent>(OnAppearanceChanged, after: new[] { typeof(SubFloorHideSystem) });
|
||||
SubscribeLocalEvent<CableVisualizerComponent, AppearanceChangeEvent>(OnAppearanceChange, after: new[] { typeof(SubFloorHideSystem) });
|
||||
}
|
||||
|
||||
private void OnAppearanceChanged(EntityUid uid, CableVisualizerComponent component, ref AppearanceChangeEvent args)
|
||||
protected override void OnAppearanceChange(EntityUid uid, CableVisualizerComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
@@ -26,10 +23,9 @@ public sealed partial class CableVisualizerSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.Component.TryGetData(WireVisVisuals.ConnectedMask, out WireVisDirFlags mask))
|
||||
if (!AppearanceSystem.TryGetData<WireVisDirFlags>(uid, WireVisVisuals.ConnectedMask, out var mask, args.Component))
|
||||
mask = WireVisDirFlags.None;
|
||||
|
||||
args.Sprite.LayerSetState(0, $"{component.StatePrefix}{(int) mask}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace Content.Client.PowerCell;
|
||||
[UsedImplicitly]
|
||||
public sealed class PowerCellSystem : SharedPowerCellSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -21,7 +23,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
|
||||
if (!args.Sprite.TryGetLayer((int) PowerCellVisualLayers.Unshaded, out var unshadedLayer))
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(PowerCellVisuals.ChargeLevel, out byte level))
|
||||
if (_appearance.TryGetData<byte>(uid, PowerCellVisuals.ChargeLevel, out var level, args.Component))
|
||||
{
|
||||
if (level == 0)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace Content.Client.Revenant;
|
||||
|
||||
public sealed class RevenantSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -18,15 +20,15 @@ public sealed class RevenantSystem : EntitySystem
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(RevenantVisuals.Harvesting, out bool harvesting) && harvesting)
|
||||
if (_appearance.TryGetData<bool>(uid, RevenantVisuals.Harvesting, out var harvesting, args.Component) && harvesting)
|
||||
{
|
||||
args.Sprite.LayerSetState(0, component.HarvestingState);
|
||||
}
|
||||
else if (args.Component.TryGetData(RevenantVisuals.Stunned, out bool stunned) && stunned)
|
||||
else if (_appearance.TryGetData<bool>(uid, RevenantVisuals.Stunned, out var stunned, args.Component) && stunned)
|
||||
{
|
||||
args.Sprite.LayerSetState(0, component.StunnedState);
|
||||
}
|
||||
else if (args.Component.TryGetData(RevenantVisuals.Corporeal, out bool corporeal))
|
||||
else if (_appearance.TryGetData<bool>(uid, RevenantVisuals.Corporeal, out var corporeal, args.Component))
|
||||
{
|
||||
if (corporeal)
|
||||
args.Sprite.LayerSetState(0, component.CorporealState);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Client.Singularity.Systems;
|
||||
|
||||
public sealed class EmitterSystem : SharedEmitterSystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
@@ -23,13 +23,13 @@ public sealed class EmitterSystem : SharedEmitterSystem
|
||||
|
||||
if (args.Sprite.LayerMapTryGet(StorageVisualLayers.Lock, out var lockLayer))
|
||||
{
|
||||
if (!_appearance.TryGetData(uid, StorageVisuals.Locked, out bool locked, args.Component))
|
||||
if (!_appearance.TryGetData<bool>(uid, StorageVisuals.Locked, out var locked, args.Component))
|
||||
locked = false;
|
||||
|
||||
args.Sprite.LayerSetVisible(lockLayer, locked);
|
||||
}
|
||||
|
||||
if (!_appearance.TryGetData(uid, EmitterVisuals.VisualState, out EmitterVisualState state, args.Component))
|
||||
if (!_appearance.TryGetData<EmitterVisualState>(uid, EmitterVisuals.VisualState, out var state, args.Component))
|
||||
state = EmitterVisualState.Off;
|
||||
|
||||
if (!args.Sprite.LayerMapTryGet(EmitterVisualLayers.Lights, out var layer))
|
||||
|
||||
@@ -24,7 +24,7 @@ public sealed class StickyVisualizerSystem : VisualizerSystem<StickyVisualizerCo
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (!args.Component.TryGetData(StickyVisuals.IsStuck, out bool isStuck))
|
||||
if (!AppearanceSystem.TryGetData<bool>(uid, StickyVisuals.IsStuck, out var isStuck, args.Component))
|
||||
return;
|
||||
|
||||
var drawDepth = isStuck ? component.StuckDrawDepth : component.DefaultDrawDepth;
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace Content.Client.Storage.Systems;
|
||||
|
||||
public sealed class ItemMapperSystem : SharedItemMapperSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -38,7 +40,7 @@ public sealed class ItemMapperSystem : SharedItemMapperSystem
|
||||
|
||||
private void InitLayers(ItemMapperComponent component, SpriteComponent spriteComponent, AppearanceComponent appearance)
|
||||
{
|
||||
if (!appearance.TryGetData<ShowLayerData>(StorageMapVisuals.InitLayers, out var wrapper))
|
||||
if (!_appearance.TryGetData<ShowLayerData>(appearance.Owner, StorageMapVisuals.InitLayers, out var wrapper, appearance))
|
||||
return;
|
||||
|
||||
component.SpriteLayers.AddRange(wrapper.QueuedEntities);
|
||||
@@ -53,7 +55,7 @@ public sealed class ItemMapperSystem : SharedItemMapperSystem
|
||||
|
||||
private void EnableLayers(ItemMapperComponent component, SpriteComponent spriteComponent, AppearanceComponent appearance)
|
||||
{
|
||||
if (!appearance.TryGetData<ShowLayerData>(StorageMapVisuals.LayerChanged, out var wrapper))
|
||||
if (!_appearance.TryGetData<ShowLayerData>(appearance.Owner, StorageMapVisuals.LayerChanged, out var wrapper, appearance))
|
||||
return;
|
||||
|
||||
foreach (var layerName in component.SpriteLayers)
|
||||
|
||||
@@ -14,7 +14,7 @@ public sealed class StorageFillVisualizerSystem : VisualizerSystem<StorageFillVi
|
||||
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
if (!args.Component.TryGetData(StorageFillVisuals.FillLevel, out int level))
|
||||
if (!AppearanceSystem.TryGetData<int>(uid, StorageFillVisuals.FillLevel, out var level, args.Component))
|
||||
return;
|
||||
|
||||
var state = $"{component.FillBaseName}-{level}";
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Content.Client.SubFloor;
|
||||
|
||||
public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private bool _showAll;
|
||||
|
||||
@@ -34,8 +34,8 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
args.Component.TryGetData(SubFloorVisuals.Covered, out bool covered);
|
||||
args.Component.TryGetData(SubFloorVisuals.ScannerRevealed, out bool scannerRevealed);
|
||||
_appearance.TryGetData<bool>(uid, SubFloorVisuals.Covered, out var covered, args.Component);
|
||||
_appearance.TryGetData<bool>(uid, SubFloorVisuals.ScannerRevealed, out var scannerRevealed, args.Component);
|
||||
|
||||
scannerRevealed &= !ShowAll; // no transparency for show-subfloor mode.
|
||||
|
||||
@@ -72,7 +72,7 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
|
||||
{
|
||||
foreach (var (_, appearance) in EntityManager.EntityQuery<SubFloorHideComponent, AppearanceComponent>(true))
|
||||
{
|
||||
_appearanceSystem.MarkDirty(appearance, true);
|
||||
_appearance.MarkDirty(appearance, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, ToggleableLightVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (!args.Component.TryGetData(ToggleableLightVisuals.Enabled, out bool enabled))
|
||||
if (!AppearanceSystem.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, args.Component))
|
||||
return;
|
||||
|
||||
var modulate = args.Component.TryGetData(ToggleableLightVisuals.Color, out Color color);
|
||||
var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, args.Component);
|
||||
|
||||
// Update the item's sprite
|
||||
if (args.Sprite != null && args.Sprite.LayerMapTryGet(component.SpriteLayer, out var layer))
|
||||
@@ -55,14 +55,14 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
|
||||
private void OnGetEquipmentVisuals(EntityUid uid, ToggleableLightVisualsComponent component, GetEquipmentVisualsEvent args)
|
||||
{
|
||||
if (!TryComp(uid, out AppearanceComponent? appearance)
|
||||
|| !appearance.TryGetData(ToggleableLightVisuals.Enabled, out bool enabled)
|
||||
|| !AppearanceSystem.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, appearance)
|
||||
|| !enabled)
|
||||
return;
|
||||
|
||||
if (!component.ClothingVisuals.TryGetValue(args.Slot, out var layers))
|
||||
return;
|
||||
|
||||
var modulate = appearance.TryGetData(ToggleableLightVisuals.Color, out Color color);
|
||||
var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, appearance);
|
||||
|
||||
var i = 0;
|
||||
foreach (var layer in layers)
|
||||
@@ -84,14 +84,14 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
|
||||
private void OnGetHeldVisuals(EntityUid uid, ToggleableLightVisualsComponent component, GetInhandVisualsEvent args)
|
||||
{
|
||||
if (!TryComp(uid, out AppearanceComponent? appearance)
|
||||
|| !appearance.TryGetData(ToggleableLightVisuals.Enabled, out bool enabled)
|
||||
|| !AppearanceSystem.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, appearance)
|
||||
|| !enabled)
|
||||
return;
|
||||
|
||||
if (!component.InhandVisuals.TryGetValue(args.Location, out var layers))
|
||||
return;
|
||||
|
||||
var modulate = appearance.TryGetData(ToggleableLightVisuals.Color, out Color color);
|
||||
var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, appearance);
|
||||
|
||||
var i = 0;
|
||||
var defaultKey = $"inhand-{args.Location.ToString().ToLowerInvariant()}-toggle";
|
||||
|
||||
@@ -9,8 +9,8 @@ public sealed class ToiletVisualsSystem : VisualizerSystem<ToiletComponent>
|
||||
{
|
||||
if (args.Sprite == null) return;
|
||||
|
||||
args.Component.TryGetData(ToiletVisuals.LidOpen, out bool lidOpen);
|
||||
args.Component.TryGetData(ToiletVisuals.SeatUp, out bool seatUp);
|
||||
AppearanceSystem.TryGetData<bool>(uid, ToiletVisuals.LidOpen, out var lidOpen, args.Component);
|
||||
AppearanceSystem.TryGetData<bool>(uid, ToiletVisuals.SeatUp, out var seatUp, args.Component);
|
||||
|
||||
var state = (lidOpen, seatUp) switch
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ public sealed class WeldableVisualizerSystem : VisualizerSystem<WeldableComponen
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
args.Component.TryGetData(WeldableVisuals.IsWelded, out bool isWelded);
|
||||
AppearanceSystem.TryGetData<bool>(uid, WeldableVisuals.IsWelded, out var isWelded, args.Component);
|
||||
if (args.Sprite.LayerMapTryGet(WeldableLayers.BaseWelded, out var layer))
|
||||
{
|
||||
args.Sprite.LayerSetVisible(layer, isWelded);
|
||||
|
||||
@@ -11,7 +11,7 @@ public sealed class WelderVisualizerSystem : VisualizerSystem<WelderComponent>
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(WelderVisuals.Lit, out bool isLit))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, WelderVisuals.Lit, out var isLit, args.Component))
|
||||
{
|
||||
args.Sprite.LayerSetVisible(WelderLayers.Flame, isLit);
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ namespace Content.Client.Vehicle
|
||||
return;
|
||||
|
||||
// First check is for the sprite itself
|
||||
if (args.Component.TryGetData(VehicleVisuals.DrawDepth, out int drawDepth))
|
||||
if (AppearanceSystem.TryGetData<int>(uid, VehicleVisuals.DrawDepth, out var drawDepth, args.Component))
|
||||
{
|
||||
args.Sprite.DrawDepth = drawDepth;
|
||||
}
|
||||
|
||||
// Set vehicle layer to animated or not (i.e. are the wheels turning or not)
|
||||
if (args.Component.TryGetData(VehicleVisuals.AutoAnimate, out bool autoAnimate))
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, VehicleVisuals.AutoAnimate, out var autoAnimate, args.Component))
|
||||
{
|
||||
args.Sprite.LayerSetAutoAnimated(VehicleVisualLayers.AutoAnimate, autoAnimate);
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
@@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user