Revert "Hunger and thirst HUDs" (#18125)

This commit is contained in:
Visne
2023-07-18 17:28:28 +02:00
committed by GitHub
parent aa40a21aab
commit ee4809a222
26 changed files with 96 additions and 1028 deletions

View File

@@ -1,9 +1,8 @@
using Content.Shared.StatusIcon;
using System.Numerics;
using Content.Shared.StatusIcon.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Enums;
using System.Numerics;
namespace Content.Client.StatusIcon;
@@ -58,8 +57,7 @@ public sealed class StatusIconOverlay : Overlay
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);
var countL = 0;
var countR = 0;
var count = 0;
var accOffsetL = 0;
var accOffsetR = 0;
icons.Sort();
@@ -73,16 +71,13 @@ public sealed class StatusIconOverlay : Overlay
// the icons are ordered left to right, top to bottom.
// extra icons that don't fit are just cut off.
if (proto.LocationPreference == StatusIconLocationPreference.Left ||
proto.LocationPreference == StatusIconLocationPreference.None && countL <= countR)
if (count % 2 == 0)
{
if (accOffsetL + texture.Height > sprite.Bounds.Height * EyeManager.PixelsPerMeter)
break;
accOffsetL += texture.Height;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetL / EyeManager.PixelsPerMeter;
xOffset = -(bounds.Width + sprite.Offset.X) / 2f;
countL++;
}
else
{
@@ -91,9 +86,8 @@ public sealed class StatusIconOverlay : Overlay
accOffsetR += texture.Height;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetR / EyeManager.PixelsPerMeter;
xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter;
countR++;
}
count++;
var position = new Vector2(xOffset, yOffset);
handle.DrawTexture(texture, position);