Inline UID

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:53:09 +01:00
parent 2654775bf0
commit 5cd42c9ad6
803 changed files with 3613 additions and 3577 deletions

View File

@@ -39,12 +39,12 @@ namespace Content.Server.Rotatable
// Check if the object is anchored, and whether we are still allowed to rotate it.
if (!component.RotateWhileAnchored &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner.Uid, out IPhysBody? physics) &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out IPhysBody? physics) &&
physics.BodyType == BodyType.Static)
return;
Verb resetRotation = new();
resetRotation.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).LocalRotation = Angle.Zero;
resetRotation.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation = Angle.Zero;
resetRotation.Category = VerbCategory.Rotate;
resetRotation.IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png";
resetRotation.Text = "Reset";
@@ -54,7 +54,7 @@ namespace Content.Server.Rotatable
// rotate clockwise
Verb rotateCW = new();
rotateCW.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).LocalRotation += Angle.FromDegrees(-90);
rotateCW.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation += Angle.FromDegrees(-90);
rotateCW.Category = VerbCategory.Rotate;
rotateCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png";
rotateCW.Priority = -1;
@@ -63,7 +63,7 @@ namespace Content.Server.Rotatable
// rotate counter-clockwise
Verb rotateCCW = new();
rotateCCW.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).LocalRotation += Angle.FromDegrees(90);
rotateCCW.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation += Angle.FromDegrees(90);
rotateCCW.Category = VerbCategory.Rotate;
rotateCCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png";
rotateCCW.Priority = 0;
@@ -76,19 +76,19 @@ namespace Content.Server.Rotatable
/// </summary>
public static void TryFlip(FlippableComponent component, IEntity user)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner.Uid, out IPhysBody? physics) &&
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out IPhysBody? physics) &&
physics.BodyType == BodyType.Static)
{
component.Owner.PopupMessage(user, Loc.GetString("flippable-component-try-flip-is-stuck"));
return;
}
var oldTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid);
var oldTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner);
var entity = IoCManager.Resolve<IEntityManager>().SpawnEntity(component.MirrorEntity, oldTransform.Coordinates);
var newTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid);
var newTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity);
newTransform.LocalRotation = oldTransform.LocalRotation;
newTransform.Anchored = false;
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner.Uid);
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) component.Owner);
}
}
}