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

Commit

Permalink
Merge pull request #36 from JFouts/master
Browse files Browse the repository at this point in the history
Turn Pokestops Purple when used, #26
  • Loading branch information
ST-Apps authored Jul 31, 2016
2 parents a1870f7 + 197dc71 commit 40b4390
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions PokemonGo-UWP/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<utils:PokemonDataToVisibilityConverter x:Key="PokemonDataToVisibilityConverter" />
<utils:ItemAwardToPokemonSpriteConverter x:Key="ItemAwardToPokemonSpriteConverter" />
<utils:NearbyPokemonDistanceToDistanceImageConverter x:Key="NearbyPokemonDistanceToDistanceImageConverter" />
<utils:PokestopToIconConverter x:Key="PokestopToIconConverter" />

</ResourceDictionary>
</Application.Resources>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions PokemonGo-UWP/PokemonGo-UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<Content Include="Assets\Icons\Footprint_Near.png" />
<Content Include="Assets\Icons\FrontPortraitRing.png" />
<Content Include="Assets\Icons\pokestop_near.png" />
<Content Include="Assets\Icons\pokestop_near_inactive.png" />
<Content Include="Assets\Icons\stardust_painted.png" />
<Content Include="Assets\Icons\stardust_vector.png" />
<Content Include="Assets\Items\Egg.png" />
Expand Down
21 changes: 21 additions & 0 deletions PokemonGo-UWP/Utils/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using AllEnum;
using Google.Protobuf.Collections;
using PokemonGo.RocketAPI.GeneratedCode;
using PokemonGo.RocketAPI.Extensions;

namespace PokemonGo_UWP.Utils
{
Expand Down Expand Up @@ -227,6 +228,26 @@ public object ConvertBack(object value, Type targetType, object parameter, strin
#endregion
}

public class PokestopToIconConverter : IValueConverter
{
#region Implementation of IValueConverter

public object Convert(object value, Type targetType, object parameter, string language)
{
var cooldown = (long)value;
var inactve = "_inactive";
if (cooldown < DateTime.UtcNow.ToUnixTime()) inactve = "";
return new Uri($"ms-appx:///Assets/Icons/pokestop_near{inactve}.png");
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return value;
}

#endregion
}

public class EmptyConverter : IValueConverter
{
#region Implementation of IValueConverter
Expand Down
2 changes: 1 addition & 1 deletion PokemonGo-UWP/Views/GameMapPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<Button Style="{ThemeResource ImageButtonStyle}"
CommandParameter="{Binding}"
Command="{Binding TrySearchPokestop, Source={Binding GameManagerViewModel, Source={StaticResource Locator}}}">
<Image Source="../Assets/Icons/pokestop_near.png"
<Image Source="{Binding CooldownCompleteTimestampMs, Converter={StaticResource PokestopToIconConverter}}"
maps:MapControl.Location="{Binding Converter={StaticResource MapObjectToGeopointConverter}, ConverterParameter=pokestop}"
maps:MapControl.NormalizedAnchorPoint="0,1"
Stretch="Uniform"
Expand Down

0 comments on commit 40b4390

Please sign in to comment.