summaryrefslogtreecommitdiff
path: root/Runtime/IMGUI/NamedKeyControlList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/IMGUI/NamedKeyControlList.cpp')
-rw-r--r--Runtime/IMGUI/NamedKeyControlList.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/Runtime/IMGUI/NamedKeyControlList.cpp b/Runtime/IMGUI/NamedKeyControlList.cpp
new file mode 100644
index 0000000..6574a13
--- /dev/null
+++ b/Runtime/IMGUI/NamedKeyControlList.cpp
@@ -0,0 +1,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 \ No newline at end of file