Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Shuttle FTL #490

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public BaseShuttleControl(float minRange, float maxRange, float range) : base(mi

protected void DrawData(DrawingHandleScreen handle, string text)
{
var coordsDimensions = handle.GetDimensions(Font, text, UIScale);
var coordsDimensions = handle.GetDimensions(Font, text, 1f);
const float coordsMargins = 5f;

handle.DrawString(Font,
new Vector2(coordsMargins, Height) - new Vector2(0f, coordsDimensions.Y + coordsMargins),
new Vector2(coordsMargins, PixelHeight) - new Vector2(0f, coordsDimensions.Y + coordsMargins),
text,
Color.FromSrgb(IFFComponent.SelfColor));
}
Expand Down
11 changes: 6 additions & 5 deletions Content.Client/Shuttles/UI/ShuttleMapControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected override void KeyBindUp(GUIBoundKeyEventArgs args)

var mapTransform = Matrix3.CreateInverseTransform(Offset, Angle.Zero);

if (beaconsOnly && TryGetBeacon(_beacons, mapTransform, args.RelativePosition, PixelRect, out var foundBeacon, out _))
if (beaconsOnly && TryGetBeacon(_beacons, mapTransform, args.RelativePixelPosition, PixelRect, out var foundBeacon, out _))
{
RequestBeaconFTL?.Invoke(foundBeacon.Entity, _ftlAngle);
}
Expand Down Expand Up @@ -206,7 +206,8 @@ private void DrawParallax(DrawingHandleScreen handle)
private List<IMapObject> GetViewportMapObjects(Matrix3 matty, List<IMapObject> mapObjects)
{
var results = new List<IMapObject>();
var viewBox = SizeBox.Scale(1.2f);
var enlargement = new Vector2i((int) (16 * UIScale), (int) (16 * UIScale));
var viewBox = new UIBox2i(Vector2i.Zero - enlargement, PixelSize + enlargement);

foreach (var mapObj in mapObjects)
{
Expand Down Expand Up @@ -398,8 +399,8 @@ protected override void Draw(DrawingHandleScreen handle)

foreach (var (gridUiPos, iffText) in sendStrings)
{
var textWidth = handle.GetDimensions(_font, iffText, UIScale);
handle.DrawString(_font, gridUiPos + textWidth with { X = -textWidth.X / 2f }, iffText, adjustedColor);
var textWidth = handle.GetDimensions(_font, iffText, 1f);
handle.DrawString(_font, gridUiPos + textWidth with { X = -textWidth.X / 2f, Y = textWidth.Y * UIScale }, iffText, adjustedColor);
}
}

Expand Down Expand Up @@ -587,7 +588,7 @@ private bool TryGetBeacon(IEnumerable<IMapObject> mapObjects, Matrix3 mapTransfo

var distance = (localPos - mousePos).Length();

if (distance > BeaconSnapRange ||
if (distance > BeaconSnapRange * UIScale ||
distance > nearestValue)
{
continue;
Expand Down
Loading