run panel appears after build

This commit is contained in:
Matt Parker
2026-01-18 17:16:51 +10:00
parent 56784ecfd3
commit 7ca1de42c0
4 changed files with 6 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using Godot; using Godot;
using SharpIDE.Application.Features.Events;
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
using SharpIDE.Godot.Features.Build; using SharpIDE.Godot.Features.Build;
using SharpIDE.Godot.Features.Debug_; using SharpIDE.Godot.Features.Debug_;
@@ -44,8 +45,13 @@ public partial class BottomPanelManager : Panel
}; };
GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected); GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected);
GlobalEvents.Instance.ProjectStartedRunning.Subscribe(OnProjectStartedRunning);
GlobalEvents.Instance.ProjectStartedDebugging.Subscribe(OnProjectStartedDebugging);
} }
private async Task OnProjectStartedRunning(SharpIdeProjectModel _) => GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Run);
private async Task OnProjectStartedDebugging(SharpIdeProjectModel arg) => GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Debug);
public override void _ExitTree() public override void _ExitTree()
{ {
GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected); GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected);

View File

@@ -55,13 +55,11 @@ public partial class RunMenuItem : HBoxContainer
private async void OnRunButtonPressed() private async void OnRunButtonPressed()
{ {
GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Run);
await _runService.RunProject(Project).ConfigureAwait(false); await _runService.RunProject(Project).ConfigureAwait(false);
} }
private async void OnDebugButtonPressed() private async void OnDebugButtonPressed()
{ {
GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Debug);
var debuggerExecutableInfo = new DebuggerExecutableInfo var debuggerExecutableInfo = new DebuggerExecutableInfo
{ {
UseInMemorySharpDbg = Singletons.AppState.IdeSettings.DebuggerUseSharpDbg, UseInMemorySharpDbg = Singletons.AppState.IdeSettings.DebuggerUseSharpDbg,

View File

@@ -62,7 +62,6 @@ public partial class SolutionExplorerPanel
{ {
_ = Task.GodotRun(async () => _ = Task.GodotRun(async () =>
{ {
GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Run);
await _runService.RunProject(project); await _runService.RunProject(project);
}); });
} }
@@ -98,7 +97,6 @@ public partial class SolutionExplorerPanel
} }
private async Task MsBuildProject(SharpIdeProjectModel project, BuildType buildType) private async Task MsBuildProject(SharpIdeProjectModel project, BuildType buildType)
{ {
GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Build);
await _buildService.MsBuildAsync(project.FilePath, buildType); await _buildService.MsBuildAsync(project.FilePath, buildType);
} }
} }

View File

@@ -137,7 +137,6 @@ public partial class IdeRoot : Control
private async void MsBuild(BuildType buildType) private async void MsBuild(BuildType buildType)
{ {
await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Build);
await _buildService.MsBuildAsync(_solutionExplorerPanel.SolutionModel.FilePath, buildType); await _buildService.MsBuildAsync(_solutionExplorerPanel.SolutionModel.FilePath, buildType);
} }