From fe2298378d17dd2141324f3d90db101dc078a4f8 Mon Sep 17 00:00:00 2001 From: mirrorcult Date: Sat, 9 Oct 2021 09:23:34 -0700 Subject: [PATCH] Add verb to reset rotation of rotatable entities (#4807) --- Content.Server/Rotatable/RotatableSystem.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Content.Server/Rotatable/RotatableSystem.cs b/Content.Server/Rotatable/RotatableSystem.cs index 7cb4dc6f17..4fda03278c 100644 --- a/Content.Server/Rotatable/RotatableSystem.cs +++ b/Content.Server/Rotatable/RotatableSystem.cs @@ -42,12 +42,21 @@ namespace Content.Server.Rotatable physics.BodyType == BodyType.Static) return; + Verb resetRotation = new(); + resetRotation.Act = () => component.Owner.Transform.LocalRotation = Angle.Zero; + resetRotation.Category = VerbCategory.Rotate; + resetRotation.IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png"; + resetRotation.Text = "Reset"; + resetRotation.Priority = -2; // show CCW, then CW, then reset + resetRotation.CloseMenu = false; + args.Verbs.Add(resetRotation); + // rotate clockwise Verb rotateCW = new(); rotateCW.Act = () => component.Owner.Transform.LocalRotation += Angle.FromDegrees(-90); rotateCW.Category = VerbCategory.Rotate; rotateCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png"; - rotateCW.Priority = -2; // show CCW, then CW + rotateCW.Priority = -1; rotateCW.CloseMenu = false; // allow for easy double rotations. args.Verbs.Add(rotateCW); @@ -56,7 +65,7 @@ namespace Content.Server.Rotatable rotateCCW.Act = () => component.Owner.Transform.LocalRotation += Angle.FromDegrees(90); rotateCCW.Category = VerbCategory.Rotate; rotateCCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png"; - rotateCCW.Priority = -1; + rotateCCW.Priority = 0; rotateCCW.CloseMenu = false; // allow for easy double rotations. args.Verbs.Add(rotateCCW); }