add settings option for SharpDbg
This commit is contained in:
@@ -11,6 +11,7 @@ public class IdeSettings
|
|||||||
{
|
{
|
||||||
public bool AutoOpenLastSolution { get; set; }
|
public bool AutoOpenLastSolution { get; set; }
|
||||||
public string? DebuggerExecutablePath { get; set; }
|
public string? DebuggerExecutablePath { get; set; }
|
||||||
|
public bool DebuggerUseSharpDbg { get; set; } = true;
|
||||||
public float UiScale { get; set; } = 1.0f;
|
public float UiScale { get; set; } = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,24 @@ public partial class SettingsWindow : Window
|
|||||||
{
|
{
|
||||||
private SpinBox _uiScaleSpinBox = null!;
|
private SpinBox _uiScaleSpinBox = null!;
|
||||||
private LineEdit _debuggerFilePathLineEdit = null!;
|
private LineEdit _debuggerFilePathLineEdit = null!;
|
||||||
|
private CheckButton _debuggerUseSharpDbgCheckButton = null!;
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
CloseRequested += Hide;
|
CloseRequested += Hide;
|
||||||
_uiScaleSpinBox = GetNode<SpinBox>("%UiScaleSpinBox");
|
_uiScaleSpinBox = GetNode<SpinBox>("%UiScaleSpinBox");
|
||||||
_debuggerFilePathLineEdit = GetNode<LineEdit>("%DebuggerFilePathLineEdit");
|
_debuggerFilePathLineEdit = GetNode<LineEdit>("%DebuggerFilePathLineEdit");
|
||||||
|
_debuggerUseSharpDbgCheckButton = GetNode<CheckButton>("%DebuggerUseSharpDbgCheckButton");
|
||||||
_uiScaleSpinBox.ValueChanged += OnUiScaleSpinBoxValueChanged;
|
_uiScaleSpinBox.ValueChanged += OnUiScaleSpinBoxValueChanged;
|
||||||
_debuggerFilePathLineEdit.TextChanged += DebuggerFilePathChanged;
|
_debuggerFilePathLineEdit.TextChanged += DebuggerFilePathChanged;
|
||||||
|
_debuggerUseSharpDbgCheckButton.Toggled += OnDebuggerUseSharpDbgCheckButtonOnToggled;
|
||||||
AboutToPopup += OnAboutToPopup;
|
AboutToPopup += OnAboutToPopup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDebuggerUseSharpDbgCheckButtonOnToggled(bool pressed)
|
||||||
|
{
|
||||||
|
Singletons.AppState.IdeSettings.DebuggerUseSharpDbg = pressed;
|
||||||
|
}
|
||||||
|
|
||||||
private void DebuggerFilePathChanged(string newText)
|
private void DebuggerFilePathChanged(string newText)
|
||||||
{
|
{
|
||||||
Singletons.AppState.IdeSettings.DebuggerExecutablePath = newText;
|
Singletons.AppState.IdeSettings.DebuggerExecutablePath = newText;
|
||||||
@@ -25,6 +33,7 @@ public partial class SettingsWindow : Window
|
|||||||
{
|
{
|
||||||
_uiScaleSpinBox.Value = Singletons.AppState.IdeSettings.UiScale;
|
_uiScaleSpinBox.Value = Singletons.AppState.IdeSettings.UiScale;
|
||||||
_debuggerFilePathLineEdit.Text = Singletons.AppState.IdeSettings.DebuggerExecutablePath;
|
_debuggerFilePathLineEdit.Text = Singletons.AppState.IdeSettings.DebuggerExecutablePath;
|
||||||
|
_debuggerUseSharpDbgCheckButton.ButtonPressed = Singletons.AppState.IdeSettings.DebuggerUseSharpDbg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUiScaleSpinBoxValueChanged(double value)
|
private void OnUiScaleSpinBoxValueChanged(double value)
|
||||||
|
|||||||
@@ -72,6 +72,30 @@ layout_mode = 2
|
|||||||
theme_override_colors/font_color = Color(0.5686275, 0.5686275, 0.5686275, 1)
|
theme_override_colors/font_color = Color(0.5686275, 0.5686275, 0.5686275, 1)
|
||||||
text = "Experimental. Non-integer scales will be blurry."
|
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"]
|
[node name="VBoxContainer2" type="VBoxContainer" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_constants/separation = 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"]
|
[node name="Label2" type="Label" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer2/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_colors/font_color = Color(0.5686275, 0.5686275, 0.5686275, 1)
|
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"]
|
[node name="LinkButton" type="LinkButton" parent="HSplitContainer/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer2/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|||||||
Reference in New Issue
Block a user