From 2b0b4d5ca09b2e9805a0c24f5d84a012db827608 Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Mon, 14 Apr 2025 11:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=99=E6=8E=A7=E5=99=A8=E8=AA=BF=E6=95=B4+?= =?UTF-8?q?=E6=AD=A1=E8=BF=8E=E8=A9=9E=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommandHandler.cs | 32 ++++++++++++++++++++++++++------ bin/WelcomeMessage.txt | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CommandHandler.cs b/CommandHandler.cs index 34c992d..e69dcc9 100644 --- a/CommandHandler.cs +++ b/CommandHandler.cs @@ -41,6 +41,9 @@ namespace DualScreenDemo break; case "A263A4": ClearDisplay(); + _wrongInputCountfor62 = 0; // 重置計數器 + _wrongInputCountfor61 = 0; // 重置計數器 + _indataHistory.Clear(); // 清空歷史紀錄 break; case "A268A4": OverlayForm.MainForm.currentPage = 1; @@ -343,11 +346,13 @@ namespace DualScreenDemo _wrongInputCountfor61++; if(_wrongInputCountfor61 <= MaxWrongLimit) { - OverlayForm.MainForm.displayLabel.Text += "#"; + string old =""; + OverlayForm.MainForm.displayLabel.Text = check_control(old); } else { OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!"; + _indataHistory.Clear(); // 清空歷史紀錄 _wrongInputCountfor61 = 0; // 重置計數器 } OverlayForm.MainForm.nextSongLabel.Visible = false; @@ -371,11 +376,13 @@ namespace DualScreenDemo _wrongInputCountfor61++; if(_wrongInputCountfor61 <= MaxWrongLimit) { - OverlayForm.MainForm.displayLabel.Text += "#"; + string old =""; + OverlayForm.MainForm.displayLabel.Text = check_control(old); } else { OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!"; + _indataHistory.Clear(); // 清空歷史紀錄 _wrongInputCountfor61 = 0; // 重置計數器 } OverlayForm.MainForm.nextSongLabel.Visible = false; @@ -385,6 +392,16 @@ namespace DualScreenDemo } } + private string check_control(string old){ + foreach(string item in _indataHistory) + { + if(item == "A261A4") + old += "#"; + else if(item == "A262A4") + old += "*"; + } + return old; + } private void HandleInputB() { @@ -433,11 +450,13 @@ namespace DualScreenDemo _wrongInputCountfor62++; if(_wrongInputCountfor62 <= MaxWrongLimit) { - OverlayForm.MainForm.displayLabel.Text += "*"; + string old =""; + OverlayForm.MainForm.displayLabel.Text = check_control(old); } else { OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!"; + _indataHistory.Clear(); // 清空歷史紀錄 _wrongInputCountfor62 = 0; // 重置計數器 } OverlayForm.MainForm.nextSongLabel.Visible = false; @@ -459,11 +478,13 @@ namespace DualScreenDemo _wrongInputCountfor62++; if(_wrongInputCountfor62 <= MaxWrongLimit) { - OverlayForm.MainForm.displayLabel.Text += "*"; + string old =""; + OverlayForm.MainForm.displayLabel.Text = check_control(old); } else { OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!"; + _indataHistory.Clear(); // 清空歷史紀錄 _wrongInputCountfor62 = 0; // 重置計數器 } OverlayForm.MainForm.nextSongLabel.Visible = false; @@ -475,9 +496,8 @@ namespace DualScreenDemo private static void ClearDisplay() { - OverlayForm.displayTimer.Stop(); - + if (OverlayForm.MainForm.InvokeRequired) { diff --git a/bin/WelcomeMessage.txt b/bin/WelcomeMessage.txt index 016907b..3ab46c9 100644 --- a/bin/WelcomeMessage.txt +++ b/bin/WelcomeMessage.txt @@ -1 +1 @@ -歡迎使用超級巨星歡唱網路版系統,與你共度美好時光。 \ No newline at end of file +歡迎使用網路版系統,與你共度美好時光。 \ No newline at end of file