Auto-orient rotation for arrivals (#16417)

This commit is contained in:
metalgearsloth
2023-05-14 21:46:28 +10:00
committed by GitHub
parent c9a27f9f96
commit 676405f08f
3 changed files with 26 additions and 6 deletions

View File

@@ -52,6 +52,8 @@ namespace Content.Shared.Movement.Systems
SubscribeLocalEvent<InputMoverComponent, ComponentHandleState>(OnInputHandleState);
SubscribeLocalEvent<InputMoverComponent, EntParentChangedMessage>(OnInputParentChange);
SubscribeLocalEvent<AutoOrientComponent, EntParentChangedMessage>(OnAutoParentChange);
SubscribeLocalEvent<FollowedComponent, EntParentChangedMessage>(OnFollowedParentChange);
_configManager.OnValueChanged(CCVars.CameraRotationLocked, SetCameraRotationLocked, true);
@@ -110,6 +112,11 @@ namespace Content.Shared.Movement.Systems
protected virtual void HandleShuttleInput(EntityUid uid, ShuttleButtons button, ushort subTick, bool state) {}
private void OnAutoParentChange(EntityUid uid, AutoOrientComponent component, ref EntParentChangedMessage args)
{
ResetCamera(uid);
}
public void RotateCamera(EntityUid uid, Angle angle)
{
if (CameraRotationLocked || !TryComp<InputMoverComponent>(uid, out var mover))