summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_loader.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-22 09:01:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-22 09:01:42 +0000
commit8be4814cca3be42be785da6a366f3da978a4ab72 (patch)
tree2f21fb9ec763c8e7ca6eb16e09aaf7191868a0b1 /plugins/MirLua/src/mlua_loader.cpp
parent655ac8423ddf001b8d3021e41e7297d7e3e20510 (diff)
MirLua: refactoring
git-svn-id: http://svn.miranda-ng.org/main/trunk@14321 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_loader.cpp')
-rw-r--r--plugins/MirLua/src/mlua_loader.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/plugins/MirLua/src/mlua_loader.cpp b/plugins/MirLua/src/mlua_loader.cpp
deleted file mode 100644
index 1e62b2653d..0000000000
--- a/plugins/MirLua/src/mlua_loader.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "stdafx.h"
-
-CLuaLoader::CLuaLoader(CMLua *mLua) : mLua(mLua)
-{
-}
-
-void CLuaLoader::LoadScripts(const TCHAR *scriptDir)
-{
- mLua->AddScriptsPath(ptrA(mir_utf8encodeT(scriptDir)));
-
- TCHAR searchMask[MAX_PATH];
- mir_sntprintf(searchMask, _T("%s\\%s"), scriptDir, _T("*.lua"));
-
- TCHAR fullPath[MAX_PATH], path[MAX_PATH];
-
- WIN32_FIND_DATA fd;
- HANDLE hFind = FindFirstFile(searchMask, &fd);
- if (hFind != INVALID_HANDLE_VALUE)
- {
- do
- {
- if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
- {
- mir_sntprintf(fullPath, _T("%s\\%s"), scriptDir, fd.cFileName);
- PathToRelativeT(fullPath, path);
- if (db_get_b(NULL, MODULE, _T2A(fd.cFileName), 1))
- mLua->LoadScript(T2Utf(path));
- }
- } while (FindNextFile(hFind, &fd));
- FindClose(hFind);
- }
-}
-
-void CLuaLoader::LoadScripts()
-{
- TCHAR scriptDir[MAX_PATH];
-
- FoldersGetCustomPathT(g_hCommonFolderPath, scriptDir, _countof(scriptDir), VARST(COMMON_SCRIPTS_PATHT));
- LoadScripts(scriptDir);
-
- FoldersGetCustomPathT(g_hCustomFolderPath, scriptDir, _countof(scriptDir), VARST(CUSTOM_SCRIPTS_PATHT));
- LoadScripts(scriptDir);
-} \ No newline at end of file