summaryrefslogtreecommitdiff
path: root/Runtime/IMGUI/NamedKeyControlList.cpp
blob: 6574a1393656bf80819cffd27909af2878b78797 (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
#include "UnityPrefix.h"
#include "Runtime/IMGUI/NamedKeyControlList.h"
namespace IMGUI
{
	
void NamedKeyControlList::AddNamedControl (const std::string &name, int id, int windowID)
{
	m_NamedControls[name] = NamedControl (id, windowID);
}

std::string NamedKeyControlList::GetNameOfControl (int id) 
{
	for (std::map<std::string, NamedControl>::const_iterator i = m_NamedControls.begin(); i != m_NamedControls.end(); i++)
		if (i->second.ID == id)
			return i->first;
	return std::string ("");
}

NamedControl* NamedKeyControlList::GetControlNamed (const std::string &name)
{
	std::map<std::string, NamedControl>::iterator i = m_NamedControls.find (name);
	if (i != m_NamedControls.end ())
		return &i->second;
	return NULL;
}

} // namespace