Skip to content

Commit

Permalink
Fix some loose ends
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrabbers committed Jan 30, 2024
2 parents 36e9a31 + 378fcf5 commit f90300c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions BnbnavNetClient/Models/Landmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,17 @@ public TemporaryLandmark(string id, Node node, string name) : base(id, node, nam

public static TemporaryLandmark? ParseCoordinateString(string coordinateString, string world)
{
//TODO: this will probably fail if anyone tries using , as thousands separators

var coordinateSearch = CoordinateSearchRegex().Match(coordinateString);
if (!coordinateSearch.Success)
{
return null;
}

// TODO: are these actually supposed to be InvariantCulture?

var t = Locator.Current.GetI18Next();
var x = int.Parse(coordinateSearch.Groups["x"].Value, CultureInfo.InvariantCulture);
var z = int.Parse(coordinateSearch.Groups["z"].Value, CultureInfo.InvariantCulture);
return new TemporaryLandmark($"temp@{x},{z}", new TemporaryNode(x, 0, z, world), t["DROPPED_PIN", ("x", x.ToString(CultureInfo.InvariantCulture)), ("z", z.ToString(CultureInfo.InvariantCulture))]);
var x = int.Parse(coordinateSearch.Groups["x"].Value, t.CurrentLanguage.NumberFormat);
var z = int.Parse(coordinateSearch.Groups["z"].Value, t.CurrentLanguage.NumberFormat);
return new TemporaryLandmark($"temp@{x},{z}", new TemporaryNode(x, 0, z, world), t["DROPPED_PIN", ("x", x.ToString(t.CurrentLanguage.NumberFormat)), ("z", z.ToString(t.CurrentLanguage.NumberFormat))]);
}
}
2 changes: 1 addition & 1 deletion BnbnavNetClient/Services/BnbnavWebsocketService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async Task<ReadOnlyMemory<byte>> NextMessageAsync(CancellationToken ct)

public void Dispose()
{
throw new NotImplementedException();
_ws.Dispose();
}
}

Expand Down
2 changes: 1 addition & 1 deletion BnbnavNetClient/Views/MapView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected override void OnInitialized()
{
_disablePan = false;
}

_viewVelocity = Vector.Zero;
_pointerVelocities.Clear();
};
Expand Down

0 comments on commit f90300c

Please sign in to comment.