diff options
-rw-r--r-- | plugins/MirLua/docs/examples/database.lua | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/m_icolib.cpp | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/main.cpp | 15 |
3 files changed, 11 insertions, 8 deletions
diff --git a/plugins/MirLua/docs/examples/database.lua b/plugins/MirLua/docs/examples/database.lua index 42625a4f64..33b6863322 100644 --- a/plugins/MirLua/docs/examples/database.lua +++ b/plugins/MirLua/docs/examples/database.lua @@ -26,3 +26,5 @@ if db.GetContactSetting(nil, 'MirLua', 'testByte') then -- @param module The name of section -- @param setting The name of setting db.DeleteContactSetting(nil, 'MirLua', 'testString'); + +db.WriteContactSetting(nil, 'MirLua', 'ShowConsole', 1) diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index cc8808aa0e..a1e1a35d24 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -12,7 +12,7 @@ static int lua_AddIcon(lua_State *L) si.flags = SIDF_PATH_TCHAR;
si.pszName = iconName;
si.description.a = (char*)lua_tostring(L, 2);
- si.section.a = lua_isnone(L, 3) ? "MirLua" : (char*)lua_tostring(L, 3);
+ si.section.a = lua_isnone(L, 3) ? MODULE : (char*)lua_tostring(L, 3);
si.defaultFile.t = filePath;
si.iDefaultIndex = -IDI_ICON;
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index 36c64e2572..ae95013c1a 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -72,15 +72,16 @@ extern "C" int __declspec(dllexport) Load(void) {
mir_getLP(&pluginInfo);
-#ifdef _DEBUG
- if (AllocConsole())
+ if (db_get_b(NULL, MODULE, "ShowConsole", 0))
{
- freopen("CONOUT$", "wt", stdout);
- hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
- SetConsoleTitle(_T("MirLua Console"));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
+ if (AllocConsole())
+ {
+ freopen("CONOUT$", "wt", stdout);
+ hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
+ SetConsoleTitle(_T("MirLua Console"));
+ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
+ }
}
-#endif
mLua = new CMLua();
|