From fdaa2920eb21fff3320a17e9239e04dfadecdb00 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 14:38:54 -0300 Subject: Updated copyright year in all headers --- core/input_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/input_map.cpp') diff --git a/core/input_map.cpp b/core/input_map.cpp index 9426b0568e..83b1e757da 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3 From e323cc050564fdb1b5cf81793d173cbd9483f55a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 18 May 2015 10:20:54 -0300 Subject: -Rename unexisting by nonexistant, closes #1940 -Added function to retrieve list of actions fron InputMap --- core/input_map.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'core/input_map.cpp') diff --git a/core/input_map.cpp b/core/input_map.cpp index 83b1e757da..1196c0c863 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -42,7 +42,7 @@ void InputMap::_bind_methods() { ObjectTypeDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); ObjectTypeDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); ObjectTypeDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); - ObjectTypeDB::bind_method(_MD("get_action_list","action"),&InputMap::get_action_list); + ObjectTypeDB::bind_method(_MD("get_action_list","action"),&InputMap::_get_action_list); ObjectTypeDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); ObjectTypeDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); @@ -162,6 +162,22 @@ void InputMap::action_erase_event(const StringName& p_action,const InputEvent& p } + +Array InputMap::_get_action_list(const StringName& p_action) { + + Array ret; + const List *al = get_action_list(p_action); + if (al) { + for(List::Element *E=al->front();E;E=E->next()) { + + ret.push_back(E->get());; + } + } + + return ret; + +} + const List *InputMap::get_action_list(const StringName& p_action) { const Map::Element *E=input_map.find(p_action); -- cgit v1.2.3 From 5900e7f589d50268d49e2e67d3a498d1b01fe03a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 18 May 2015 11:14:02 -0300 Subject: fix a compile error --- core/input_map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/input_map.cpp') diff --git a/core/input_map.cpp b/core/input_map.cpp index 1196c0c863..24151c59c9 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -168,7 +168,7 @@ Array InputMap::_get_action_list(const StringName& p_action) { Array ret; const List *al = get_action_list(p_action); if (al) { - for(List::Element *E=al->front();E;E=E->next()) { + for(const List::Element *E=al->front();E;E=E->next()) { ret.push_back(E->get());; } @@ -192,7 +192,7 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac Map::Element *E=input_map.find(p_action); if(!E) { - ERR_EXPLAIN("Request for unexisting InputMap action: "+String(p_action)); + ERR_EXPLAIN("Request for nonexistent InputMap action: "+String(p_action)); ERR_FAIL_COND_V(!E,false); } -- cgit v1.2.3