diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-06-15 15:52:22 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-06-15 15:52:22 +0000 |
commit | 27985042841f1ea60156ed532e0b9f57e9c3b369 (patch) | |
tree | dfb25c2cbdb9b1d8896ce47d9620dd9a569ecf0b /plugins/MirLua/src/main.cpp | |
parent | ff55088a637a2716d1ab950b42b992cce78f4f6b (diff) |
MirLua: added options page
git-svn-id: http://svn.miranda-ng.org/main/trunk@14179 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/main.cpp')
-rw-r--r-- | plugins/MirLua/src/main.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index 88b82af2e7..ce1fa50de9 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -3,10 +3,10 @@ int hLangpack;
HINSTANCE g_hInstance;
-CMLua *mLua;
-HANDLE hCommonFolderPath;
-HANDLE hCustomFolderPath;
+HANDLE g_hCommonFolderPath;
+HANDLE g_hCustomFolderPath;
+CMLua *mLua;
HANDLE hConsole = NULL;
PLUGININFOEX pluginInfo =
@@ -63,6 +63,26 @@ void LoadScripts(const TCHAR *scriptDir) }
}
+int OnOptionsInit(WPARAM wParam, LPARAM)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.ptszGroup = LPGENT("Customize");
+ odp.ptszTitle = LPGENT("Scripts");
+ odp.ptszTab = _T("Lua");
+ odp.pDialog = CLuaOptions::CreateOptionsPage();
+ Options_AddPage(wParam, &odp);
+
+ return 0;
+}
+
+int OnModulesLoaded(WPARAM wParam, LPARAM)
+{
+ HookEvent(ME_OPT_INITIALISE, OnOptionsInit);
+
+ return 0;
+}
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
@@ -80,17 +100,19 @@ extern "C" int __declspec(dllexport) Load(void) mLua = new CMLua();
- hCommonFolderPath = FoldersRegisterCustomPathT("MirLua", Translate("Common scripts folder"), COMMON_SCRIPTS_PATHT);
- hCustomFolderPath = FoldersRegisterCustomPathT("MirLua", Translate("Custom scripts folder"), CUSTOM_SCRIPTS_PATHT);
+ g_hCommonFolderPath = FoldersRegisterCustomPathT("MirLua", Translate("Common scripts folder"), COMMON_SCRIPTS_PATHT);
+ g_hCustomFolderPath = FoldersRegisterCustomPathT("MirLua", Translate("Custom scripts folder"), CUSTOM_SCRIPTS_PATHT);
TCHAR commonScriptDir[MAX_PATH];
- FoldersGetCustomPathT(hCommonFolderPath, commonScriptDir, SIZEOF(commonScriptDir), VARST(COMMON_SCRIPTS_PATHT));
+ FoldersGetCustomPathT(g_hCommonFolderPath, commonScriptDir, SIZEOF(commonScriptDir), VARST(COMMON_SCRIPTS_PATHT));
LoadScripts(commonScriptDir);
TCHAR customScriptDir[MAX_PATH];
- FoldersGetCustomPathT(hCustomFolderPath, customScriptDir, SIZEOF(customScriptDir), VARST(CUSTOM_SCRIPTS_PATHT));
+ FoldersGetCustomPathT(g_hCustomFolderPath, customScriptDir, SIZEOF(customScriptDir), VARST(CUSTOM_SCRIPTS_PATHT));
LoadScripts(customScriptDir);
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+
return 0;
}
|