From e323cc050564fdb1b5cf81793d173cbd9483f55a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 18 May 2015 10:20:54 -0300 Subject: [PATCH] -Rename unexisting by nonexistant, closes #1940 -Added function to retrieve list of actions fron InputMap --- core/input_map.cpp | 18 +++++++++++++++++- core/input_map.h | 2 ++ core/method_bind.h | 2 +- core/object.cpp | 8 ++++---- doc/base/classes.xml | 2 +- modules/gdscript/gd_script.cpp | 2 +- scene/animation/animation_player.cpp | 2 +- servers/visual/shader_language.cpp | 2 +- tools/docdump/class_list.xml | 2 +- tools/editor/project_export.cpp | 2 +- 10 files changed, 30 insertions(+), 12 deletions(-) diff --git a/core/input_map.cpp b/core/input_map.cpp index 83b1e757da1..1196c0c863c 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); diff --git a/core/input_map.h b/core/input_map.h index 875a39555fc..c5b21b14571 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -46,6 +46,8 @@ class InputMap : public Object { List::Element *_find_event(List &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 49c64bd11c3..85c1084f807 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 c1904d05d76..1a51e79a9f2 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(); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 901bfa1253a..57ca460979f 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -9655,7 +9655,7 @@ - Editor will not allow to select unexisting files. + Editor will not allow to select nonexistent files. diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index c9b00f49acc..ceca1ff2b9d 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -140,7 +140,7 @@ String GDFunction::_get_call_error(const Variant::CallError& p_err, const String } else if (p_err.error==Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { err_text="Invalid call to "+p_where+". Expected "+itos(p_err.argument)+" arguments."; } else if (p_err.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) { - err_text="Invalid call. Unexisting "+p_where+"."; + err_text="Invalid call. Nonexistent "+p_where+"."; } else if (p_err.error==Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) { err_text="Attempt to call "+p_where+" on a null instance."; } else { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 51afe6b3fc4..4949b33c475 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -295,7 +295,7 @@ void AnimationPlayer::_generate_node_caches(AnimationData* p_anim) { p_anim->node_cache[i]->bone_idx=p_anim->node_cache[i]->skeleton->find_bone(bone_name); if (p_anim->node_cache[i]->bone_idx<0) { - // broken track (unexisting bone) + // broken track (nonexistent bone) p_anim->node_cache[i]->skeleton=NULL; p_anim->node_cache[i]->spatial=NULL; printf("bone is %ls\n", String(bone_name).c_str()); diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 77b7ddbc937..ea56306241e 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1714,7 +1714,7 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex if (!existing) { - parser.set_error("Unexisting identifier in expression: "+identifier); + parser.set_error("Nonexistent identifier in expression: "+identifier); return ERR_PARSE_ERROR; } diff --git a/tools/docdump/class_list.xml b/tools/docdump/class_list.xml index ab33cef7d72..3d07f841771 100644 --- a/tools/docdump/class_list.xml +++ b/tools/docdump/class_list.xml @@ -3140,7 +3140,7 @@ - Editor will not allow to select unexisting files. + Editor will not allow to select nonexistent files. Editor will warn when a file exists. diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 374dda852ba..ab27ac7fa96 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -1653,7 +1653,7 @@ Error ProjectExport::export_project(const String& p_preset) { if (saver.is_null()) { memdelete(d); - ERR_EXPLAIN("Preset '"+preset+"' references unexisting saver: "+type); + ERR_EXPLAIN("Preset '"+preset+"' references nonexistent saver: "+type); ERR_FAIL_COND_V(saver.is_null(),ERR_INVALID_DATA); }