diff --git a/src/SharpIDE.Godot/Features/IdeSettings/AppState.cs b/src/SharpIDE.Godot/Features/IdeSettings/AppState.cs index a68cc6d..4c49004 100644 --- a/src/SharpIDE.Godot/Features/IdeSettings/AppState.cs +++ b/src/SharpIDE.Godot/Features/IdeSettings/AppState.cs @@ -11,6 +11,7 @@ public class IdeSettings { public bool AutoOpenLastSolution { get; set; } public string? DebuggerExecutablePath { get; set; } + public bool DebuggerUseSharpDbg { get; set; } = true; public float UiScale { get; set; } = 1.0f; } diff --git a/src/SharpIDE.Godot/Features/Settings/SettingsWindow.cs b/src/SharpIDE.Godot/Features/Settings/SettingsWindow.cs index ea7912f..678b306 100644 --- a/src/SharpIDE.Godot/Features/Settings/SettingsWindow.cs +++ b/src/SharpIDE.Godot/Features/Settings/SettingsWindow.cs @@ -6,16 +6,24 @@ public partial class SettingsWindow : Window { private SpinBox _uiScaleSpinBox = null!; private LineEdit _debuggerFilePathLineEdit = null!; + private CheckButton _debuggerUseSharpDbgCheckButton = null!; public override void _Ready() { CloseRequested += Hide; _uiScaleSpinBox = GetNode("%UiScaleSpinBox"); _debuggerFilePathLineEdit = GetNode("%DebuggerFilePathLineEdit"); + _debuggerUseSharpDbgCheckButton = GetNode("%DebuggerUseSharpDbgCheckButton"); _uiScaleSpinBox.ValueChanged += OnUiScaleSpinBoxValueChanged; _debuggerFilePathLineEdit.TextChanged += DebuggerFilePathChanged; + _debuggerUseSharpDbgCheckButton.Toggled += OnDebuggerUseSharpDbgCheckButtonOnToggled; AboutToPopup += OnAboutToPopup; } + private void OnDebuggerUseSharpDbgCheckButtonOnToggled(bool pressed) + { + Singletons.AppState.IdeSettings.DebuggerUseSharpDbg = pressed; + } + private void DebuggerFilePathChanged(string newText) { Singletons.AppState.IdeSettings.DebuggerExecutablePath = newText; @@ -25,6 +33,7 @@ public partial class SettingsWindow : Window { _uiScaleSpinBox.Value = Singletons.AppState.IdeSettings.UiScale; _debuggerFilePathLineEdit.Text = Singletons.AppState.IdeSettings.DebuggerExecutablePath; + _debuggerUseSharpDbgCheckButton.ButtonPressed = Singletons.AppState.IdeSettings.DebuggerUseSharpDbg; } private void OnUiScaleSpinBoxValueChanged(double value) diff --git a/src/SharpIDE.Godot/Features/Settings/SettingsWindow.tscn b/src/SharpIDE.Godot/Features/Settings/SettingsWindow.tscn index 0b5e97f..4ffdf55 100644 --- a/src/SharpIDE.Godot/Features/Settings/SettingsWindow.tscn +++ b/src/SharpIDE.Godot/Features/Settings/SettingsWindow.tscn @@ -72,6 +72,30 @@ layout_mode = 2 theme_override_colors/font_color = Color(0.5686275, 0.5686275, 0.5686275, 1) text = "Experimental. Non-integer scales will be blurry." +[node name="VBoxContainer3" type="VBoxContainer" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer3"] +layout_mode = 2 + +[node name="Label" type="Label" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer3/HBoxContainer2"] +layout_mode = 2 +text = "Use SharpDbg" + +[node name="DebuggerUseSharpDbgCheckButton" type="CheckButton" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer3/HBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +button_pressed = true + +[node name="HBoxContainer" type="HBoxContainer" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer3"] +layout_mode = 2 + +[node name="Label2" type="Label" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer3/HBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.5686275, 0.5686275, 0.5686275, 1) +text = "Use the included SharpDbg debugger" + [node name="VBoxContainer2" type="VBoxContainer" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2"] layout_mode = 2 theme_override_constants/separation = 2 @@ -94,7 +118,7 @@ layout_mode = 2 [node name="Label2" type="Label" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer2/HBoxContainer"] layout_mode = 2 theme_override_colors/font_color = Color(0.5686275, 0.5686275, 0.5686275, 1) -text = "Experimental. Get netcoredbg from" +text = "Necessary if 'Use SharpDbg' is disabled. Get netcoredbg from" [node name="LinkButton" type="LinkButton" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer2/HBoxContainer"] layout_mode = 2