Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Merged latest changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-Apps committed Nov 11, 2016
2 parents 84b6460 + a22177e commit 880656f
Show file tree
Hide file tree
Showing 57 changed files with 1,106 additions and 302 deletions.
3 changes: 2 additions & 1 deletion PokemonGo-UWP/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<utils:PlayerTeamToTeamImageConverter x:Key="PlayerTeamToTeamImageConverter" />
<utils:PlayerTeamToTeamBaseImageConverter x:Key="PlayerTeamToTeamBaseImageConverter" />
<utils:PlayerTeamToTeamNameConverter x:Key="PlayerTeamToTeamNameConverter" />
<utils:AchievementValueToMedalImageConverter x:Key="AchievementValueToMedalImageConverter" />
<utils:AchievementValueToMedalIconConverter x:Key="AchievementValueToMedalIconConverter" />
<utils:PlayerTeamToTeamBackgroundImageConverter x:Key="PlayerTeamToTeamBackgroundImageConverter" />
<utils:AchievementNextValueConverter x:Key="AchievementNextValueConverter" />
<utils:AchievementValueConverter x:Key="AchievementValueConverter" />
Expand All @@ -95,6 +95,7 @@
<utils:IntToBooleanConverter x:Key="IntToBooleanConverter" />
<utils:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<utils:PokemonLastHoursVisibiltyConverter x:Key="PokemonLastHoursVisibiltyConverter" />
<utils:IsIncenseActiveToPlayerIconConverter x:Key="IsIncenseActiveToPlayerIconConverter" />

</ResourceDictionary>
</Application.Resources>
Expand Down
3 changes: 2 additions & 1 deletion PokemonGo-UWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file added PokemonGo-UWP/Assets/Icons/spawnpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PokemonGo-UWP/Assets/UI/ash_withincense.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 6 additions & 10 deletions PokemonGo-UWP/Controls/CircularProgressBar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion PokemonGo-UWP/Entities/AppliedItemWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ protected virtual void OnPropertyChanged(string propertyName)

#endregion
}
}
}
110 changes: 110 additions & 0 deletions PokemonGo-UWP/Entities/IncensePokemon.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Infos on the current lured Pokemon
/// </summary>
[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;

/// <summary>
/// We're just navigating to the capture page, reporting that the player wants to capture the selected Pokemon.
/// </summary>
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
}
}
60 changes: 60 additions & 0 deletions PokemonGo-UWP/Entities/SpawnPointWrapper.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// We need to wrap this so we can reduce the number of ui updates.
/// </summary>
public class SpawnPointWrapper : IUpdatable<SpawnPoint>, 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 });
}

/// <summary>
/// The file name for spawnpoint, located in /Assets/Icons
/// </summary>
public string ImageFileName => "spawnpoint.png";

/// <summary>
/// The file name for spawnpoint, located in /Assets/Icons
/// </summary>
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
}
}
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<source>Empty module slot</source>
<target state="new">Empty module slot</target>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.da.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.de-CH.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ Du hast auch {1} Sternenstaub, {2} Bonbon und {3} EP erhalten.</target>
<target state="translated">Noch {0} ×</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.el.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.en-GB.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.es-MX.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.fi.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ Tu as aussi reçu {1} Poudre d'étoile, {2} Bonbon et {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.he.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.hr-HR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.hr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/MultilingualResources/PokemonGo-UWP.hu.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,10 @@ You also got {1} Stardust, {2} Candy and {3} XP.</target>
<target state="new">{0} use(s) left</target>
<note from="MultilingualBuild" annotates="source" priority="2">If your language uses multiply sign, use × (unicode char) and not x</note>
</trans-unit>
<trans-unit id="ItemUseQuestionText" translate="yes" xml:space="preserve">
<source>Use {0} ?</source>
<target state="new">Use {0} ?</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Loading

0 comments on commit 880656f

Please sign in to comment.