summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/plugin.h
blob: dc07965144173a79e5a972b484909f14dc10f151 (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
#pragma once

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

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;
};