wire up debug panel
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user