wire up debug panel

This commit is contained in:
Matt Parker
2025-08-29 19:01:06 +10:00
parent 850be02a52
commit 5f9439c9aa
9 changed files with 116 additions and 28 deletions

View File

@@ -9,6 +9,7 @@ public partial class RunMenuItem : HBoxContainer
public SharpIdeProjectModel Project { get; set; } = null!;
private Label _label = null!;
private Button _runButton = null!;
private Button _debugButton = null!;
private Button _stopButton = null!;
public override void _Ready()
{
@@ -18,6 +19,8 @@ public partial class RunMenuItem : HBoxContainer
_runButton.Pressed += OnRunButtonPressed;
_stopButton = GetNode<Button>("StopButton");
_stopButton.Pressed += OnStopButtonPressed;
_debugButton = GetNode<Button>("DebugButton");
_debugButton.Pressed += OnDebugButtonPressed;
Project.ProjectStartedRunning += OnProjectStartedRunning;
Project.ProjectStoppedRunning += OnProjectStoppedRunning;
}
@@ -27,6 +30,7 @@ public partial class RunMenuItem : HBoxContainer
await this.InvokeAsync(() =>
{
_stopButton.Visible = false;
_debugButton.Visible = true;
_runButton.Visible = true;
});
}
@@ -36,6 +40,7 @@ public partial class RunMenuItem : HBoxContainer
await this.InvokeAsync(() =>
{
_runButton.Visible = false;
_debugButton.Visible = false;
_stopButton.Visible = true;
});
}
@@ -50,4 +55,10 @@ public partial class RunMenuItem : HBoxContainer
GodotGlobalEvents.InvokeBottomPanelTabExternallySelected(BottomPanelType.Run);
await Singletons.RunService.RunProject(Project).ConfigureAwait(false);
}
private async void OnDebugButtonPressed()
{
GodotGlobalEvents.InvokeBottomPanelTabExternallySelected(BottomPanelType.Debug);
await Singletons.RunService.RunProject(Project, true).ConfigureAwait(false);
}
}