Bugfixes
This commit is contained in:
@@ -51,6 +51,10 @@ namespace YJMPD_UWP
|
||||
{
|
||||
if (e.Handled) return;
|
||||
|
||||
App.Game.MoveToStarted(new BasicGeoposition { Latitude = 51.591403, Longitude = 4.743948 });
|
||||
e.Handled = true;
|
||||
return;
|
||||
|
||||
if (App.Game.Status == Model.GameHandler.GameStatus.STARTED)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
||||
@@ -149,10 +149,10 @@ namespace YJMPD_UWP.Model
|
||||
|
||||
public void MoveToStarted(BasicGeoposition bgps)
|
||||
{
|
||||
App.Navigate(typeof(MatchView));
|
||||
|
||||
Destination = bgps;
|
||||
|
||||
App.Navigate(typeof(MatchView));
|
||||
|
||||
GeofenceMonitor.Current.Geofences.Add(new Geofence("destination", new Geocircle(bgps, 50), MonitoredGeofenceStates.Entered | MonitoredGeofenceStates.Exited, false, TimeSpan.FromSeconds(1)));
|
||||
|
||||
UpdateGameStatus(GameStatus.STARTED);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace YJMPD_UWP.ViewModels
|
||||
Message = "";
|
||||
Degrees = 0;
|
||||
angle = (int)Util.DegreeBearing(App.Geo.Position.Coordinate.Point.Position, App.Game.Destination);
|
||||
HeadingVisible = false;
|
||||
HeadingVisible = true;
|
||||
App.Game.OnDestinationEnter += Game_OnDestinationEnter;
|
||||
App.Game.OnDestinationLeave += Game_OnDestinationLeave;
|
||||
App.Geo.OnPositionUpdate += Geo_OnPositionUpdate;
|
||||
@@ -31,6 +31,7 @@ namespace YJMPD_UWP.ViewModels
|
||||
|
||||
Degrees = (int)(angle + -e.Heading.HeadingMagneticNorth);
|
||||
NotifyPropertyChanged(nameof(Degrees));
|
||||
Debug.WriteLine(angle);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,7 +43,10 @@ namespace YJMPD_UWP.ViewModels
|
||||
return;
|
||||
|
||||
angle = (int)Util.DegreeBearing(e.Position.Coordinate.Point.Position, App.Game.Destination);
|
||||
HeadingVisible = Util.Distance(e.Position.Coordinate.Point.Position, App.Game.Destination) > 500;
|
||||
double b = Util.Distance(e.Position.Coordinate.Point.Position, App.Game.Destination) * 1000;
|
||||
HeadingVisible = (int)b > 250;
|
||||
|
||||
Debug.WriteLine(HeadingVisible + " " + b);
|
||||
|
||||
NotifyPropertyChanged(nameof(HeadingVisible));
|
||||
NotifyPropertyChanged(nameof(InvHeadingVisible));
|
||||
|
||||
Reference in New Issue
Block a user