feat(Program.cs): add sequence timer delay setting to customize delay between sequence steps
This commit is contained in:
@@ -13,6 +13,8 @@ namespace DD2Switcher {
|
||||
private FlowLayoutPanel windowsPanel;
|
||||
private Label sequenceKeybindLabel;
|
||||
private TextBox sequenceKeybindTextBox;
|
||||
private Label sequenceTimerDelayLabel;
|
||||
private NumericUpDown sequenceTimerDelayNumericUpDown;
|
||||
|
||||
public SettingsForm() {
|
||||
InitializeComponent();
|
||||
@@ -27,9 +29,12 @@ namespace DD2Switcher {
|
||||
this.sequenceTab = new System.Windows.Forms.TabPage();
|
||||
this.sequenceKeybindTextBox = new System.Windows.Forms.TextBox();
|
||||
this.sequenceKeybindLabel = new System.Windows.Forms.Label();
|
||||
this.sequenceTimerDelayNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.sequenceTimerDelayLabel = new System.Windows.Forms.Label();
|
||||
this.tabControl.SuspendLayout();
|
||||
this.windowsTab.SuspendLayout();
|
||||
this.sequenceTab.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.sequenceTimerDelayNumericUpDown)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl
|
||||
@@ -66,6 +71,8 @@ namespace DD2Switcher {
|
||||
//
|
||||
// sequenceTab
|
||||
//
|
||||
this.sequenceTab.Controls.Add(this.sequenceTimerDelayNumericUpDown);
|
||||
this.sequenceTab.Controls.Add(this.sequenceTimerDelayLabel);
|
||||
this.sequenceTab.Controls.Add(this.sequenceKeybindTextBox);
|
||||
this.sequenceTab.Controls.Add(this.sequenceKeybindLabel);
|
||||
this.sequenceTab.Location = new System.Drawing.Point(4, 22);
|
||||
@@ -94,6 +101,27 @@ namespace DD2Switcher {
|
||||
this.sequenceKeybindLabel.TabIndex = 0;
|
||||
this.sequenceKeybindLabel.Text = "Sequence Keybind:";
|
||||
//
|
||||
// sequenceTimerDelayLabel
|
||||
//
|
||||
this.sequenceTimerDelayLabel.AutoSize = true;
|
||||
this.sequenceTimerDelayLabel.Location = new System.Drawing.Point(20, 50);
|
||||
this.sequenceTimerDelayLabel.Name = "sequenceTimerDelayLabel";
|
||||
this.sequenceTimerDelayLabel.Size = new System.Drawing.Size(100, 13);
|
||||
this.sequenceTimerDelayLabel.TabIndex = 2;
|
||||
this.sequenceTimerDelayLabel.Text = "Timer Delay (ms):";
|
||||
//
|
||||
// sequenceTimerDelayNumericUpDown
|
||||
//
|
||||
this.sequenceTimerDelayNumericUpDown.Location = new System.Drawing.Point(126, 47);
|
||||
this.sequenceTimerDelayNumericUpDown.Name = "sequenceTimerDelayNumericUpDown";
|
||||
this.sequenceTimerDelayNumericUpDown.Size = new System.Drawing.Size(111, 20);
|
||||
this.sequenceTimerDelayNumericUpDown.TabIndex = 3;
|
||||
this.sequenceTimerDelayNumericUpDown.Minimum = 10;
|
||||
this.sequenceTimerDelayNumericUpDown.Maximum = 10000;
|
||||
this.sequenceTimerDelayNumericUpDown.Value = Program.SequenceTimerDelay;
|
||||
this.sequenceTimerDelayNumericUpDown.ValueChanged +=
|
||||
new System.EventHandler(this.sequenceTimerDelayNumericUpDown_ValueChanged);
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -111,6 +139,7 @@ namespace DD2Switcher {
|
||||
this.windowsTab.ResumeLayout(false);
|
||||
this.sequenceTab.ResumeLayout(false);
|
||||
this.sequenceTab.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.sequenceTimerDelayNumericUpDown)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
@@ -259,6 +288,19 @@ namespace DD2Switcher {
|
||||
}
|
||||
}
|
||||
|
||||
private void sequenceTimerDelayNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
Console.WriteLine(
|
||||
$"sequenceTimerDelayNumericUpDown_ValueChanged called with value: {sequenceTimerDelayNumericUpDown.Value}");
|
||||
try {
|
||||
int newDelay = (int)sequenceTimerDelayNumericUpDown.Value;
|
||||
Program.SequenceTimerDelay = newDelay;
|
||||
Program.SaveSettings();
|
||||
Console.WriteLine($"Timer delay updated to: {newDelay}ms");
|
||||
} catch (Exception ex) {
|
||||
Console.WriteLine($"Error updating timer delay: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e) {
|
||||
Console.WriteLine("SettingsForm closing - saving keybind");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user