UI Scaling Fixes for do_after and PopupMessage (#2737)

* Fixes do_after bar placement when using UI scaling

* Add Scaled Screen Position debug overlay to DebugCoordsPanel
Fix PopupMessage being in the wrong location when using UI scaling

* Fix warning
This commit is contained in:
R. Neuser
2020-12-12 22:24:16 -06:00
committed by GitHub
parent 450e30fbda
commit 4ea18f2449
3 changed files with 7 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
var box = new UIBox2i(
leftOffset,
-2 + 2 * DoAfterBarScale,
leftOffset + (int) (XPixelDiff * Ratio),
leftOffset + (int) (XPixelDiff * Ratio * UIScale),
-2);
handle.DrawRect(box, color);
}

View File

@@ -150,7 +150,8 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
return;
// Set position ready for 2nd+ frames.
_playerPosition = _eyeManager.CoordinatesToScreen(AttachedEntity.Transform.Coordinates);
var screenCoordinates = _eyeManager.CoordinatesToScreen(AttachedEntity.Transform.Coordinates);
_playerPosition = new ScreenCoordinates(screenCoordinates.X / UIScale, screenCoordinates.Y / UIScale);
LayoutContainer.SetPosition(this, new Vector2(_playerPosition.X - Width / 2, _playerPosition.Y - Height - 30.0f));
if (FirstDraw)