diff options
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/src/Modules/m_icolib.cpp | 4 | ||||
-rw-r--r-- | plugins/MirLua/src/icons.cpp | 18 | ||||
-rw-r--r-- | plugins/MirLua/src/options.cpp | 10 | ||||
-rw-r--r-- | plugins/MirLua/src/stdafx.h | 2 |
4 files changed, 7 insertions, 27 deletions
diff --git a/plugins/MirLua/src/Modules/m_icolib.cpp b/plugins/MirLua/src/Modules/m_icolib.cpp index 3f94e26894..97fa50ccb3 100644 --- a/plugins/MirLua/src/Modules/m_icolib.cpp +++ b/plugins/MirLua/src/Modules/m_icolib.cpp @@ -57,7 +57,7 @@ static int lua_AddIcon(lua_State *L) sid.description.w = mir_utf8decodeW(luaL_checkstring(L, 2));
sid.section.w = mir_utf8decodeW(luaL_optstring(L, 3, MODULENAME));
sid.defaultFile.w = mir_utf8decodeW(lua_tostring(L, 4));
- sid.hDefaultIcon = GetIcon(IDI_SCRIPT);
+ sid.hDefaultIcon = g_plugin.getIcon(IDI_SCRIPT);
if (sid.defaultFile.w == nullptr) {
sid.defaultFile.w = (wchar_t*)mir_calloc(MAX_PATH + 1);
@@ -133,7 +133,7 @@ static int lua_RemoveIcon(lua_State *L) static luaL_Reg icolibApi[] =
{
{ "AddIcon", lua_AddIcon },
- { "GetIcon", lua_GetIcon },
+ { "g_plugin.getIcon", lua_GetIcon },
{ "GetHandle", lua_GetIconHandle },
{ "GetIconHandle", lua_GetIconHandle },
{ "RemoveIcon", lua_RemoveIcon },
diff --git a/plugins/MirLua/src/icons.cpp b/plugins/MirLua/src/icons.cpp index 52940084f3..74e4d28136 100644 --- a/plugins/MirLua/src/icons.cpp +++ b/plugins/MirLua/src/icons.cpp @@ -14,21 +14,3 @@ void LoadIcons() { g_plugin.registerIcon(MODULENAME, Icons, MODULENAME); } - -HICON GetIcon(int iconId) -{ - for (auto &it : Icons) - if (it.defIconID == iconId) - return IcoLib_GetIconByHandle(it.hIcolib); - - return nullptr; -} - -HANDLE GetIconHandle(int iconId) -{ - for (auto &it : Icons) - if (it.defIconID == iconId) - return it.hIcolib; - - return nullptr; -}
\ No newline at end of file diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp index 83a8b9d7c8..f96a4a15a3 100644 --- a/plugins/MirLua/src/options.cpp +++ b/plugins/MirLua/src/options.cpp @@ -50,11 +50,11 @@ bool CMLuaOptionsMain::OnInitDialog() m_scriptsList.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP);
HIMAGELIST hImageList = m_scriptsList.CreateImageList(LVSIL_SMALL);
- ImageList_AddIcon(hImageList, GetIcon(IDI_LOADED));
- ImageList_AddIcon(hImageList, GetIcon(IDI_FAILED));
- ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN));
- ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
- ImageList_AddIcon(hImageList, GetIcon(IDI_COMPILE));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_LOADED));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_FAILED));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_OPEN));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_RELOAD));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_COMPILE));
wchar_t scriptDir[MAX_PATH];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARSW(MIRLUA_PATHT));
diff --git a/plugins/MirLua/src/stdafx.h b/plugins/MirLua/src/stdafx.h index cd4873de17..9c88b62ad4 100644 --- a/plugins/MirLua/src/stdafx.h +++ b/plugins/MirLua/src/stdafx.h @@ -72,8 +72,6 @@ void LoadNetlib(); void UnloadNetlib();
void LoadIcons();
-HICON GetIcon(int iconId);
-HANDLE GetIconHandle(int iconId);
/* utils */
|