-Rename unexisting by nonexistant, closes #1940

-Added function to retrieve list of actions fron InputMap
This commit is contained in:
Juan Linietsky 2015-05-18 10:20:54 -03:00
parent 5272853cdc
commit e323cc0505
10 changed files with 30 additions and 12 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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;

View file

@ -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();

View file

@ -9655,7 +9655,7 @@
</signals>
<constants>
<constant name="MODE_OPEN_FILE" value="0">
Editor will not allow to select unexisting files.
Editor will not allow to select nonexistent files.
</constant>
<constant name="MODE_OPEN_FILES" value="1">
</constant>

View file

@ -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 {

View file

@ -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());

View file

@ -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;
}

View file

@ -3140,7 +3140,7 @@
<constant name="MODE_OPEN_DIR" value="1">
</constant>
<constant name="MODE_OPEN_FILE" value="0">
Editor will not allow to select unexisting files.
Editor will not allow to select nonexistent files.
</constant>
<constant name="MODE_SAVE_FILE" value="2">
Editor will warn when a file exists.

View file

@ -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);
}