Move Godot events to instance

This commit is contained in:
Matt Parker
2025-09-30 19:43:49 +10:00
parent 51817f580e
commit eb88897a2a
9 changed files with 43 additions and 36 deletions

View File

@@ -39,7 +39,7 @@ public partial class CodeEditorPanel : MarginContainer
private void OnTabClicked(long tab)
{
var sharpIdeFile = _tabContainer.GetChild<SharpIdeCodeEdit>((int)tab).SharpIdeFile;
GodotGlobalEvents.InvokeFileExternallySelected(sharpIdeFile);
GodotGlobalEvents.Instance.InvokeFileExternallySelected(sharpIdeFile);
}
private void OnTabClosePressed(long tabIndex)
@@ -87,7 +87,7 @@ public partial class CodeEditorPanel : MarginContainer
if (executionStopInfo.FilePath != currentSharpIdeFile?.Path)
{
var file = Solution.AllFiles.Single(s => s.Path == executionStopInfo.FilePath);
await GodotGlobalEvents.InvokeFileExternallySelectedAndWait(file).ConfigureAwait(false);
await GodotGlobalEvents.Instance.InvokeFileExternallySelectedAndWait(file).ConfigureAwait(false);
}
var lineInt = executionStopInfo.Line - 1; // Debugging is 1-indexed, Godot is 0-indexed
Guard.Against.Negative(lineInt, nameof(lineInt));