fix medhud bounds with 64x64 inhands (#24102)
This commit is contained in:
@@ -7,6 +7,7 @@ using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Enums;
|
||||
using System.Numerics;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using static Robust.Shared.Maths.Color;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
@@ -65,7 +66,8 @@ public sealed class EntityHealthBarOverlay : Overlay
|
||||
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);
|
||||
|
||||
if (!bounds.Translated(worldPos).Intersects(args.WorldAABB))
|
||||
@@ -81,8 +83,8 @@ public sealed class EntityHealthBarOverlay : Overlay
|
||||
|
||||
handle.SetTransform(matty);
|
||||
|
||||
var yOffset = spriteComponent.Bounds.Height * EyeManager.PixelsPerMeter / 2 - 3f;
|
||||
var widthOfMob = spriteComponent.Bounds.Width * EyeManager.PixelsPerMeter;
|
||||
var yOffset = bounds.Height * EyeManager.PixelsPerMeter / 2 - 3f;
|
||||
var widthOfMob = bounds.Width * EyeManager.PixelsPerMeter;
|
||||
|
||||
var position = new Vector2(-widthOfMob / EyeManager.PixelsPerMeter / 2, yOffset / EyeManager.PixelsPerMeter);
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
clownedon: # Not 'creampied' bc I can already see Skyrat complaining about conflicts.
|
||||
True: {visible: true}
|
||||
False: {visible: false}
|
||||
- type: StatusIcon
|
||||
bounds: -0.5,-0.5,0.5,0.5
|
||||
- type: RotationVisuals
|
||||
defaultRotation: 90
|
||||
horizontalRotation: 90
|
||||
|
||||
Reference in New Issue
Block a user