mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 09:44:52 +01:00
Add hook system
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../common.h"
|
||||
#include "HookEngine.h"
|
||||
#include "Plugin.h"
|
||||
#include <future>
|
||||
#include <queue>
|
||||
@@ -27,6 +28,16 @@ namespace OpenRCT2
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
{
|
||||
class ScriptExecutionInfo
|
||||
{
|
||||
private:
|
||||
Plugin * _plugin;
|
||||
|
||||
public:
|
||||
Plugin * GetCurrentPlugin() { return _plugin; }
|
||||
void SetCurrentPlugin(Plugin * value) { _plugin = value; }
|
||||
};
|
||||
|
||||
class ScriptEngine
|
||||
{
|
||||
private:
|
||||
@@ -37,12 +48,16 @@ namespace OpenRCT2::Scripting
|
||||
std::queue<std::tuple<std::promise<void>, std::string>> _evalQueue;
|
||||
std::vector<Plugin> _plugins;
|
||||
uint32 _lastHotReloadCheckTick{};
|
||||
HookEngine _hookEngine;
|
||||
ScriptExecutionInfo _execInfo;
|
||||
|
||||
public:
|
||||
ScriptEngine(InteractiveConsole& console, IPlatformEnvironment& env);
|
||||
ScriptEngine(ScriptEngine&) = delete;
|
||||
~ScriptEngine();
|
||||
|
||||
HookEngine& GetHookEngine() { return _hookEngine; }
|
||||
|
||||
void Update();
|
||||
std::future<void> Eval(const std::string &s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user