r5sdk/r5dev/pluginsystem/pluginsystem.h
Marvin D 55a620aa4d CPluginSystem init, for native mods.
* Not finished yet.
* Need to make a proper ModuleManager
* Handle PluginSystem_Reload()
2022-08-20 01:59:36 +02:00

35 lines
1.1 KiB
C++

#pragma once
class CPluginSystem
{
public:
struct PluginInstance
{
PluginInstance(string svPluginName, string svPluginFullPath) : m_svPluginName(svPluginName), m_svPluginFullPath(svPluginFullPath), m_svDescription(std::string()), m_nVersion(0), m_hModule(""), m_bIsLoaded(false) {};
// Might wanna make a status code system.
typedef void(*OnLoad)(CModule, CModule);
typedef void(*OnUnload)(CModule);
typedef int16_t (*GetVersion)();
typedef const char* (*GetDescription)();
CModule m_hModule;
string m_svPluginName;
string m_svPluginFullPath;
string m_svDescription;
int16_t m_nVersion;
bool m_bIsLoaded; // [ PIXIE ]: I don't like this and it's bad.
// I will make a module manager later which will grab all modules from the processand adds each module / removes module that passes through DLLMain.
};
void PluginSystem_Init();
void PluginSystem_Reload();
bool ReloadPluginInstance(PluginInstance& pluginInst);
bool LoadPluginInstance(PluginInstance& pluginInst);
bool UnloadPluginInstance(PluginInstance& pluginInst);
vector<PluginInstance>& GetPluginInstances();
private:
vector<PluginInstance> pluginInstances;
};