diff --git a/PokemonGo-UWP/App.xaml b/PokemonGo-UWP/App.xaml
index 0caddbc90..7a2fe5464 100644
--- a/PokemonGo-UWP/App.xaml
+++ b/PokemonGo-UWP/App.xaml
@@ -70,7 +70,7 @@
-
+
@@ -95,6 +95,7 @@
+
diff --git a/PokemonGo-UWP/App.xaml.cs b/PokemonGo-UWP/App.xaml.cs
index 54fdf40f2..2328e092f 100644
--- a/PokemonGo-UWP/App.xaml.cs
+++ b/PokemonGo-UWP/App.xaml.cs
@@ -310,7 +310,8 @@ public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs
}
else if (latestUpdateInfo.Status == UpdateManager.UpdateStatus.NextVersionNotReady)
{
- var dialog = new MessageDialog("Please wait on next update", "This version is obsolete");
+ var dialog = new MessageDialog("We've temporarily disabled the app to protect your account. An update will be ready soon. " +
+ "Please DO NOT open an issue on GitHub. Thank you for your patience.");
dialog.Commands.Add(new UICommand("OK"));
dialog.DefaultCommandIndex = 0;
dialog.CancelCommandIndex = 1;
diff --git a/PokemonGo-UWP/Assets/Icons/spawnpoint.png b/PokemonGo-UWP/Assets/Icons/spawnpoint.png
new file mode 100644
index 000000000..35f2c9cea
Binary files /dev/null and b/PokemonGo-UWP/Assets/Icons/spawnpoint.png differ
diff --git a/PokemonGo-UWP/Assets/UI/ash_withincense.png b/PokemonGo-UWP/Assets/UI/ash_withincense.png
new file mode 100644
index 000000000..d6ba85bf2
Binary files /dev/null and b/PokemonGo-UWP/Assets/UI/ash_withincense.png differ
diff --git a/PokemonGo-UWP/Controls/CircularProgressBar.xaml.cs b/PokemonGo-UWP/Controls/CircularProgressBar.xaml.cs
index 4381cabfd..4d4ea8c01 100644
--- a/PokemonGo-UWP/Controls/CircularProgressBar.xaml.cs
+++ b/PokemonGo-UWP/Controls/CircularProgressBar.xaml.cs
@@ -38,14 +38,10 @@ private static void OnPropertyChanged(DependencyObject sender, DependencyPropert
private static void OnImageSourcePathChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
+ if (sender == null) return;
CircularProgressBar circularProgressBar = sender as CircularProgressBar;
- if (circularProgressBar?.ImageSourcePath != null)
- {
- circularProgressBar.InnerPathRoot.Fill = new ImageBrush
- {
- ImageSource = circularProgressBar.ImageSourcePath
- };
- }
+ BitmapImage fillImg = (circularProgressBar.ImageSourcePath != null) ?new BitmapImage(circularProgressBar.ImageSourcePath) : new BitmapImage();
+ circularProgressBar.InnerPathRoot.Fill = new ImageBrush { ImageSource = fillImg };
}
#endregion
@@ -68,7 +64,7 @@ private static void OnImageSourcePathChanged(DependencyObject sender, Dependency
public static readonly DependencyProperty InnerSegmentColorProperty = DependencyProperty.Register("InnerSegmentColor", typeof(Brush), typeof(CircularProgressBar), new PropertyMetadata(Colors.Gray));
- public static readonly DependencyProperty ImageSourcePathProperty = DependencyProperty.Register("ImageSourcePath", typeof(BitmapImage), typeof(CircularProgressBar), new PropertyMetadata("", OnImageSourcePathChanged));
+ public static readonly DependencyProperty ImageSourcePathProperty = DependencyProperty.Register("ImageSourcePath", typeof(Uri), typeof(CircularProgressBar), new PropertyMetadata("", OnImageSourcePathChanged));
#endregion
@@ -122,9 +118,9 @@ public Brush InnerSegmentColor
set { SetValue(InnerSegmentColorProperty, value); }
}
- public BitmapImage ImageSourcePath
+ public Uri ImageSourcePath
{
- get { return (BitmapImage)GetValue(ImageSourcePathProperty); }
+ get { return (Uri)GetValue(ImageSourcePathProperty); }
set { SetValue(ImageSourcePathProperty, value); }
}
#endregion
diff --git a/PokemonGo-UWP/Entities/AppliedItemWrapper.cs b/PokemonGo-UWP/Entities/AppliedItemWrapper.cs
index 2fd3697af..8d8b2bd83 100644
--- a/PokemonGo-UWP/Entities/AppliedItemWrapper.cs
+++ b/PokemonGo-UWP/Entities/AppliedItemWrapper.cs
@@ -107,4 +107,4 @@ protected virtual void OnPropertyChanged(string propertyName)
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/PokemonGo-UWP/Entities/IncensePokemon.cs b/PokemonGo-UWP/Entities/IncensePokemon.cs
new file mode 100644
index 000000000..65b6699b0
--- /dev/null
+++ b/PokemonGo-UWP/Entities/IncensePokemon.cs
@@ -0,0 +1,110 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.Devices.Geolocation;
+using Windows.Foundation;
+using Newtonsoft.Json;
+using PokemonGo_UWP.Utils;
+using PokemonGo_UWP.Utils.Helpers;
+using PokemonGo_UWP.Views;
+using POGOProtos.Enums;
+using POGOProtos.Map.Fort;
+using Template10.Common;
+using Template10.Mvvm;
+using POGOProtos.Networking.Responses;
+
+namespace PokemonGo_UWP.Entities
+{
+ public class IncensePokemon : IMapPokemon
+ {
+ ///
+ /// Infos on the current lured Pokemon
+ ///
+ [JsonProperty, JsonConverter(typeof(ProtobufJsonNetConverter))]
+ private GetIncensePokemonResponse _incensePokemonResponse;
+
+ public Point Anchor => new Point(0.5, 1);
+
+ public IncensePokemon(GetIncensePokemonResponse incensePokemonResponse, double lat, double lng)
+ {
+ _incensePokemonResponse = incensePokemonResponse;
+ Geoposition = new Geopoint(GetLocation(lat, lng, 1));
+ }
+
+ public void Update(IMapPokemon update)
+ {
+ var incense = (IncensePokemon)update;
+
+ _incensePokemonResponse = incense._incensePokemonResponse;
+ Geoposition = incense.Geoposition;
+
+ OnPropertyChanged(nameof(PokemonId));
+ OnPropertyChanged(nameof(EncounterId));
+ OnPropertyChanged(nameof(SpawnpointId));
+ OnPropertyChanged(nameof(Geoposition));
+ }
+
+ #region Wrapped Properties
+
+ public PokemonId PokemonId => _incensePokemonResponse.PokemonId;
+
+ public ulong EncounterId => _incensePokemonResponse.EncounterId;
+
+ public string SpawnpointId => _incensePokemonResponse.EncounterLocation;
+
+ public Geopoint Geoposition { get; set; }
+
+ #endregion
+
+ private DelegateCommand _tryCatchPokemon;
+
+ ///
+ /// We're just navigating to the capture page, reporting that the player wants to capture the selected Pokemon.
+ ///
+ public DelegateCommand TryCatchPokemon => _tryCatchPokemon ?? (
+ _tryCatchPokemon = new DelegateCommand(() =>
+ {
+ NavigationHelper.NavigationState["CurrentPokemon"] = this;
+ // Disable map update
+ GameClient.ToggleUpdateTimer(false);
+ BootStrapper.Current.NavigationService.Navigate(typeof(CapturePokemonPage));
+ }, () => true)
+ );
+
+ private BasicGeoposition GetLocation(double x0, double y0, int radius)
+ {
+ var random = new Random();
+
+ // Convert radius from meters to degrees
+ double radiusInDegrees = radius / 111000f;
+
+ var u = random.NextDouble();
+ var v = random.NextDouble();
+ var w = radiusInDegrees * Math.Sqrt(u);
+ var t = 2 * Math.PI * v;
+ var x = w * Math.Cos(t);
+ var y = w * Math.Sin(t);
+
+ // Adjust the x-coordinate for the shrinking of the east-west distances
+ var new_x = x / Math.Cos(y0);
+
+ var foundLatitude = new_x + x0;
+ var foundLongitude = y + y0;
+ return new BasicGeoposition { Latitude = foundLatitude, Longitude = foundLongitude };
+ }
+
+ #region INotifyPropertyChanged
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ #endregion
+ }
+}
diff --git a/PokemonGo-UWP/Entities/SpawnPointWrapper.cs b/PokemonGo-UWP/Entities/SpawnPointWrapper.cs
new file mode 100644
index 000000000..851c20694
--- /dev/null
+++ b/PokemonGo-UWP/Entities/SpawnPointWrapper.cs
@@ -0,0 +1,60 @@
+using System.ComponentModel;
+using Newtonsoft.Json;
+using PokemonGo_UWP.Utils.Helpers;
+using POGOProtos.Map;
+using Windows.Devices.Geolocation;
+using Windows.Foundation;
+
+namespace PokemonGo_UWP.Entities
+{
+ ///
+ /// We need to wrap this so we can reduce the number of ui updates.
+ ///
+ public class SpawnPointWrapper : IUpdatable, INotifyPropertyChanged
+ {
+ [JsonProperty, JsonConverter(typeof(ProtobufJsonNetConverter))]
+ private SpawnPoint _spawnPoint;
+
+ public Point Anchor => new Point(0.5, 1);
+
+ public SpawnPointWrapper(SpawnPoint spawnPoint)
+ {
+ _spawnPoint = spawnPoint;
+ Geoposition =
+ new Geopoint(new BasicGeoposition { Latitude = _spawnPoint.Latitude, Longitude = _spawnPoint.Longitude });
+ }
+
+ ///
+ /// The file name for spawnpoint, located in /Assets/Icons
+ ///
+ public string ImageFileName => "spawnpoint.png";
+
+ ///
+ /// The file name for spawnpoint, located in /Assets/Icons
+ ///
+ public string ImageFilePath => $"ms-appx:///Assets/Icons/spawnpoint.png";
+
+ public void Update(SpawnPoint update)
+ {
+ _spawnPoint = update;
+ }
+
+ #region Wrapped Properties
+
+ //public float DistanceInMeters => _spawnPoint.DistanceInMeters;
+ public Geopoint Geoposition { get; set; }
+
+ #endregion
+
+ #region INotifyPropertyChanged
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ #endregion
+ }
+}
diff --git a/PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.cs.xlf b/PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.cs.xlf
index bfd5a85b0..2f2481768 100644
--- a/PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.cs.xlf
+++ b/PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.cs.xlf
@@ -558,6 +558,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.
Empty module slot
Empty module slot
+
+ Use {0} ?
+ Use {0} ?
+