Skip to content

Commit

Permalink
Fix cursor popups (#10016)
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth authored Jul 25, 2022
1 parent 59aedb1 commit 9eec226
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Content.Client/Popups/PopupSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ private static string GetStyleClass(PopupType type) =>

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 playerPos = player != null ? Transform(player.Value).MapPosition : MapCoordinates.Nullspace;
Expand Down Expand Up @@ -234,13 +235,13 @@ private sealed class CursorPopupLabel : PopupLabel

public CursorPopupLabel(ScreenCoordinates screenCoords) : base()
{
InitialPos = screenCoords.Position / UIScale - DesiredSize / 2;
InitialPos = screenCoords.Position - DesiredSize / 2;
}

protected override void FrameUpdate(FrameEventArgs eventArgs)
{
base.FrameUpdate(eventArgs);
LayoutContainer.SetPosition(this, InitialPos - (0, 20 * (TotalTime * TotalTime + TotalTime)));
LayoutContainer.SetPosition(this, InitialPos / UIScale - (0, 20 * (TotalTime * TotalTime + TotalTime)));
}
}

Expand Down

0 comments on commit 9eec226

Please sign in to comment.