Fix cursor popups (#10016)

This commit is contained in:
metalgearsloth
2022-07-25 18:58:23 +10:00
committed by GitHub
parent 59aedb1a88
commit 9eec2268d8

View File

@@ -157,7 +157,8 @@ namespace Content.Client.Popups
public override void FrameUpdate(float frameTime) public override void FrameUpdate(float frameTime)
{ {
if (_aliveWorldLabels.Count == 0) return; if (_aliveWorldLabels.Count == 0 && _aliveCursorLabels.Count == 0)
return;
var player = _playerManager.LocalPlayer?.ControlledEntity; var player = _playerManager.LocalPlayer?.ControlledEntity;
var playerPos = player != null ? Transform(player.Value).MapPosition : MapCoordinates.Nullspace; var playerPos = player != null ? Transform(player.Value).MapPosition : MapCoordinates.Nullspace;
@@ -234,13 +235,13 @@ namespace Content.Client.Popups
public CursorPopupLabel(ScreenCoordinates screenCoords) : base() public CursorPopupLabel(ScreenCoordinates screenCoords) : base()
{ {
InitialPos = screenCoords.Position / UIScale - DesiredSize / 2; InitialPos = screenCoords.Position - DesiredSize / 2;
} }
protected override void FrameUpdate(FrameEventArgs eventArgs) protected override void FrameUpdate(FrameEventArgs eventArgs)
{ {
base.FrameUpdate(eventArgs); base.FrameUpdate(eventArgs);
LayoutContainer.SetPosition(this, InitialPos - (0, 20 * (TotalTime * TotalTime + TotalTime))); LayoutContainer.SetPosition(this, InitialPos / UIScale - (0, 20 * (TotalTime * TotalTime + TotalTime)));
} }
} }