mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +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:
@@ -96,11 +96,25 @@ void Plugin::Start()
|
||||
_hasStarted = true;
|
||||
}
|
||||
|
||||
void Plugin::Stop()
|
||||
void Plugin::StopBegin()
|
||||
{
|
||||
_isStopping = true;
|
||||
}
|
||||
|
||||
void Plugin::StopEnd()
|
||||
{
|
||||
_isStopping = false;
|
||||
_hasStarted = false;
|
||||
}
|
||||
|
||||
void Plugin::ThrowIfStopping() const
|
||||
{
|
||||
if (IsStopping())
|
||||
{
|
||||
duk_error(_context, DUK_ERR_ERROR, "Plugin is stopping.");
|
||||
}
|
||||
}
|
||||
|
||||
void Plugin::LoadCodeFromFile()
|
||||
{
|
||||
_code = File::ReadAllText(_path);
|
||||
|
||||
Reference in New Issue
Block a user