diff --git a/Content.Client/Buckle/BuckleSystem.cs b/Content.Client/Buckle/BuckleSystem.cs index fea18e5cf3..5f573fe997 100644 --- a/Content.Client/Buckle/BuckleSystem.cs +++ b/Content.Client/Buckle/BuckleSystem.cs @@ -56,10 +56,7 @@ internal sealed class BuckleSystem : SharedBuckleSystem if (!Appearance.TryGetData(uid, BuckleVisuals.Buckled, out var buckled, args.Component) || !buckled || args.Sprite == null) - { - _rotationVisualizerSystem.SetHorizontalAngle((uid, rotVisuals), rotVisuals.DefaultRotation); return; - } // Animate strapping yourself to something at a given angle // TODO: Dump this when buckle is better diff --git a/Content.Client/_White/Rotation/RotationVisualizerSystem.cs b/Content.Client/_White/Rotation/RotationVisualizerSystem.cs deleted file mode 100644 index 74d31fb1f5..0000000000 --- a/Content.Client/_White/Rotation/RotationVisualizerSystem.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Content.Shared.Rotation; -using Robust.Client.GameObjects; - -namespace Content.Client._White.Rotation; - -public sealed class RotationVisualizerSystem : EntitySystem -{ - [Dependency] private readonly AppearanceSystem _appearance = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - public override void Initialize() - { - SubscribeLocalEvent(OnMove); - } - - private void OnMove(EntityUid uid, RotationVisualsComponent component, ref MoveEvent args) - { - if (!TryComp(uid, out var sprite) || - !TryComp(uid, out var appearance)) - return; - - _appearance.TryGetData(uid, RotationVisuals.RotationState, out var state, appearance); - - var rotation = _transform.GetWorldRotation(uid); - - if (rotation.GetDir() is Direction.East or Direction.North or Direction.NorthEast or Direction.SouthEast) - { - if (state == RotationState.Horizontal && - sprite.Rotation == component.DefaultRotation) - { - sprite.Rotation = Angle.FromDegrees(270); - } - - return; - } - if (state == RotationState.Horizontal && - sprite.Rotation == Angle.FromDegrees(270)) - { - sprite.Rotation = component.DefaultRotation; - } - } -} diff --git a/Content.Client/_White/Rotation/RotationVisualizerWhiteSystem.cs b/Content.Client/_White/Rotation/RotationVisualizerWhiteSystem.cs new file mode 100644 index 0000000000..e5815d4753 --- /dev/null +++ b/Content.Client/_White/Rotation/RotationVisualizerWhiteSystem.cs @@ -0,0 +1,46 @@ +using Content.Shared.Rotation; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; + +namespace Content.Client._White.Rotation; + +public sealed class RotationVisualizerWhiteSystem : EntitySystem +{ + [Dependency] private readonly AppearanceSystem _appearance = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + public override void Initialize() + { + SubscribeLocalEvent(OnMove); + } + + private void OnMove(EntityUid uid, RotationVisualsComponent component, ref MoveEvent args) + { + if (!TryComp(uid, out var sprite) || + !TryComp(uid, out var appearance) || + !TryComp(uid, out var transform) || + component.DefaultRotation == 0) + return; + + _appearance.TryGetData(uid, RotationVisuals.RotationState, out var state, appearance); + + var rotation = transform.LocalRotation + _eyeManager.CurrentEye.Rotation; + + if (rotation.GetDir() is Direction.East or Direction.North or Direction.NorthEast or Direction.SouthEast) + { + if (state != RotationState.Horizontal || + sprite.Rotation != component.DefaultRotation) + return; + + component.HorizontalRotation = Angle.FromDegrees(270); + sprite.Rotation = Angle.FromDegrees(270); + return; + } + + if (state != RotationState.Horizontal || + sprite.Rotation != Angle.FromDegrees(270)) + return; + + component.HorizontalRotation = component.DefaultRotation; + sprite.Rotation = component.DefaultRotation; + } +} diff --git a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs index b2b1938e8e..525dcee49f 100644 --- a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs +++ b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs @@ -220,7 +220,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem return; } - if (camera.NameSet && camera.NetworkSet) + if (camera.NameSet && camera.NetworkSet && !TryComp(uid, out _)) // WD EDIT { _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Camera); return; diff --git a/Content.Server/_White/SurveillanceCamera/SurveillanceBodyCameraSystem.cs b/Content.Server/_White/SurveillanceCamera/SurveillanceBodyCameraSystem.cs index 600f5e2d29..e73f96f9b4 100644 --- a/Content.Server/_White/SurveillanceCamera/SurveillanceBodyCameraSystem.cs +++ b/Content.Server/_White/SurveillanceCamera/SurveillanceBodyCameraSystem.cs @@ -9,6 +9,7 @@ using Content.Shared.Actions; using Content.Shared.PowerCell.Components; using Content.Shared._White.SurveillanceCamera; using Content.Shared.IdentityManagement; +using Content.Shared.Interaction; using Content.Shared.Toggleable; using Robust.Shared.Player; @@ -61,7 +62,7 @@ public sealed class SurveillanceBodyCameraSystem : EntitySystem _popup.PopupEntity(message, uid, Filter.PvsExcept(uid, entityManager: EntityManager), true); } - public void OnInit(EntityUid uid, SurveillanceBodyCameraComponent comp, ComponentInit args) + private void OnInit(EntityUid uid, SurveillanceBodyCameraComponent comp, ComponentInit args) { if (!TryComp(uid, out var surComp)) return; @@ -115,7 +116,7 @@ public sealed class SurveillanceBodyCameraSystem : EntitySystem AppearanceChange(uid, surComp.Active); } - public void OnExamine(EntityUid uid, SurveillanceBodyCameraComponent comp, ExaminedEvent args) + private void OnExamine(EntityUid uid, SurveillanceBodyCameraComponent comp, ExaminedEvent args) { if (!TryComp(uid, out var surComp)) return; @@ -128,7 +129,7 @@ public sealed class SurveillanceBodyCameraSystem : EntitySystem args.PushMarkup(message); } - public void AppearanceChange(EntityUid uid, bool isActive) + private void AppearanceChange(EntityUid uid, bool isActive) { if (!TryComp(uid, out var appearance) || !TryComp(uid, out var item)) diff --git a/Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs b/Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs index 1f8e1567ab..4ffc578135 100644 --- a/Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs +++ b/Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs @@ -82,13 +82,12 @@ public partial class MobStateSystem _appearance.SetData(target, MobStateVisuals.State, MobState.Alive); break; case MobState.Critical: - _standing.Down(target); _appearance.SetData(target, MobStateVisuals.State, MobState.Critical); + _standing.Down(target); break; case MobState.Dead: - _standing.Down(target); - _appearance.SetData(target, MobStateVisuals.State, MobState.Dead); + _standing.Down(target); break; case MobState.Invalid: //unused; diff --git a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs index a13f21a3c7..3c0fa89e5b 100644 --- a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs +++ b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.Stunnable; using Content.Shared._White.Wizard.Timestop; using Content.Shared.Buckle; using Content.Shared.Buckle.Components; +using Content.Shared.Mobs; using Robust.Shared.Audio.Systems; using Robust.Shared.Input.Binding; using Robust.Shared.Physics; @@ -236,15 +237,22 @@ public abstract partial class SharedStandingStateSystem : EntitySystem standingState.CurrentState = StandingState.Lying; Dirty(uid, standingState); - var rotation = _transform.GetWorldRotation(uid); // WD EDIT - _appearance.TryGetData(uid, BuckleVisuals.Buckled, out var state, appearance); // WD EDIT - - if (!state) // WD EDIT + if (TryComp(uid, out var transform)) // WD EDIT { - if (rotation.GetDir() is Direction.East or Direction.North or Direction.NorthEast or Direction.SouthEast) - _rotation.SetHorizontalAngle(uid, Angle.FromDegrees(270)); - else - _rotation.ResetHorizontalAngle(uid); + var rotation = transform.LocalRotation; + _appearance.TryGetData(uid, BuckleVisuals.Buckled, out var buckled, appearance); + + if (!buckled && (!_appearance.TryGetData(uid, MobStateVisuals.State, out var state, appearance) || + state is MobState.Alive)) + { + if (rotation.GetDir() is Direction.East + or Direction.North + or Direction.NorthEast + or Direction.SouthEast) + _rotation.SetHorizontalAngle(uid, Angle.FromDegrees(270)); + else + _rotation.ResetHorizontalAngle(uid); + } } RaiseLocalEvent(uid, new DownedEvent()); diff --git a/Resources/Prototypes/_White/Actions/types.yml b/Resources/Prototypes/_White/Actions/types.yml index f38f61a0e7..1dc52bbc7c 100644 --- a/Resources/Prototypes/_White/Actions/types.yml +++ b/Resources/Prototypes/_White/Actions/types.yml @@ -51,6 +51,7 @@ - type: InstantAction itemIconStyle: BigAction priority: -20 - icon: { sprite: Objects\Specific\Security\body-camera.rsi, state: unpowered } - iconOn: { sprite: Objects\Specific\Security\body-camera.rsi, state: active } + icon: + sprite: Objects\Specific\Security\body-camera.rsi + state: unpowered event: !type:ToggleBodyCameraEvent \ No newline at end of file