From 7f01b66b38b1b533fb80cce95e6413d99638daf9 Mon Sep 17 00:00:00 2001 From: ashpynov Date: Sat, 9 Nov 2024 21:38:00 +0300 Subject: [PATCH 1/2] Video Splash Screen --- .../FullscreenApplication.cs | 12 +- .../Playnite.FullscreenApp/HiddenStyles.xaml | 2 +- .../Playnite.FullscreenApp.csproj | 6 + source/Playnite.FullscreenApp/ProgramEntry.cs | 5 +- .../Windows/VideoSplashScreen.xaml | 23 ++ .../Windows/VideoSplashScreen.xaml.cs | 199 ++++++++++++++++++ 6 files changed, 239 insertions(+), 8 deletions(-) create mode 100644 source/Playnite.FullscreenApp/Windows/VideoSplashScreen.xaml create mode 100644 source/Playnite.FullscreenApp/Windows/VideoSplashScreen.xaml.cs diff --git a/source/Playnite.FullscreenApp/FullscreenApplication.cs b/source/Playnite.FullscreenApp/FullscreenApplication.cs index 630302c33..3dbe4db80 100644 --- a/source/Playnite.FullscreenApp/FullscreenApplication.cs +++ b/source/Playnite.FullscreenApp/FullscreenApplication.cs @@ -41,7 +41,7 @@ public FullscreenAppViewModel MainModel } } - private SplashScreen splashScreen; + private ExtendedSplashScreen splashScreen; private bool sdlInitialized = false; public static AudioEngine Audio { get; private set; } public static IntPtr NavigateSound { get; private set; } @@ -55,10 +55,10 @@ public FullscreenAppViewModel MainModel get => PlayniteApplication.Current == null ? null : (FullscreenApplication)PlayniteApplication.Current; } - public FullscreenApplication(Func appInitializer, SplashScreen splashScreen, CmdLineOptions cmdLine) + public FullscreenApplication(Func appInitializer, ExtendedSplashScreen splashScreen, CmdLineOptions cmdLine) : base(appInitializer, ApplicationMode.Fullscreen, cmdLine) { - this.splashScreen = splashScreen; + this.splashScreen = splashScreen; } public override void ConfigureViews() @@ -161,11 +161,13 @@ private async void OpenMainViewAsync() Extensions.LoadScripts(AppSettings.DisabledPlugins, CmdLine.SafeStartup, AppSettings.DevelExtenions.Where(a => a.Selected == true).Select(a => a.Item).ToList()); OnExtensionsLoaded(); - splashScreen?.Close(new TimeSpan(0)); MainModel.OpenView(); CurrentNative.MainWindow = MainModel.Window.Window; - await MainModel.ProcessStartupLibUpdate(); + CurrentNative.MainWindow.Activate(); + splashScreen?.Close(new TimeSpan(0)); + await MainModel.ProcessStartupLibUpdate(); + // This is most likely safe place to consider application to be started properly FileSystem.DeleteFile(PlaynitePaths.SafeStartupFlagFile); } diff --git a/source/Playnite.FullscreenApp/HiddenStyles.xaml b/source/Playnite.FullscreenApp/HiddenStyles.xaml index 12a338892..909145898 100644 --- a/source/Playnite.FullscreenApp/HiddenStyles.xaml +++ b/source/Playnite.FullscreenApp/HiddenStyles.xaml @@ -25,7 +25,7 @@