fix(DD2Switcher): improve settings loading logging and update keybind textbox with current value
This commit is contained in:
@@ -109,9 +109,12 @@ namespace DD2Switcher {
|
||||
}
|
||||
|
||||
private static void LoadSettings() {
|
||||
Console.WriteLine($"Attempting to load settings from: {settingsPath}");
|
||||
try {
|
||||
if (File.Exists(settingsPath)) {
|
||||
Console.WriteLine("Settings file exists, reading...");
|
||||
string json = File.ReadAllText(settingsPath);
|
||||
Console.WriteLine($"Read JSON: {json}");
|
||||
var settings = JsonSerializer.Deserialize<Settings>(json);
|
||||
FirstIndex = settings.FirstIndex;
|
||||
LastIndex = settings.LastIndex;
|
||||
@@ -119,10 +122,12 @@ namespace DD2Switcher {
|
||||
Console.WriteLine(
|
||||
$"Loaded settings: First={FirstIndex}, Last={LastIndex}, Keybind={SequenceKeybind}");
|
||||
} else {
|
||||
Console.WriteLine("No settings file found, using defaults");
|
||||
Console.WriteLine($"Settings file does not exist at: {settingsPath}");
|
||||
Console.WriteLine("Using default settings");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Console.WriteLine($"Error loading settings: {ex.Message}");
|
||||
Console.WriteLine($"Stack trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -82,7 +82,7 @@ namespace DD2Switcher {
|
||||
this.sequenceKeybindTextBox.Name = "sequenceKeybindTextBox";
|
||||
this.sequenceKeybindTextBox.Size = new System.Drawing.Size(111, 20);
|
||||
this.sequenceKeybindTextBox.TabIndex = 1;
|
||||
this.sequenceKeybindTextBox.Text = "F1";
|
||||
this.sequenceKeybindTextBox.Text = Program.SequenceKeybind.ToString();
|
||||
this.sequenceKeybindTextBox.Leave += new System.EventHandler(this.sequenceKeybindTextBox_Leave);
|
||||
//
|
||||
// sequenceKeybindLabel
|
||||
|
Reference in New Issue
Block a user