test #1
@ -16,6 +16,10 @@ namespace DualScreenDemo
|
|||||||
public static bool readyForSongListInput = false;
|
public static bool readyForSongListInput = false;
|
||||||
private readonly int _maxHistoryLength = 6; // 最多保留 6 筆
|
private readonly int _maxHistoryLength = 6; // 最多保留 6 筆
|
||||||
private readonly Queue<string> _indataHistory = new Queue<string>();
|
private readonly Queue<string> _indataHistory = new Queue<string>();
|
||||||
|
|
||||||
|
private int _wrongInputCountfor62 = 0; // 錯誤輸入計數器
|
||||||
|
private int _wrongInputCountfor61 = 0; // 錯誤輸入計數器
|
||||||
|
private const int MaxWrongLimit = 3; // 錯誤輸入限制次數
|
||||||
private readonly SongListManager songListManager;
|
private readonly SongListManager songListManager;
|
||||||
|
|
||||||
public CommandHandler(SongListManager songListManager)
|
public CommandHandler(SongListManager songListManager)
|
||||||
@ -336,7 +340,16 @@ namespace DualScreenDemo
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearDisplay();
|
ClearDisplay();
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
_wrongInputCountfor61++;
|
||||||
|
if(_wrongInputCountfor61 <= MaxWrongLimit)
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text += "#";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
||||||
|
_wrongInputCountfor61 = 0; // 重置計數器
|
||||||
|
}
|
||||||
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
||||||
OverlayForm.displayTimer.Start();
|
OverlayForm.displayTimer.Start();
|
||||||
}
|
}
|
||||||
@ -355,7 +368,16 @@ namespace DualScreenDemo
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearDisplay();
|
ClearDisplay();
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
_wrongInputCountfor61++;
|
||||||
|
if(_wrongInputCountfor61 <= MaxWrongLimit)
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text += "#";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
||||||
|
_wrongInputCountfor61 = 0; // 重置計數器
|
||||||
|
}
|
||||||
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
||||||
OverlayForm.displayTimer.Start();
|
OverlayForm.displayTimer.Start();
|
||||||
}
|
}
|
||||||
@ -408,7 +430,16 @@ namespace DualScreenDemo
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearDisplay();
|
ClearDisplay();
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
_wrongInputCountfor62++;
|
||||||
|
if(_wrongInputCountfor62 <= MaxWrongLimit)
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text += "*";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
||||||
|
_wrongInputCountfor62 = 0; // 重置計數器
|
||||||
|
}
|
||||||
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
||||||
OverlayForm.displayTimer.Start();
|
OverlayForm.displayTimer.Start();
|
||||||
}
|
}
|
||||||
@ -425,7 +456,16 @@ namespace DualScreenDemo
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearDisplay();
|
ClearDisplay();
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
_wrongInputCountfor62++;
|
||||||
|
if(_wrongInputCountfor62 <= MaxWrongLimit)
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text += "*";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
||||||
|
_wrongInputCountfor62 = 0; // 重置計數器
|
||||||
|
}
|
||||||
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
OverlayForm.MainForm.nextSongLabel.Visible = false;
|
||||||
OverlayForm.displayTimer.Start();
|
OverlayForm.displayTimer.Start();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user