Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 14 additions & 6 deletions PokemonGo-UWP/PokemonGo-UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,12 @@
<Compile Include="Controls\MessageDialog\StepperMessageDialog.xaml.cs">
<DependentUpon>StepperMessageDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\MessageDialog\TextboxMessageDialog.xaml.cs">
<DependentUpon>TextboxMessageDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\CircularProgressBar.xaml.cs">
<DependentUpon>CircularProgressBar.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\MessageDialog\TextboxMessageDialog.xaml.cs">
<DependentUpon>TextboxMessageDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Entities\FortDataWrapper.cs" />
<Compile Include="Entities\IMapPokemon.cs" />
<Compile Include="Entities\IUpdatable.cs" />
Expand Down Expand Up @@ -813,6 +813,9 @@
<Compile Include="ViewModels\SettingsPageViewModel.cs" />
<Compile Include="ViewModels\LoginPageViewModel.cs" />
<Compile Include="ViewModels\SearchPokeStopPageViewModel.cs" />
<Compile Include="Views\Dialogs\LoadingScreen.xaml.cs">
<DependentUpon>LoadingScreen.xaml</DependentUpon>
</Compile>
<Compile Include="Views\EggDetailPage.xaml.cs">
<DependentUpon>EggDetailPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -879,6 +882,7 @@
<Content Include="Assets\UI\pokestopBG.png" />
<Content Include="Assets\UI\poksetop.png" />
<Content Include="Assets\UI\stardust.png" />
<Content Include="Assets\Backgrounds\loading_screen.png" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
Expand All @@ -900,19 +904,23 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\MessageDialog\TextboxMessageDialog.xaml">
<Page Include="Controls\CircularProgressBar.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\CircularProgressBar.xaml">
<SubType>Designer</SubType>
<Page Include="Controls\MessageDialog\TextboxMessageDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\Custom.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Page>
<Page Include="Views\Dialogs\LoadingScreen.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\EggDetailPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
3 changes: 3 additions & 0 deletions PokemonGo-UWP/Strings/en-US/CodeResources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ You also got {1} Stardust, {2} Candy and {3} XP.</value>
<data name="SetNickName" xml:space="preserve">
<value>Set Nickname</value>
</data>
<data name="LoadingMessage" xml:space="preserve">
<value>LOADING...</value>
</data>
<data name="OkText" xml:space="preserve">
<value>O. K.</value>
<comment>Space between . and K</comment>
Expand Down
4 changes: 4 additions & 0 deletions PokemonGo-UWP/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,8 @@
<data name="AwardedExperienceTextBlock.Text" xml:space="preserve">
<value>Experience</value>
</data>
<data name="LoadingMessage.Text" xml:space="preserve">
<value>Remember to be alert at all times.
Stay aware of your surroundings.</value>
</data>
</root>
10 changes: 5 additions & 5 deletions PokemonGo-UWP/Utils/GameClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public static async Task InitializeDataUpdate()
//Trick to trigger the PropertyChanged for MapAutomaticOrientationMode ;)
SettingsService.Instance.MapAutomaticOrientationMode = SettingsService.Instance.MapAutomaticOrientationMode;
#endregion
Busy.SetBusy(true, Resources.CodeResources.GetString("GettingGpsSignalText"));
LoadingScreen.SetBusy(true, Resources.CodeResources.GetString("GettingGpsSignalText"));
await LocationServiceHelper.Instance.InitializeAsync();
LocationServiceHelper.Instance.PropertyChanged += LocationHelperPropertyChanged;
// Before starting we need game settings
Expand All @@ -549,12 +549,12 @@ public static async Task InitializeDataUpdate()
_heartbeat = new Heartbeat();
await _heartbeat.StartDispatcher();
// Update before starting timer
Busy.SetBusy(true, Resources.CodeResources.GetString("GettingUserDataText"));
LoadingScreen.SetBusy(true, Resources.CodeResources.GetString("GettingUserDataText"));
//await UpdateMapObjects();
await UpdateInventory();
await UpdateItemTemplates();
if(PlayerProfile != null && PlayerStats != null)
Busy.SetBusy(false);
LoadingScreen.SetBusy(false);
}

private static async void LocationHelperPropertyChanged(object sender, PropertyChangedEventArgs e)
Expand Down Expand Up @@ -753,12 +753,12 @@ public static async Task<LevelUpRewardsResponse> UpdatePlayerStats(bool checkFor
var levelUpResponse = await GetLevelUpRewards(tmpStats.Level);
await UpdateInventory();
// Set busy to false because initial loading may have left it going until we had PlayerStats
Busy.SetBusy(false);
LoadingScreen.SetBusy(false);
return levelUpResponse;
}
PlayerStats = tmpStats;
// Set busy to false because initial loading may have left it going until we had PlayerStats
Busy.SetBusy(false);
LoadingScreen.SetBusy(false);
return null;
}

Expand Down
57 changes: 57 additions & 0 deletions PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<UserControl x:Class="PokemonGo_UWP.Views.LoadingScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">

<RelativePanel VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">

<RelativePanel.Background>
<ImageBrush x:Name="BackgroundImageBrush"
ImageSource="../../Assets/Backgrounds/loading_screen.png"
Stretch="Fill"/>
</RelativePanel.Background>

<TextBlock Margin="0,0,0,24"
FontSize="20"
RelativePanel.Above="LoadingProgressBar"
RelativePanel.AlignHorizontalCenterWithPanel="True"
TextAlignment="Center"
Foreground="Black"
Text="{x:Bind BusyText, Mode=OneWay, FallbackValue='BusyText'}" />
<ProgressBar x:Name="LoadingProgressBar"
RelativePanel.Above="InfoMessageBorder"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
Margin="24,0"
Height="48"
IsIndeterminate="{x:Bind IsBusy, Mode=OneWay}"
Grid.Row="1"
Foreground="Black" />

<Border x:Name="InfoMessageBorder"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"
Background="#AAFFFFFF"
Height="70"
CornerRadius="10"
Margin="24">
<TextBlock x:Name="InfoMessageTextBlock"
FontSize="20"
Margin="6"
x:Uid="LoadingMessage"
Text="Loading Mesasge"
TextWrapping="Wrap"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
Foreground="Black"/>
</Border>
</RelativePanel>

</UserControl>
76 changes: 76 additions & 0 deletions PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Template10.Common;
using Template10.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI;
using System;
using Windows.UI.Xaml.Media.Imaging;
using Windows.ApplicationModel.Activation;
using PokemonGo_UWP.Utils;

namespace PokemonGo_UWP.Views
{
public sealed partial class LoadingScreen : UserControl
{
public static readonly DependencyProperty BusyTextProperty =
DependencyProperty.Register(nameof(BusyText), typeof(string), typeof(LoadingScreen),
new PropertyMetadata("LOADING..."));

public static readonly DependencyProperty InfoMessageProperty =
DependencyProperty.Register(nameof(InfoMessage), typeof(string), typeof(LoadingScreen),
new PropertyMetadata(""));

public static readonly DependencyProperty IsBusyProperty =
DependencyProperty.Register(nameof(IsBusy), typeof(bool), typeof(LoadingScreen), new PropertyMetadata(false));

private DispatcherTimer timer = new DispatcherTimer();

public LoadingScreen()
{
InitializeComponent();
}

public LoadingScreen(SplashScreen splashScreen) {
InitializeComponent();
timer.Start();
BusyText = Utils.Resources.CodeResources.GetString("LoadingMessage");
IsBusy = true;
}

public string BusyText
{
get { return (string) GetValue(BusyTextProperty); }
set { SetValue(BusyTextProperty, value); }
}

public bool IsBusy
{
get { return (bool) GetValue(IsBusyProperty); }
set { SetValue(IsBusyProperty, value); }
}

public string InfoMessage
{
get { return (string)GetValue(InfoMessageProperty); }
set { SetValue(InfoMessageProperty, value); }
}

// hide and show busy dialog
public static void SetBusy(bool busy, string text = null)
{
WindowWrapper.Current().Dispatcher.Dispatch(() =>
{
var modal = Window.Current.Content as ModalDialog;
if (modal == null) return;
var view = modal.ModalContent as LoadingScreen;
if (view == null)
modal.ModalContent = view = new LoadingScreen();
modal.HorizontalContentAlignment = HorizontalAlignment.Stretch;
modal.ModalBackground = new SolidColorBrush(Colors.Transparent);
modal.IsModal = view.IsBusy = busy;
view.BusyText = text;
});
}
}
}