From 0d997585ac4f9a4675721b7e3053457f823aedc6 Mon Sep 17 00:00:00 2001 From: Kalakoi Date: Thu, 22 May 2025 10:48:28 -0400 Subject: [PATCH] Adjusted splash screen to enable loading of data prior to launching main application. --- osrs-toolbox/Views/SplashScreenView.xaml | 5 +---- osrs-toolbox/Views/SplashScreenView.xaml.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/osrs-toolbox/Views/SplashScreenView.xaml b/osrs-toolbox/Views/SplashScreenView.xaml index d121fb0..100afe1 100644 --- a/osrs-toolbox/Views/SplashScreenView.xaml +++ b/osrs-toolbox/Views/SplashScreenView.xaml @@ -5,10 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:osrs_toolbox" mc:Ignorable="d" - Title="OSRS Toolbox" SizeToContent="WidthAndHeight" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" MouseDown="Window_MouseDown" WindowStartupLocation="CenterScreen"> - - - + Title="OSRS Toolbox" SizeToContent="WidthAndHeight" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" MouseDown="Window_MouseDown" WindowStartupLocation="CenterScreen" PreviewKeyDown="Window_PreviewKeyDown" Loaded="Window_Loaded"> diff --git a/osrs-toolbox/Views/SplashScreenView.xaml.cs b/osrs-toolbox/Views/SplashScreenView.xaml.cs index 78eb546..ca5c2e5 100644 --- a/osrs-toolbox/Views/SplashScreenView.xaml.cs +++ b/osrs-toolbox/Views/SplashScreenView.xaml.cs @@ -32,5 +32,21 @@ namespace osrs_toolbox if (e.LeftButton == MouseButtonState.Pressed) DragMove(); } + + private void Window_PreviewKeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Space) + { + Application.Current.MainWindow = HomePageView.Current; + HomePageView.Current.Show(); + this.Close(); + } + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + HomePageView hp = new HomePageView(); + //TODO: Handle loading of data into datacontext, then open home screen + } } }