set selected file on sln explorer click

This commit is contained in:
Matt Parker
2025-08-27 18:43:06 +10:00
parent bb03c57df8
commit a8bc6cbe05
4 changed files with 40 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ public partial class IdeRoot : Control
_sharpIdeCodeEdit = GetNode<SharpIdeCodeEdit>("%SharpIdeCodeEdit");
_fileDialog = GetNode<FileDialog>("%OpenSolutionDialog");
_solutionExplorerPanel = GetNode<SolutionExplorerPanel>("%SolutionExplorerPanel");
_solutionExplorerPanel.FileSelected += OnSolutionExplorerPanelOnFileSelected;
_fileDialog.FileSelected += OnFileSelected;
_runPanel = GetNode<RunPanel>("%RunPanel");
_openSlnButton.Pressed += () => _fileDialog.Visible = true;
@@ -45,6 +46,11 @@ public partial class IdeRoot : Control
OnFileSelected(@"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\BlazorCodeBreaker.slnx");
}
private async void OnSolutionExplorerPanelOnFileSelected(SharpIdeFileGodotContainer file)
{
await _sharpIdeCodeEdit.SetSharpIdeFile(file.File);
}
private void OnFileSelected(string path)
{
_ = GodotTask.Run(async () =>