mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-02 19:56:13 +01:00
Close plugin's windows gracefully when stopped
When a plugin is stopped, close all windows created by that plugin. Ensure the close event on the window can not open a new window if the plugin is being stopped.
This commit is contained in:
@@ -56,6 +56,8 @@ void UiScriptExtensions::Extend(ScriptEngine& scriptEngine)
|
||||
ScWindow::Register(ctx);
|
||||
|
||||
InitialiseCustomMenuItems(scriptEngine);
|
||||
scriptEngine.SubscribeToPluginStoppedEvent(
|
||||
[](std::shared_ptr<Plugin> plugin) -> void { CloseWindowsOwnedByPlugin(plugin); });
|
||||
}
|
||||
|
||||
std::shared_ptr<ScWindow> ScWidget::window_get() const
|
||||
|
||||
Reference in New Issue
Block a user