From 3d95ec897aba52663e8aa919bb8dd9eed5f74dbc Mon Sep 17 00:00:00 2001 From: aunsane Date: Wed, 13 Jun 2018 21:06:38 +0300 Subject: MirLua: - Lua engine moved to separate class - added ability to compile scripts - renamed script enable setting name - version bump --- plugins/MirLua/src/script.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'plugins/MirLua/src/script.h') diff --git a/plugins/MirLua/src/script.h b/plugins/MirLua/src/script.h index 2caf88c925..383bac1190 100644 --- a/plugins/MirLua/src/script.h +++ b/plugins/MirLua/src/script.h @@ -1,21 +1,20 @@ #pragma once -class CMLuaScript : public CMLuaEnvironment +enum class ScriptStatus { -public: - enum Status - { - None, - Loaded, - Failed - }; + None, + Loaded, + Failed, +}; +class CMLuaScript : public CMLuaEnvironment +{ private: - Status status; - int unloadRef; - - const wchar_t *fileName; + wchar_t *scriptName; wchar_t filePath[MAX_PATH]; + bool isBinary; + ScriptStatus status; + int unloadRef; public: CMLuaScript(lua_State *L, const wchar_t *path); @@ -23,16 +22,20 @@ public: ~CMLuaScript(); const wchar_t* GetFilePath() const; - const wchar_t* GetFileName() const; + const wchar_t* GetName() const; - bool IsEnabled(); + bool IsBinary() const; + + bool IsEnabled() const; void Enable(); void Disable(); - Status GetStatus() const; + ScriptStatus GetStatus() const; int Load() override; int Unload() override; bool Reload(); + + bool Compile(); }; -- cgit v1.2.3