summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/plugin.h
blob: bf6b99effed1cb84063ccf52640425ce0c73812f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

struct CMPlugin : public PLUGIN<CMPlugin>
{
	friend class CMLuaOptionsMain;
	friend class CMLuaEvaluateOptions;

	HNETLIBUSER hNetlib = nullptr;

private:
	lua_State *L;

	void LoadLua();
	void UnloadLua();

	OBJLIST<CMLuaScript> m_scripts;
	void LoadLuaScripts();
	void UnloadLuaScripts();
	void ReloadLuaScripts();

	int __cdecl OnOptionsInit(WPARAM wParam, LPARAM);
	int __cdecl OnModulesLoaded(WPARAM, LPARAM);

	INT_PTR __cdecl Eval(WPARAM, LPARAM);
	INT_PTR __cdecl Call(WPARAM, LPARAM);
	INT_PTR __cdecl Exec(WPARAM, LPARAM);

public:
	CMPlugin();

	int Load() override;
	int Unload() override;
};