@@ -56,10 +56,7 @@ internal sealed class BuckleSystem : SharedBuckleSystem
|
||||
if (!Appearance.TryGetData<bool>(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
|
||||
|
||||
@@ -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<RotationVisualsComponent, MoveEvent>(OnMove);
|
||||
}
|
||||
|
||||
private void OnMove(EntityUid uid, RotationVisualsComponent component, ref MoveEvent args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite) ||
|
||||
!TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
_appearance.TryGetData<RotationState>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<RotationVisualsComponent, MoveEvent>(OnMove);
|
||||
}
|
||||
|
||||
private void OnMove(EntityUid uid, RotationVisualsComponent component, ref MoveEvent args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite) ||
|
||||
!TryComp<AppearanceComponent>(uid, out var appearance) ||
|
||||
!TryComp<TransformComponent>(uid, out var transform) ||
|
||||
component.DefaultRotation == 0)
|
||||
return;
|
||||
|
||||
_appearance.TryGetData<RotationState>(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;
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (camera.NameSet && camera.NetworkSet)
|
||||
if (camera.NameSet && camera.NetworkSet && !TryComp<SurveillanceBodyCameraComponent>(uid, out _)) // WD EDIT
|
||||
{
|
||||
_userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Camera);
|
||||
return;
|
||||
|
||||
@@ -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<SurveillanceCameraComponent>(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<SurveillanceCameraComponent>(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<AppearanceComponent>(uid, out var appearance) ||
|
||||
!TryComp<ItemComponent>(uid, out var item))
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,16 +237,23 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
|
||||
standingState.CurrentState = StandingState.Lying;
|
||||
Dirty(uid, standingState);
|
||||
|
||||
var rotation = _transform.GetWorldRotation(uid); // WD EDIT
|
||||
_appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var state, appearance); // WD EDIT
|
||||
|
||||
if (!state) // WD EDIT
|
||||
if (TryComp<TransformComponent>(uid, out var transform)) // WD EDIT
|
||||
{
|
||||
if (rotation.GetDir() is Direction.East or Direction.North or Direction.NorthEast or Direction.SouthEast)
|
||||
var rotation = transform.LocalRotation;
|
||||
_appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, appearance);
|
||||
|
||||
if (!buckled && (!_appearance.TryGetData<MobState>(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());
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user