From 091442e3c61ffa3fbddf0dc0f4b8f8b10fa98d90 Mon Sep 17 00:00:00 2001 From: Space Time Date: Thu, 3 Oct 2024 19:25:16 +0800 Subject: [PATCH] =?UTF-8?q?1.1.1=20->=201.1.2=20=E7=AC=AC20=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Wins/MainWin.xaml.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs index b787903..6d7db43 100644 --- a/Wins/MainWin.xaml.cs +++ b/Wins/MainWin.xaml.cs @@ -291,7 +291,7 @@ public partial class MainWin : Window while (GameFlashInterval > 10) { - Left = random.Next(0, (int)((int)SystemParameters.PrimaryScreenWidth - ActualWidth)); + Left = random.Next(0, (int)(SystemParameters.PrimaryScreenWidth - ActualWidth)); Top = random.Next(0, (int)(SystemParameters.PrimaryScreenHeight - ActualHeight)); PaletteHelper paletteHelper = new(); @@ -301,6 +301,9 @@ public partial class MainWin : Window newTheme.SetBaseTheme(random.Next(2) == 0 ? BaseTheme.Light : BaseTheme.Dark); paletteHelper.SetTheme(newTheme); + if (GameFlashInterval > 100) + GameFlashInterval += random.Next(1, 4); + await Task.Delay(GameFlashInterval); } @@ -309,10 +312,18 @@ public partial class MainWin : Window } else { - if (GameFlashInterval > 100) - GameFlashInterval -= 150; - else if (GameFlashInterval > 10) - GameFlashInterval -= 30; + switch (GameFlashInterval) + { + case > 250: + GameFlashInterval -= 150; + break; + case > 100: + GameFlashInterval = 100; + break; + case > 10: + GameFlashInterval -= 30; + break; + } if (GameFlashInterval > 10) MessageBox.Show($"{MainConst._GameGradeMsg} {GameFlashInterval}");