using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;
-using Robust.Shared.Timing;
namespace Content.Client.Movement.Systems;
/// </summary>
public sealed class ClientSpriteMovementSystem : SharedSpriteMovementSystem
{
- [Dependency] private readonly IGameTiming _timing = default!;
-
private EntityQuery<SpriteComponent> _spriteQuery;
public override void Initialize()
using System.Numerics;
using Content.Client.Movement.Components;
using Content.Shared.Camera;
-using Content.Shared.Inventory;
-using Content.Shared.Movement.Systems;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Shared.Map;
[Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
- [Dependency] private readonly SharedContentEyeSystem _contentEye = default!;
- [Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IClyde _clyde = default!;
// This value is here to make sure the user doesn't have to move their mouse
public Vector2? OffsetAfterMouse(EntityUid uid, EyeCursorOffsetComponent? component)
{
- var localPlayer = _player.LocalPlayer?.ControlledEntity;
+ var localPlayer = _player.LocalEntity;
var mousePos = _inputManager.MouseScreenPosition;
var screenSize = _clyde.MainWindow.Size;
var minValue = MathF.Min(screenSize.X / 2, screenSize.Y / 2) * _edgeOffset;
}
var count = 0;
-
- foreach (var mover in entManager.EntityQuery<InputMoverComponent>(true))
+ var query = entManager.EntityQueryEnumerator<InputMoverComponent>();
+ while (query.MoveNext(out var uid, out var mover))
{
if (mover.TargetRelativeRotation.Equals(rotation))
continue;
mover.TargetRelativeRotation = rotation;
- entManager.Dirty(mover);
+
+ entManager.Dirty(uid, mover);
count++;
}
// If for whatever reason you want to yeet them to the other side.
// offset = new Angle(MathF.PI).RotateVec(offset);
- _xform.SetWorldPosition(otherXform, center + offset);
+ _xform.SetWorldPosition((args.OtherEntity, otherXform), center + offset);
}
}
// Cap the distance
var range = 2f;
- var fromUserCoords = coords.WithEntityId(player, EntityManager);
+ var fromUserCoords = _transformSystem.WithEntityId(coords, player);
var userCoords = new EntityCoordinates(player, Vector2.Zero);
if (!_transformSystem.InRange(coords, userCoords, range))
}
fromUserCoords = new EntityCoordinates(player, direction.Normalized() * (range - 0.01f));
- coords = fromUserCoords.WithEntityId(coords.EntityId);
+ coords = _transformSystem.WithEntityId(fromUserCoords, coords.EntityId);
}
var moving = EnsureComp<PullMovingComponent>(pulled!.Value);
var pullerXform = _xformQuery.Get(puller);
var pullerPosition = TransformSystem.GetMapCoordinates(pullerXform);
- var movingTo = mover.MovingTo.ToMap(EntityManager, TransformSystem);
+ var movingTo = TransformSystem.ToMapCoordinates(mover.MovingTo);
if (movingTo.MapId != pullerPosition.MapId)
{