Create EventWrapper

This commit is contained in:
Matt Parker
2025-10-07 19:30:08 +10:00
parent de60182c05
commit 9d4970aa67
12 changed files with 103 additions and 43 deletions

View File

@@ -25,7 +25,7 @@ public partial class CodeEditorPanel : MarginContainer
var tabBar = _tabContainer.GetTabBar();
tabBar.TabCloseDisplayPolicy = TabBar.CloseButtonDisplayPolicy.ShowAlways;
tabBar.TabClosePressed += OnTabClosePressed;
GlobalEvents.Instance.DebuggerExecutionStopped += OnDebuggerExecutionStopped;
GlobalEvents.Instance.DebuggerExecutionStopped.Subscribe(OnDebuggerExecutionStopped);
}
public override void _UnhandledKeyInput(InputEvent @event)

View File

@@ -22,14 +22,14 @@ public partial class DebugPanel : Control
//_tabBar.TabClosePressed
_tabBar.TabClicked += OnTabBarTabClicked;
_tabsPanel = GetNode<MarginContainer>("%TabsPanel");
GlobalEvents.Instance.ProjectStartedDebugging += async projectModel =>
GlobalEvents.Instance.ProjectStartedDebugging.Subscribe(async projectModel =>
{
await this.InvokeAsync(() => ProjectStartedDebugging(projectModel));
};
GlobalEvents.Instance.ProjectStoppedDebugging += async projectModel =>
});
GlobalEvents.Instance.ProjectStoppedDebugging.Subscribe(async projectModel =>
{
await this.InvokeAsync(() => ProjectStoppedDebugging(projectModel));
};
});
}
private void OnTabBarTabClicked(long idx)

View File

@@ -20,7 +20,7 @@ public partial class ThreadsVariablesSubTab : Control
_threadsVboxContainer = GetNode<VBoxContainer>("%ThreadsPanel/VBoxContainer");
_stackFramesVboxContainer = GetNode<VBoxContainer>("%StackFramesPanel/VBoxContainer");
_variablesVboxContainer = GetNode<VBoxContainer>("%VariablesPanel/VBoxContainer");
GlobalEvents.Instance.DebuggerExecutionStopped += OnDebuggerExecutionStopped;
GlobalEvents.Instance.DebuggerExecutionStopped.Subscribe(OnDebuggerExecutionStopped);
}

View File

@@ -21,14 +21,14 @@ public partial class RunPanel : Control
//_tabBar.TabClosePressed
_tabBar.TabClicked += OnTabBarTabClicked;
_tabsPanel = GetNode<MarginContainer>("%TabsPanel");
GlobalEvents.Instance.ProjectStartedRunning += async projectModel =>
GlobalEvents.Instance.ProjectStartedRunning.Subscribe(async projectModel =>
{
await this.InvokeAsync(() => ProjectStartedRunning(projectModel));
};
GlobalEvents.Instance.ProjectStoppedRunning += async projectModel =>
});
GlobalEvents.Instance.ProjectStoppedRunning.Subscribe(async projectModel =>
{
await this.InvokeAsync(() => ProjectStoppedRunning(projectModel));
};
});
}
private void OnTabBarTabClicked(long idx)