mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 23:34:37 +01:00
Implement lifetime logic of transient plugins
This commit is contained in:
@@ -145,9 +145,9 @@ namespace OpenRCT2::Scripting
|
||||
IPlatformEnvironment& _env;
|
||||
DukContext _context;
|
||||
bool _initialised{};
|
||||
bool _hotReloading{};
|
||||
bool _pluginsLoaded{};
|
||||
bool _pluginsStarted{};
|
||||
bool _hotReloadingInitialised{};
|
||||
bool _transientPluginsEnabled{};
|
||||
bool _transientPluginsStarted{};
|
||||
std::queue<std::tuple<std::promise<void>, std::string>> _evalQueue;
|
||||
std::vector<std::shared_ptr<Plugin>> _plugins;
|
||||
uint32_t _lastHotReloadCheckTick{};
|
||||
@@ -212,6 +212,8 @@ namespace OpenRCT2::Scripting
|
||||
|
||||
void LoadPlugins();
|
||||
void UnloadPlugins();
|
||||
void LoadTransientPlugins();
|
||||
void UnloadTransientPlugins();
|
||||
void Tick();
|
||||
std::future<void> Eval(const std::string& s);
|
||||
DukValue ExecutePluginCall(
|
||||
@@ -253,8 +255,7 @@ namespace OpenRCT2::Scripting
|
||||
void UnregisterPlugin(std::string_view path);
|
||||
void RegisterPlugin(std::string_view path);
|
||||
void StartIntransientPlugins();
|
||||
void StartPlugins();
|
||||
void StopPlugins();
|
||||
void StartTransientPlugins();
|
||||
void LoadPlugin(const std::string& path);
|
||||
void LoadPlugin(std::shared_ptr<Plugin>& plugin);
|
||||
void UnloadPlugin(std::shared_ptr<Plugin>& plugin);
|
||||
@@ -264,6 +265,7 @@ namespace OpenRCT2::Scripting
|
||||
static bool ShouldLoadScript(std::string_view path);
|
||||
bool ShouldStartPlugin(const std::shared_ptr<Plugin>& plugin);
|
||||
void SetupHotReloading();
|
||||
void DoAutoReloadPluginCheck();
|
||||
void AutoReloadPlugins();
|
||||
void ProcessREPL();
|
||||
void RemoveCustomGameActions(const std::shared_ptr<Plugin>& plugin);
|
||||
|
||||
Reference in New Issue
Block a user