Auto-orient rotation for arrivals (#16417)
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user