fix medhud bounds with 64x64 inhands (#24102)

This commit is contained in:
Nemanja
2024-01-15 01:54:08 -05:00
committed by GitHub
parent c8466055ef
commit be8d0e69b6
2 changed files with 7 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ using Robust.Client.GameObjects;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Shared.Enums; using Robust.Shared.Enums;
using System.Numerics; using System.Numerics;
using Content.Shared.StatusIcon.Components;
using static Robust.Shared.Maths.Color; using static Robust.Shared.Maths.Color;
namespace Content.Client.Overlays; namespace Content.Client.Overlays;
@@ -65,7 +66,8 @@ public sealed class EntityHealthBarOverlay : Overlay
continue; continue;
} }
var bounds = spriteComponent.Bounds; // we use the status icon component bounds if specified otherwise use sprite
var bounds = _entManager.GetComponentOrNull<StatusIconComponent>(uid)?.Bounds ?? spriteComponent.Bounds;
var worldPos = _transform.GetWorldPosition(xform, xformQuery); var worldPos = _transform.GetWorldPosition(xform, xformQuery);
if (!bounds.Translated(worldPos).Intersects(args.WorldAABB)) if (!bounds.Translated(worldPos).Intersects(args.WorldAABB))
@@ -81,8 +83,8 @@ public sealed class EntityHealthBarOverlay : Overlay
handle.SetTransform(matty); handle.SetTransform(matty);
var yOffset = spriteComponent.Bounds.Height * EyeManager.PixelsPerMeter / 2 - 3f; var yOffset = bounds.Height * EyeManager.PixelsPerMeter / 2 - 3f;
var widthOfMob = spriteComponent.Bounds.Width * EyeManager.PixelsPerMeter; var widthOfMob = bounds.Width * EyeManager.PixelsPerMeter;
var position = new Vector2(-widthOfMob / EyeManager.PixelsPerMeter / 2, yOffset / EyeManager.PixelsPerMeter); var position = new Vector2(-widthOfMob / EyeManager.PixelsPerMeter / 2, yOffset / EyeManager.PixelsPerMeter);

View File

@@ -80,6 +80,8 @@
clownedon: # Not 'creampied' bc I can already see Skyrat complaining about conflicts. clownedon: # Not 'creampied' bc I can already see Skyrat complaining about conflicts.
True: {visible: true} True: {visible: true}
False: {visible: false} False: {visible: false}
- type: StatusIcon
bounds: -0.5,-0.5,0.5,0.5
- type: RotationVisuals - type: RotationVisuals
defaultRotation: 90 defaultRotation: 90
horizontalRotation: 90 horizontalRotation: 90