makes adminnameoverlay adjust with eyerotation

This commit is contained in:
Paul
2021-10-31 13:44:44 +01:00
parent 3222b7bd06
commit e6607744c2

View File

@@ -3,11 +3,9 @@ using Content.Client.Administration.Managers;
using Content.Shared.Administration.Menu; using Content.Shared.Administration.Menu;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Shared.Containers;
using Robust.Shared.Enums; using Robust.Shared.Enums;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Physics;
namespace Content.Client.Administration namespace Content.Client.Administration
{ {
@@ -68,13 +66,15 @@ namespace Content.Client.Administration
continue; continue;
} }
var lineoffset = new Vector2(0, 11f); var lineoffset = new Vector2(0f, 11f);
var screenCoordinates = _eyeManager.WorldToScreen(aabb.TopRight + (0, -0.1f)); var screenCoordinates = _eyeManager.WorldToScreen(aabb.Center +
new Angle(-_eyeManager.CurrentEye.Rotation).RotateVec(
aabb.TopRight - aabb.Center)) + new Vector2(1f, 7f);
if (playerInfo.Antag) if (playerInfo.Antag)
{ {
args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), "ANTAG", Color.OrangeRed); args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), "ANTAG", Color.OrangeRed);
} }
args.ScreenHandle.DrawString(_font, screenCoordinates+(lineoffset), playerInfo.Username, Color.Yellow); args.ScreenHandle.DrawString(_font, screenCoordinates+lineoffset, playerInfo.Username, Color.Yellow);
args.ScreenHandle.DrawString(_font, screenCoordinates, playerInfo.CharacterName, Color.Aquamarine); args.ScreenHandle.DrawString(_font, screenCoordinates, playerInfo.CharacterName, Color.Aquamarine);
} }
} }