Format
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DD2Switcher {
|
||||
public class Settings {
|
||||
@@ -71,8 +72,6 @@ namespace DD2Switcher {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void ExitSequenceMode() {
|
||||
CurrentState = SequenceState.INACTIVE;
|
||||
CurrentSequenceIndex = -1;
|
||||
@@ -203,12 +202,11 @@ namespace DD2Switcher {
|
||||
private static bool AltPressed = false;
|
||||
|
||||
// State handlers
|
||||
private static readonly Dictionary<SequenceState, Action> stateHandlers = new Dictionary<SequenceState, Action> {
|
||||
{ SequenceState.INACTIVE, HandleInactive },
|
||||
{ SequenceState.WAITING_FOR_EVENT, HandleWaitingForEvent },
|
||||
{ SequenceState.WAITING_TO_ADVANCE, HandleWaitingToAdvance },
|
||||
{ SequenceState.ADVANCE, HandleAdvance }
|
||||
};
|
||||
private static readonly Dictionary<SequenceState, Action> stateHandlers =
|
||||
new Dictionary<SequenceState, Action> { { SequenceState.INACTIVE, HandleInactive },
|
||||
{ SequenceState.WAITING_FOR_EVENT, HandleWaitingForEvent },
|
||||
{ SequenceState.WAITING_TO_ADVANCE, HandleWaitingToAdvance },
|
||||
{ SequenceState.ADVANCE, HandleAdvance } };
|
||||
|
||||
private static void HandleInactive() {
|
||||
// Inactive state - do nothing
|
||||
@@ -224,13 +222,12 @@ namespace DD2Switcher {
|
||||
private static void HandleWaitingToAdvance() {
|
||||
// Start timer to advance after N milliseconds
|
||||
Console.WriteLine($"Starting 500ms timer in WAITING_TO_ADVANCE state");
|
||||
Task.Delay(500).ContinueWith(_ => {
|
||||
if (CurrentState == SequenceState.WAITING_TO_ADVANCE) {
|
||||
CurrentState = SequenceState.ADVANCE;
|
||||
Console.WriteLine($"Timer expired, transitioning to ADVANCE state");
|
||||
HandleSequenceEvent();
|
||||
}
|
||||
});
|
||||
System.Threading.Thread.Sleep(500);
|
||||
if (CurrentState == SequenceState.WAITING_TO_ADVANCE) {
|
||||
CurrentState = SequenceState.ADVANCE;
|
||||
Console.WriteLine($"Timer expired, transitioning to ADVANCE state");
|
||||
HandleSequenceEvent();
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleAdvance() {
|
||||
|
4
DD2Switcher/WindowPanelForm.Designer.cs
generated
4
DD2Switcher/WindowPanelForm.Designer.cs
generated
@@ -16,7 +16,7 @@ namespace DD2Switcher {
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
@@ -120,7 +120,7 @@ namespace DD2Switcher {
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label indexLabel;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
|
Reference in New Issue
Block a user