summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/icons.cpp
blob: 52940084f362b19d022917be9d4bc3c4b96fad21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "stdafx.h"

static IconItem Icons[] =
{
	{ LPGEN("Script"),  "script",  IDI_SCRIPT  },
	{ LPGEN("Loaded"),  "loaded",  IDI_LOADED  },
	{ LPGEN("Failed"),  "failed",  IDI_FAILED  },
	{ LPGEN("Open"),    "open",    IDI_OPEN    },
	{ LPGEN("Reload"),  "reload",  IDI_RELOAD  },
	{ LPGEN("Compile"), "compile", IDI_COMPILE },
};

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;
}