diff --git a/YJMPD-UWP/Assets/Direction.png b/YJMPD-UWP/Assets/Direction.png new file mode 100644 index 0000000..a6a1271 Binary files /dev/null and b/YJMPD-UWP/Assets/Direction.png differ diff --git a/YJMPD-UWP/MainPage.xaml.cs b/YJMPD-UWP/MainPage.xaml.cs index d72d48f..65b08cc 100644 --- a/YJMPD-UWP/MainPage.xaml.cs +++ b/YJMPD-UWP/MainPage.xaml.cs @@ -51,10 +51,6 @@ namespace YJMPD_UWP { if (e.Handled) return; - App.Game.MoveToStarted(new BasicGeoposition { Latitude = 44.768187, Longitude = -0.472412 }); - e.Handled = true; - return; - if (App.Game.Status == Model.GameHandler.GameStatus.STARTED) { e.Handled = true; diff --git a/YJMPD-UWP/ViewModels/MatchVM.cs b/YJMPD-UWP/ViewModels/MatchVM.cs index dfbb81b..426e5cb 100644 --- a/YJMPD-UWP/ViewModels/MatchVM.cs +++ b/YJMPD-UWP/ViewModels/MatchVM.cs @@ -26,9 +26,11 @@ namespace YJMPD_UWP.ViewModels { dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { + if (App.Game.Status != Model.GameHandler.GameStatus.STARTED) + return; + Degrees = (int)(angle + -e.Heading.HeadingMagneticNorth); NotifyPropertyChanged(nameof(Degrees)); - Debug.WriteLine("Degrees " + Degrees + " / " + angle); }); } @@ -36,15 +38,14 @@ namespace YJMPD_UWP.ViewModels { dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { - if (App.Game.Status == Model.GameHandler.GameStatus.STARTED) + if (App.Game.Status != Model.GameHandler.GameStatus.STARTED) 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; - Debug.WriteLine(HeadingVisible); - NotifyPropertyChanged(nameof(HeadingVisible)); + NotifyPropertyChanged(nameof(InvHeadingVisible)); }); } @@ -87,6 +88,14 @@ namespace YJMPD_UWP.ViewModels get; private set; } + public bool InvHeadingVisible + { + get + { + return !HeadingVisible; + } + } + public bool MessageVisible { get diff --git a/YJMPD-UWP/Views/MatchView.xaml b/YJMPD-UWP/Views/MatchView.xaml index e5045d1..a39b0c7 100644 --- a/YJMPD-UWP/Views/MatchView.xaml +++ b/YJMPD-UWP/Views/MatchView.xaml @@ -3,6 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:YJMPD_UWP.Views" + xmlns:map="using:Windows.UI.Xaml.Controls.Maps" xmlns:convert="using:YJMPD_UWP.Helpers.Converter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -12,14 +13,33 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -29,4 +49,5 @@ + diff --git a/YJMPD-UWP/YJMPD-UWP.csproj b/YJMPD-UWP/YJMPD-UWP.csproj index a4f11f5..11ea7b6 100644 --- a/YJMPD-UWP/YJMPD-UWP.csproj +++ b/YJMPD-UWP/YJMPD-UWP.csproj @@ -159,6 +159,9 @@ + + PreserveNewest +