From 1fe4df4b7be02b80d3a0708cdaa9d4c0e5b892d7 Mon Sep 17 00:00:00 2001 From: Kalakoi Date: Thu, 22 May 2025 11:43:38 -0400 Subject: [PATCH] Added timer to splash screen to simulate data load. --- osrs-toolbox/Views/SplashScreenView.xaml.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osrs-toolbox/Views/SplashScreenView.xaml.cs b/osrs-toolbox/Views/SplashScreenView.xaml.cs index ca5c2e5..eb1fc1e 100644 --- a/osrs-toolbox/Views/SplashScreenView.xaml.cs +++ b/osrs-toolbox/Views/SplashScreenView.xaml.cs @@ -11,6 +11,7 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; +using System.Windows.Threading; namespace osrs_toolbox { @@ -20,11 +21,16 @@ namespace osrs_toolbox public partial class SplashScreenView : Window { public static SplashScreenView Current; + private DispatcherTimer timer; public SplashScreenView() { InitializeComponent(); Current = this; + timer = new DispatcherTimer(); + timer.Interval = TimeSpan.FromSeconds(15); + timer.Tick += new EventHandler(TimerTick); + timer.Start(); } private void Window_MouseDown(object sender, MouseButtonEventArgs e) @@ -43,6 +49,13 @@ namespace osrs_toolbox } } + private void TimerTick(object sender, EventArgs e) + { + Application.Current.MainWindow = HomePageView.Current; + HomePageView.Current.Show(); + this.Close(); + } + private void Window_Loaded(object sender, RoutedEventArgs e) { HomePageView hp = new HomePageView();