diff options
author | cat_or_not <41955154+catornot@users.noreply.github.com> | 2023-11-05 20:21:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-06 02:21:50 +0100 |
commit | bb822b7638d5ae9bc4499ff76edc74f3741e6518 (patch) | |
tree | 558886bd28dc53d1004e235be1c1543c5ec2fd9f /NorthstarDLL/plugins/plugins.cpp | |
parent | 583bae6e1a7e35eec2c5cb4383bc0089f6ee6781 (diff) | |
download | NorthstarLauncher-1.20.1-rc2.tar.gz NorthstarLauncher-1.20.1-rc2.zip |
Plugins v3 (#472)v1.20.1-rc2v1.20.1-rc1v1.20.0-rc3v1.20.0
- nuked presence logic ( moved to the discord rpc plugin )
- more exposed sq functions
- exposed dll addresses
- `g_pCVar` is exposed
- added "userdata" to plugin's async call
- added runframe to plugins
Diffstat (limited to 'NorthstarDLL/plugins/plugins.cpp')
-rw-r--r-- | NorthstarDLL/plugins/plugins.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/NorthstarDLL/plugins/plugins.cpp b/NorthstarDLL/plugins/plugins.cpp index 18610e2e..121512e5 100644 --- a/NorthstarDLL/plugins/plugins.cpp +++ b/NorthstarDLL/plugins/plugins.cpp @@ -174,10 +174,10 @@ std::optional<Plugin> PluginManager::LoadPlugin(fs::path path, PluginInitFuncs* plugin.inform_sqvm_created = (PLUGIN_INFORM_SQVM_CREATED_TYPE)GetProcAddress(pluginLib, "PLUGIN_INFORM_SQVM_CREATED"); plugin.inform_sqvm_destroyed = (PLUGIN_INFORM_SQVM_DESTROYED_TYPE)GetProcAddress(pluginLib, "PLUGIN_INFORM_SQVM_DESTROYED"); - plugin.push_presence = (PLUGIN_PUSH_PRESENCE_TYPE)GetProcAddress(pluginLib, "PLUGIN_RECEIVE_PRESENCE"); - plugin.inform_dll_load = (PLUGIN_INFORM_DLL_LOAD_TYPE)GetProcAddress(pluginLib, "PLUGIN_INFORM_DLL_LOAD"); + plugin.run_frame = (PLUGIN_RUNFRAME)GetProcAddress(pluginLib, "PLUGIN_RUNFRAME"); + plugin.handle = m_vLoadedPlugins.size(); plugin.logger = std::make_shared<ColoredLogger>(plugin.displayName.c_str(), NS::Colors::PLUGIN); RegisterLogger(plugin.logger); @@ -298,24 +298,24 @@ void PluginManager::InformSQVMDestroyed(ScriptContext context) } } -void PluginManager::PushPresence(PluginGameStatePresence* data) +void PluginManager::InformDLLLoad(const char* dll, void* data, void* dllPtr) { for (auto plugin : m_vLoadedPlugins) { - if (plugin.push_presence != NULL) + if (plugin.inform_dll_load != NULL) { - plugin.push_presence(data); + plugin.inform_dll_load(dll, (PluginEngineData*)data, dllPtr); } } } -void PluginManager::InformDLLLoad(PluginLoadDLL dll, void* data) +void PluginManager::RunFrame() { for (auto plugin : m_vLoadedPlugins) { - if (plugin.inform_dll_load != NULL) + if (plugin.run_frame != NULL) { - plugin.inform_dll_load(dll, data); + plugin.run_frame(); } } } |