diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/input_map.cpp | 18 | ||||
-rw-r--r-- | core/input_map.h | 2 | ||||
-rw-r--r-- | core/method_bind.h | 2 | ||||
-rw-r--r-- | core/object.cpp | 8 |
4 files changed, 24 insertions, 6 deletions
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<InputEvent> *al = get_action_list(p_action); + if (al) { + for(List<InputEvent>::Element *E=al->front();E;E=E->next()) { + + ret.push_back(E->get());; + } + } + + return ret; + +} + const List<InputEvent> *InputMap::get_action_list(const StringName& p_action) { const Map<StringName, Action>::Element *E=input_map.find(p_action); diff --git a/core/input_map.h b/core/input_map.h index 875a39555f..c5b21b1457 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -46,6 +46,8 @@ class InputMap : public Object { List<InputEvent>::Element *_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const; + Array _get_action_list(const StringName& p_action); + protected: static void _bind_methods(); diff --git a/core/method_bind.h b/core/method_bind.h index 49c64bd11c..85c1084f80 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -298,7 +298,7 @@ MethodBind* create_native_method_bind( Variant (T::*p_method)(const Variant**,in // tale of an amazing hack.. // -// if you declare an unexisting class.. +// if you declare an nonexistent class.. class __UnexistingClass; diff --git a/core/object.cpp b/core/object.cpp index c1904d05d7..1a51e79a9f 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1319,7 +1319,7 @@ Error Object::connect(const StringName& p_signal, Object *p_to_object, const Str if (!s) { bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_signal); if (!signal_is_valid) { - ERR_EXPLAIN("Attempt to connect to unexisting signal: "+p_signal); + ERR_EXPLAIN("Attempt to connect to nonexistent signal: "+p_signal); ERR_FAIL_COND_V(!signal_is_valid,ERR_INVALID_PARAMETER); } signal_map[p_signal]=Signal(); @@ -1356,7 +1356,7 @@ bool Object::is_connected(const StringName& p_signal, Object *p_to_object, const bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_signal); if (signal_is_valid) return false; - ERR_EXPLAIN("Unexisting signal: "+p_signal); + ERR_EXPLAIN("Nonexistent signal: "+p_signal); ERR_FAIL_COND_V(!s,false); } @@ -1373,7 +1373,7 @@ void Object::disconnect(const StringName& p_signal, Object *p_to_object, const S ERR_FAIL_NULL(p_to_object); Signal *s = signal_map.getptr(p_signal); if (!s) { - ERR_EXPLAIN("Unexisting signal: "+p_signal); + ERR_EXPLAIN("Nonexistent signal: "+p_signal); ERR_FAIL_COND(!s); } if (s->lock>0) { @@ -1384,7 +1384,7 @@ void Object::disconnect(const StringName& p_signal, Object *p_to_object, const S Signal::Target target(p_to_object->get_instance_ID(),p_to_method); if (!s->slot_map.has(target)) { - ERR_EXPLAIN("Disconnecting unexisting signal '"+p_signal+"', slot: "+itos(target._id)+":"+target.method); + ERR_EXPLAIN("Disconnecting nonexistent signal '"+p_signal+"', slot: "+itos(target._id)+":"+target.method); ERR_FAIL(); } int prev = p_to_object->connections.size(); |