diff --git a/PokemonGo-UWP/Assets/Backgrounds/loading_screen.png b/PokemonGo-UWP/Assets/Backgrounds/loading_screen.png new file mode 100644 index 000000000..b6b0fc45c Binary files /dev/null and b/PokemonGo-UWP/Assets/Backgrounds/loading_screen.png differ diff --git a/PokemonGo-UWP/PokemonGo-UWP.csproj b/PokemonGo-UWP/PokemonGo-UWP.csproj index 695d96d3a..c77603eef 100644 --- a/PokemonGo-UWP/PokemonGo-UWP.csproj +++ b/PokemonGo-UWP/PokemonGo-UWP.csproj @@ -737,12 +737,12 @@ StepperMessageDialog.xaml - - TextboxMessageDialog.xaml - CircularProgressBar.xaml + + TextboxMessageDialog.xaml + @@ -813,6 +813,9 @@ + + LoadingScreen.xaml + EggDetailPage.xaml @@ -879,6 +882,7 @@ + @@ -900,19 +904,23 @@ Designer MSBuild:Compile - + Designer MSBuild:Compile - - Designer + MSBuild:Compile + Designer Designer MSBuild:Compile PreserveNewest + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/PokemonGo-UWP/Strings/en-US/CodeResources.resw b/PokemonGo-UWP/Strings/en-US/CodeResources.resw index bbb2a15a5..9032fc8b5 100644 --- a/PokemonGo-UWP/Strings/en-US/CodeResources.resw +++ b/PokemonGo-UWP/Strings/en-US/CodeResources.resw @@ -327,6 +327,9 @@ You also got {1} Stardust, {2} Candy and {3} XP. Set Nickname + + LOADING... + O. K. Space between . and K diff --git a/PokemonGo-UWP/Strings/en-US/Resources.resw b/PokemonGo-UWP/Strings/en-US/Resources.resw index c947404ec..efee9a46d 100644 --- a/PokemonGo-UWP/Strings/en-US/Resources.resw +++ b/PokemonGo-UWP/Strings/en-US/Resources.resw @@ -306,4 +306,8 @@ Experience + + Remember to be alert at all times. +Stay aware of your surroundings. + \ No newline at end of file diff --git a/PokemonGo-UWP/Utils/GameClient.cs b/PokemonGo-UWP/Utils/GameClient.cs index 317b44958..e2b3a4b37 100644 --- a/PokemonGo-UWP/Utils/GameClient.cs +++ b/PokemonGo-UWP/Utils/GameClient.cs @@ -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 @@ -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) @@ -753,12 +753,12 @@ public static async Task 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; } diff --git a/PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml b/PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml new file mode 100644 index 000000000..64ef03672 --- /dev/null +++ b/PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml.cs b/PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml.cs new file mode 100644 index 000000000..a6e6223eb --- /dev/null +++ b/PokemonGo-UWP/Views/Dialogs/LoadingScreen.xaml.cs @@ -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; + }); + } + } +} \ No newline at end of file