Fixes obsolete Transform warnings in Content. (#25256)

* Fix TransformComponent.MapPosition warnings in Content.Client

* Fix TransformComponent.MapPosition warnings in Content.IntegrationTests

* Fix TransformComponent.MapPosition warnings in Content.Shared

* Fix TransformComponent.MapPosition warnings in Content.Server

* Fix TransformComponent.WorldPosition warnings in Content.Shared

* Fix TransformComponent.WorldPosition warnings in Content.Client
Excepts ClickableComponent b/c that needs to be ECS'd entirely later

* Fix TransformComponent.WorldPosition warnings in Content.Server

* Fix TransformComponent.WorldRotation warnings in Content.*

* Fix TransformComponent.MapPosition warnings I missed

* Fix TransformComponent.WorldMatrix warnings in Content.*

* Fix TransformComponent.InvWorldMatrix warnings in Content.*

* Fix TransformComponent.GetWorldPositionRotationMatrixWithInv warnings in Content.*

* Fix TransformComponent.GetWorldPositionRotationMatrix warnings in Content.*

* Fix TransformComponent.GetWorldPositionRotation warnings in Content.*

* Fix TransformComponent.Anchored.set warnings in Content.*

* Fix TransformComponent.Coordinates.set warnings in Content.*

* Fix TransformComponent.LocalPosition.set warnings in Content.*

* Fix TransformComponent.AttachToGridOrMap warnings in Content.*

* Fix TransformComponent.AttachParent warnings in Content.*

* Preempt TransformComponent.LocalRotation.set warnings in Content.Shared

* Preempt TransformComponent.LocalRotation.set warnings in Content.Client

* Preempt TransformComponent.LocalRotation.set warnings in Content.IntegrationTests

* Preempt TransformComponent.LocalRotation.set warnings in Content.Server

* Fix/Preempt the remaining obsolete TransformComponent properties/methods in Content.*

* ECS ClickableComponent

* Fix obsolete SharedTransformSystem methods in Content.*

* Fix ExplosionOverlay `SharedTransformSystem` dependency

* Maybe fix null eye position breaking tests

* MGS requested changes
This commit is contained in:
TemporalOroboros
2024-02-26 17:06:20 -08:00
committed by GitHub
parent cb45b6c072
commit f284b43ff6
154 changed files with 605 additions and 428 deletions

View File

@@ -20,6 +20,7 @@ public sealed class MeleeArcOverlay : Overlay
private readonly IPlayerManager _playerManager;
private readonly MeleeWeaponSystem _melee;
private readonly SharedCombatModeSystem _combatMode;
private readonly SharedTransformSystem _xformSystem;
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
@@ -31,6 +32,7 @@ public sealed class MeleeArcOverlay : Overlay
_playerManager = playerManager;
_melee = melee;
_combatMode = combatMode;
_xformSystem = _entManager.System<SharedTransformSystem>();
}
protected override void Draw(in OverlayDrawArgs args)
@@ -52,7 +54,7 @@ public sealed class MeleeArcOverlay : Overlay
if (mapPos.MapId != args.MapId)
return;
var playerPos = xform.MapPosition;
var playerPos = _xformSystem.GetMapCoordinates((player.Value, xform));
if (mapPos.MapId != playerPos.MapId)
return;

View File

@@ -80,7 +80,7 @@ public sealed partial class MeleeWeaponSystem
TransformSystem.AttachToGridOrMap(animationUid, xform);
var worldPos = mapPos + (mapRot - userXform.LocalRotation).RotateVec(localPos);
var newLocalPos = TransformSystem.GetInvWorldMatrix(xform.ParentUid).Transform(worldPos);
TransformSystem.SetLocalPositionNoLerp(xform, newLocalPos);
TransformSystem.SetLocalPositionNoLerp(animationUid, newLocalPos, xform);
if (arcComponent.Fadeout)
_animation.Play(animationUid, GetFadeAnimation(sprite, 0f, 0.15f), FadeAnimationKey);
break;

View File

@@ -136,7 +136,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
// Light attack
if (useDown == BoundKeyState.Down)
{
var attackerPos = Transform(entity).MapPosition;
var attackerPos = TransformSystem.GetMapCoordinates(entity);
if (mousePos.MapId != attackerPos.MapId ||
(attackerPos.Position - mousePos.Position).Length() > weapon.Range)

View File

@@ -18,6 +18,7 @@ public sealed class GunSpreadOverlay : Overlay
private readonly IInputManager _input;
private readonly IPlayerManager _player;
private readonly GunSystem _guns;
private readonly SharedTransformSystem _xforms;
public GunSpreadOverlay(IEntityManager entManager, IEyeManager eyeManager, IGameTiming timing, IInputManager input, IPlayerManager player, GunSystem system)
{
@@ -27,6 +28,7 @@ public sealed class GunSpreadOverlay : Overlay
_timing = timing;
_player = player;
_guns = system;
_xforms = entManager.System<SharedTransformSystem>();
}
protected override void Draw(in OverlayDrawArgs args)
@@ -41,7 +43,7 @@ public sealed class GunSpreadOverlay : Overlay
return;
}
var mapPos = xform.MapPosition;
var mapPos = _xforms.GetMapCoordinates((player.Value, xform));
if (mapPos.MapId == MapId.Nullspace)
return;

View File

@@ -99,8 +99,7 @@ public sealed partial class GunSystem : SharedGunSystem
var ent = Spawn(HitscanProto, coords);
var sprite = Comp<SpriteComponent>(ent);
var xform = Transform(ent);
xform.LocalRotation = a.angle;
TransformSystem.SetLocalRotation(ent, a.angle);
sprite[EffectLayers.Unshaded].AutoAnimated = false;
sprite.LayerSetSprite(EffectLayers.Unshaded, rsi);
sprite.LayerSetState(EffectLayers.Unshaded, rsi.RsiState);
@@ -278,9 +277,11 @@ public sealed partial class GunSystem : SharedGunSystem
var ent = Spawn(message.Prototype, coordinates);
var effectXform = Transform(ent);
TransformSystem.SetLocalPositionRotation(effectXform,
TransformSystem.SetLocalPositionRotation(ent,
effectXform.LocalPosition + new Vector2(0f, -0.5f),
effectXform.LocalRotation - MathF.PI / 2);
effectXform.LocalRotation - MathF.PI / 2,
effectXform
);
var lifetime = 0.4f;