ERR_FAIL_MSG("Could not call function '"+func_name+"' to start thread "+t->get_id()+": "+Variant::get_callable_error_text(t->target_callable,nullptr,0,ce)+".");
ERR_FAIL_MSG(vformat("Could not call function '%s' to start thread %d: %s.",func_name,t->get_id(),Variant::get_callable_error_text(t->target_callable,nullptr,0,ce)));
ERR_FAIL_COND_MSG(!has_singleton(p_name),"Attempt to remove unregistered singleton: "+String(p_name));
ERR_FAIL_COND_MSG(!::Engine::get_singleton()->is_singleton_user_created(p_name),"Attempt to remove non-user created singleton: "+String(p_name));
ERR_FAIL_COND_MSG(!has_singleton(p_name),vformat("Attempt to remove unregistered singleton: '%s'.",String(p_name)));
ERR_FAIL_COND_MSG(!::Engine::get_singleton()->is_singleton_user_created(p_name),vformat("Attempt to remove non-user created singleton: '%s'.",String(p_name)));
ERR_FAIL_COND_V_MSG(err.error!=Callable::CallError::CALL_OK,FAILED,"Error calling 'capture' to callable: "+Variant::get_callable_error_text(capture,args,2,err));
ERR_FAIL_COND_V_MSG(retval.get_type()!=Variant::BOOL,FAILED,"Error calling 'capture' to callable: "+String(capture)+". Return type is not bool.");
ERR_FAIL_COND_V_MSG(err.error!=Callable::CallError::CALL_OK,FAILED,vformat("Error calling 'capture' to callable: %s.",Variant::get_callable_error_text(capture,args,2,err)));
ERR_FAIL_COND_V_MSG(retval.get_type()!=Variant::BOOL,FAILED,vformat("Error calling 'capture' to callable: '%s'. Return type is not bool.",String(capture)));
ERR_FAIL_COND_MSG(!String(class_name).is_valid_unicode_identifier(),"Attempt to register extension class '"+class_name+"', which is not a valid class identifier.");
ERR_FAIL_COND_MSG(ClassDB::class_exists(class_name),"Attempt to register extension class '"+class_name+"', which appears to be already registered.");
ERR_FAIL_COND_MSG(!String(class_name).is_valid_unicode_identifier(),vformat("Attempt to register extension class '%s', which is not a valid class identifier.",class_name));
ERR_FAIL_COND_MSG(ClassDB::class_exists(class_name),vformat("Attempt to register extension class '%s', which appears to be already registered.",class_name));
ERR_FAIL_MSG("Attempt to register an extension class '"+String(class_name)+"' using non-existing parent class '"+String(parent_class_name)+"'.");
ERR_FAIL_MSG(vformat("Attempt to register an extension class '%s' using non-existing parent class '%s'.",String(class_name),String(parent_class_name)));
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),"Attempt to register extension method '"+String(method_name)+"' for unexisting class '"+class_name+"'.");
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),vformat("Attempt to register extension method '%s' for unexisting class '%s'.",String(method_name),class_name));
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),"Attempt to register extension constant '"+constant_name+"' for unexisting class '"+class_name+"'.");
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),vformat("Attempt to register extension constant '%s' for unexisting class '%s'.",constant_name,class_name));
#ifdef TOOLS_ENABLED
// If the extension is still marked as reloading, that means it failed to register again.
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),"Attempt to register extension class property '"+property_name+"' for unexisting class '"+class_name+"'.");
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),vformat("Attempt to register extension class property '%s' for unexisting class '%s'.",property_name,class_name));
#ifdef TOOLS_ENABLED
// If the extension is still marked as reloading, that means it failed to register again.
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),"Attempt to register extension class property group '"+group_name+"' for unexisting class '"+class_name+"'.");
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),vformat("Attempt to register extension class property group '%s' for unexisting class '%s'.",group_name,class_name));
#ifdef TOOLS_ENABLED
// If the extension is still marked as reloading, that means it failed to register again.
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),"Attempt to register extension class property subgroup '"+subgroup_name+"' for unexisting class '"+class_name+"'.");
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),vformat("Attempt to register extension class property subgroup '%s' for unexisting class '%s'.",subgroup_name,class_name));
#ifdef TOOLS_ENABLED
// If the extension is still marked as reloading, that means it failed to register again.
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),"Attempt to register extension class signal '"+signal_name+"' for unexisting class '"+class_name+"'.");
ERR_FAIL_COND_MSG(!self->extension_classes.has(class_name),vformat("Attempt to register extension class signal '%s' for unexisting class '%s'.",signal_name,class_name));
#ifdef TOOLS_ENABLED
// If the extension is still marked as reloading, that means it failed to register again.
ERR_FAIL_COND_MSG(ext->gdextension.children.size(),"Attempt to unregister class '"+class_name+"' while other extension classes inherit from it.");
ERR_FAIL_COND_MSG(ext->gdextension.children.size(),vformat("Attempt to unregister class '%s' while other extension classes inherit from it.",class_name));
ERR_FAIL_COND_MSG(gdextension_interface_functions.has(p_function_name),"Attempt to register interface function '"+p_function_name+"', which appears to be already registered.");
ERR_FAIL_COND_MSG(gdextension_interface_functions.has(p_function_name),vformat("Attempt to register interface function '%s', which appears to be already registered.",p_function_name));
ERR_FAIL_COND_V_MSG(file.is_valid(),ERR_ALREADY_IN_USE,"Can't open file while another file from path '"+file->get_path_absolute()+"' is open.");
ERR_FAIL_COND_V_MSG(file.is_valid(),ERR_ALREADY_IN_USE,vformat("Can't open file while another file from path '%s' is open.",file->get_path_absolute()));
f->get_32();// patch number, not used for validation.
ERR_FAIL_COND_V_MSG(version!=PACK_FORMAT_VERSION,false,"Pack version unsupported: "+itos(version)+".");
ERR_FAIL_COND_V_MSG(ver_major>VERSION_MAJOR||(ver_major==VERSION_MAJOR&&ver_minor>VERSION_MINOR),false,"Pack created with a newer version of the engine: "+itos(ver_major)+"."+itos(ver_minor)+".");
ERR_FAIL_COND_V_MSG(version!=PACK_FORMAT_VERSION,false,vformat("Pack version unsupported: %d.",version));
ERR_FAIL_COND_V_MSG(ver_major>VERSION_MAJOR||(ver_major==VERSION_MAJOR&&ver_minor>VERSION_MINOR),false,vformat("Pack created with a newer version of the engine: %d.%d.",ver_major,ver_minor));
WARN_PRINT("Loaded resource as image file, this will not work on export: '"+p_path+"'. Instead, import the image file as an Image resource and load it normally as a resource.");
WARN_PRINT(vformat("Loaded resource as image file, this will not work on export: '%s'. Instead, import the image file as an Image resource and load it normally as a resource.",p_path));
WARN_PRINT("Loaded resource as image file, this will not work on export: '"+p_path+"'. Instead, import the image file as an Image resource and load it normally as a resource.");
WARN_PRINT(vformat("Loaded resource as image file, this will not work on export: '%s'. Instead, import the image file as an Image resource and load it normally as a resource.",p_path));
ERR_FAIL_COND_V_MSG(p_lossy&&!(0.0f<=p_quality&&p_quality<=1.0f),ERR_INVALID_PARAMETER,"The WebP lossy quality was set to "+rtos(p_quality)+", which is not valid. WebP lossy quality must be between 0.0 and 1.0 (inclusive).");
ERR_FAIL_COND_V_MSG(p_lossy&&!(0.0f<=p_quality&&p_quality<=1.0f),ERR_INVALID_PARAMETER,vformat("The WebP lossy quality was set to %f, which is not valid. WebP lossy quality must be between 0.0 and 1.0 (inclusive).",p_quality));
ERR_FAIL_COND_V_MSG(p_lossy&&!(0.0f<=p_quality&&p_quality<=1.0f),Vector<uint8_t>(),"The WebP lossy quality was set to "+rtos(p_quality)+", which is not valid. WebP lossy quality must be between 0.0 and 1.0 (inclusive).");
ERR_FAIL_COND_V_MSG(p_lossy&&!(0.0f<=p_quality&&p_quality<=1.0f),Vector<uint8_t>(),vformat("The WebP lossy quality was set to %f, which is not valid. WebP lossy quality must be between 0.0 and 1.0 (inclusive).",p_quality));
WARN_PRINT(String(res_path+": In external resource #"+itos(i)+", invalid UID: "+ResourceUID::get_singleton()->id_to_text(er.uid)+" - using text path instead: "+er.path).utf8().get_data());
WARN_PRINT(vformat("'%s': In external resource #%d, invalid UID: '%s' - using text path instead: '%s'.",res_path,i,ResourceUID::get_singleton()->id_to_text(er.uid),er.path));
}
#else
WARN_PRINT(String(res_path+": In external resource #"+itos(i)+", invalid UID: "+ResourceUID::get_singleton()->id_to_text(er.uid)+" - using text path instead: "+er.path).utf8().get_data());
WARN_PRINT(vformat("'%s': In external resource #%d, invalid UID: '%s' - using text path instead: '%s'.",res_path,i,ResourceUID::get_singleton()->id_to_text(er.uid),er.path));
ERR_FAIL_V_MSG(Ref<Resource>(),"Failed to load resource '"+p_path+"'. ResourceFormatLoader::load was not implemented for this resource type.");
ERR_FAIL_V_MSG(Ref<Resource>(),vformat("Failed to load resource '%s'. ResourceFormatLoader::load was not implemented for this resource type.",p_path));
ERR_FAIL_COND_V_MSG(locale.length()<2,p_path,"Could not remap path '"+p_path+"' for translation as configured locale '"+locale+"' is invalid.");
ERR_FAIL_COND_V_MSG(locale.length()<2,p_path,vformat("Could not remap path '%s' for translation as configured locale '%s' is invalid.",p_path,locale));
ERR_FAIL_V_MSG(Ref<Resource>(),"Unexpected EOF while reading PO file at: "+path+":"+itos(line));
ERR_FAIL_V_MSG(Ref<Resource>(),vformat("Unexpected EOF while reading PO file at: %s:%d.",path,line));
}else{
break;
}
}
if(l.begins_with("msgctxt")){
ERR_FAIL_COND_V_MSG(status!=STATUS_READING_STRING&&status!=STATUS_READING_PLURAL,Ref<Resource>(),"Unexpected 'msgctxt', was expecting 'msgid_plural' or 'msgstr' before 'msgctxt' while parsing: "+path+":"+itos(line));
ERR_FAIL_COND_V_MSG(status!=STATUS_READING_STRING&&status!=STATUS_READING_PLURAL,Ref<Resource>(),vformat("Unexpected 'msgctxt', was expecting 'msgid_plural' or 'msgstr' before 'msgctxt' while parsing: %s:%d.",path,line));
// In PO file, "msgctxt" appears before "msgid". If we encounter a "msgctxt", we add what we have read
// and set "entered_context" to true to prevent adding twice.
ERR_FAIL_COND_V_MSG(plural_index!=plural_forms-1,Ref<Resource>(),"Number of 'msgstr[]' doesn't match with number of plural forms: "+path+":"+itos(line));
ERR_FAIL_COND_V_MSG(plural_index!=plural_forms-1,Ref<Resource>(),vformat("Number of 'msgstr[]' doesn't match with number of plural forms: %s:%d.",path,line));
ERR_FAIL_COND_V_MSG(plural_index!=plural_forms-1,Ref<Resource>(),"Number of 'msgstr[]' doesn't match with number of plural forms: "+path+":"+itos(line));
ERR_FAIL_COND_V_MSG(plural_index!=plural_forms-1,Ref<Resource>(),vformat("Number of 'msgstr[]' doesn't match with number of plural forms: %s:%d.",path,line));
ERR_FAIL_COND_V_MSG(status!=STATUS_READING_PLURAL,Ref<Resource>(),"Unexpected 'msgstr[]', was expecting 'msgid_plural' before 'msgstr[]' while parsing: "+path+":"+itos(line));
ERR_FAIL_COND_V_MSG(status!=STATUS_READING_PLURAL,Ref<Resource>(),vformat("Unexpected 'msgstr[]', was expecting 'msgid_plural' before 'msgstr[]' while parsing: %s:%d.",path,line));
plural_index++;// Increment to add to the next slot in vector msgs_plural.
l=l.substr(9,l.length()).strip_edges();
}elseif(l.begins_with("msgstr")){
ERR_FAIL_COND_V_MSG(status!=STATUS_READING_ID,Ref<Resource>(),"Unexpected 'msgstr', was expecting 'msgid' before 'msgstr' while parsing: "+path+":"+itos(line));
ERR_FAIL_COND_V_MSG(status!=STATUS_READING_ID,Ref<Resource>(),vformat("Unexpected 'msgstr', was expecting 'msgid' before 'msgstr' while parsing: %s:%d.",path,line));
ERR_FAIL_COND_V_MSG(plural_index!=plural_forms-1,Ref<Resource>(),"Number of 'msgstr[]' doesn't match with number of plural forms: "+path+":"+itos(line));
ERR_FAIL_COND_V_MSG(plural_index!=plural_forms-1,Ref<Resource>(),vformat("Number of 'msgstr[]' doesn't match with number of plural forms: %s:%d.",path,line));
ERR_FAIL_NULL_MSG(mb_set,"Invalid setter '"+p_class+"::"+p_setter+"' for property '"+p_pinfo.name+"'.");
ERR_FAIL_NULL_MSG(mb_set,vformat("Invalid setter '%s::%s' for property '%s'.",p_class,p_setter,p_pinfo.name));
intexp_args=1+(p_index>=0?1:0);
ERR_FAIL_COND_MSG(mb_set->get_argument_count()!=exp_args,"Invalid function for setter '"+p_class+"::"+p_setter+" for property '"+p_pinfo.name+"'.");
ERR_FAIL_COND_MSG(mb_set->get_argument_count()!=exp_args,vformat("Invalid function for setter '%s::%s' for property '%s'.",p_class,p_setter,p_pinfo.name));
ERR_FAIL_NULL_MSG(mb_get,"Invalid getter '"+p_class+"::"+p_getter+"' for property '"+p_pinfo.name+"'.");
ERR_FAIL_NULL_MSG(mb_get,vformat("Invalid getter '%s::%s' for property '%s'.",p_class,p_getter,p_pinfo.name));
intexp_args=0+(p_index>=0?1:0);
ERR_FAIL_COND_MSG(mb_get->get_argument_count()!=exp_args,"Invalid function for getter '"+p_class+"::"+p_getter+"' for property: '"+p_pinfo.name+"'.");
ERR_FAIL_COND_MSG(mb_get->get_argument_count()!=exp_args,vformat("Invalid function for getter '%s::%s' for property '%s'.",p_class,p_getter,p_pinfo.name));
#endif
}
#ifdef DEBUG_METHODS_ENABLED
ERR_FAIL_COND_MSG(type->property_setget.has(p_pinfo.name),"Object '"+p_class+"' already has property '"+p_pinfo.name+"'.");
ERR_FAIL_COND_MSG(type->property_setget.has(p_pinfo.name),vformat("Object '%s' already has property '%s'.",p_class,p_pinfo.name));
ERR_FAIL_COND_V_MSG(!p_compatibility&&has_method(instance_type,mdname),nullptr,"Class "+String(instance_type)+" already has a method "+String(mdname)+".");
ERR_FAIL_COND_V_MSG(!p_compatibility&&has_method(instance_type,mdname),nullptr,vformat("Class '%s' already has a method '%s'.",String(instance_type),String(mdname)));
#endif
ClassInfo*type=classes.getptr(instance_type);
if(!type){
memdelete(p_bind);
ERR_FAIL_V_MSG(nullptr,"Couldn't bind method '"+mdname+"' for instance '"+instance_type+"'.");
ERR_FAIL_V_MSG(nullptr,vformat("Couldn't bind method '%s' for instance '%s'.",mdname,instance_type));
ERR_FAIL_COND_MSG(!classes.has(p_extension->parent_class_name),"Parent class name for extension class not found: "+String(p_extension->parent_class_name));
ERR_FAIL_COND_MSG(!classes.has(p_extension->parent_class_name),vformat("Parent class name for extension class not found: '%s'.",String(p_extension->parent_class_name)));
// @todo This is a limitation of the current implementation, but it should be possible to remove.
ERR_FAIL_COND_MSG(p_extension->is_runtime&&parent->gdextension&&!parent->is_runtime,"Extension runtime class "+String(p_extension->class_name)+" cannot descend from "+parent->name+" which isn't also a runtime class");
ERR_FAIL_COND_MSG(p_extension->is_runtime&&parent->gdextension&&!parent->is_runtime,vformat("Extension runtime class '%s' cannot descend from '%s' which isn't also a runtime class.",String(p_extension->class_name),parent->name));
ERR_FAIL_NULL_MSG(concrete_ancestor->creation_func,"Extension class "+String(p_extension->class_name)+" cannot extend native abstract class "+String(concrete_ancestor->name));
ERR_FAIL_NULL_MSG(concrete_ancestor->creation_func,vformat("Extension class '%s' cannot extend native abstract class '%s'.",String(p_extension->class_name),String(concrete_ancestor->name)));
ERR_FAIL_COND_MSG(p_signal.name.is_empty(),"Signal name cannot be empty.");
ERR_FAIL_COND_MSG(ClassDB::has_signal(get_class_name(),p_signal.name),"User signal's name conflicts with a built-in signal of '"+get_class_name()+"'.");
ERR_FAIL_COND_MSG(signal_map.has(p_signal.name),"Trying to add already existing signal '"+p_signal.name+"'.");
ERR_FAIL_COND_MSG(ClassDB::has_signal(get_class_name(),p_signal.name),vformat("User signal's name conflicts with a built-in signal of '%s'.",get_class_name()));
ERR_FAIL_COND_MSG(signal_map.has(p_signal.name),vformat("Trying to add already existing signal '%s'.",p_signal.name));
ERR_FAIL_COND_V_MSG(!signal_is_valid&&!script.is_null()&&!Ref<Script>(script)->has_script_signal(p_name),ERR_UNAVAILABLE,"Can't emit non-existing signal "+String("\"")+p_name+"\".");
ERR_FAIL_COND_V_MSG(!signal_is_valid&&!script.is_null()&&!Ref<Script>(script)->has_script_signal(p_name),ERR_UNAVAILABLE,vformat("Can't emit non-existing signal \"%s\".",p_name));
ERR_FAIL_COND_V_MSG(p_callable.is_null(),ERR_INVALID_PARAMETER,"Cannot connect to '"+p_signal+"': the provided callable is null.");
ERR_FAIL_COND_V_MSG(p_callable.is_null(),ERR_INVALID_PARAMETER,vformat("Cannot connect to '%s': the provided callable is null.",p_signal));
if(p_callable.is_standard()){
// FIXME: This branch should probably removed in favor of the `is_valid()` branch, but there exist some classes
// that call `connect()` before they are fully registered with ClassDB. Until all such classes can be found
// and registered soon enough this branch is needed to allow `connect()` to succeed.
ERR_FAIL_NULL_V_MSG(p_callable.get_object(),ERR_INVALID_PARAMETER,"Cannot connect to '"+p_signal+"' to callable '"+p_callable+"': the callable object is null.");
ERR_FAIL_NULL_V_MSG(p_callable.get_object(),ERR_INVALID_PARAMETER,vformat("Cannot connect to '%s' to callable '%s': the callable object is null.",p_signal,p_callable));
}else{
ERR_FAIL_COND_V_MSG(!p_callable.is_valid(),ERR_INVALID_PARAMETER,"Cannot connect to '"+p_signal+"': the provided callable is not valid: "+p_callable);
ERR_FAIL_COND_V_MSG(!p_callable.is_valid(),ERR_INVALID_PARAMETER,vformat("Cannot connect to '%s': the provided callable is not valid: '%s'.",p_signal,p_callable));
ERR_FAIL_COND_V_MSG(!signal_is_valid,ERR_INVALID_PARAMETER,"In Object of type '"+String(get_class())+"': Attempt to connect nonexistent signal '"+p_signal+"' to callable '"+p_callable+"'.");
ERR_FAIL_COND_V_MSG(!signal_is_valid,ERR_INVALID_PARAMETER,vformat("In Object of type '%s': Attempt to connect nonexistent signal '%s' to callable '%s'.",String(get_class()),p_signal,p_callable));
ERR_FAIL_COND_V_MSG(p_callable.is_null(),false,"Cannot determine if connected to '"+p_signal+"': the provided callable is null.");// Should use `is_null`, see note in `connect` about the use of `is_valid`.
ERR_FAIL_COND_V_MSG(p_callable.is_null(),false,vformat("Cannot determine if connected to '%s': the provided callable is null.",p_signal));// Should use `is_null`, see note in `connect` about the use of `is_valid`.
ERR_FAIL_COND_V_MSG(p_callable.is_null(),false,"Cannot disconnect from '"+p_signal+"': the provided callable is null.");// Should use `is_null`, see note in `connect` about the use of `is_valid`.
ERR_FAIL_COND_V_MSG(p_callable.is_null(),false,vformat("Cannot disconnect from '%s': the provided callable is null.",p_signal));// Should use `is_null`, see note in `connect` about the use of `is_valid`.
ERR_FAIL_COND_V_MSG(signal_is_valid,false,"Attempt to disconnect a nonexistent connection from '"+to_string()+"'. Signal: '"+p_signal+"', callable: '"+p_callable+"'.");
ERR_FAIL_COND_V_MSG(signal_is_valid,false,vformat("Attempt to disconnect a nonexistent connection from '%s'. Signal: '%s', callable: '%s'.",to_string(),p_signal,p_callable));
}
ERR_FAIL_NULL_V_MSG(s,false,vformat("Disconnecting nonexistent signal '%s' in %s.",p_signal,to_string()));
ERR_FAIL_NULL_V_MSG(s,false,vformat("Disconnecting nonexistent signal '%s' in '%s'.",p_signal,to_string()));
ERR_FAIL_COND_V_MSG(!s->slot_map.has(*p_callable.get_base_comparator()),false,"Attempt to disconnect a nonexistent connection from '"+to_string()+"'. Signal: '"+p_signal+"', callable: '"+p_callable+"'.");
ERR_FAIL_COND_V_MSG(!s->slot_map.has(*p_callable.get_base_comparator()),false,vformat("Attempt to disconnect a nonexistent connection from '%s'. Signal: '%s', callable: '%s'.",to_string(),p_signal,p_callable));
//@todo this may need to actually reach the debugger prioritarily somehow because it may crash before
ERR_PRINT("Object "+to_string()+" was freed or unreferenced while a signal is being emitted from it. Try connecting to the signal using 'CONNECT_DEFERRED' flag, or use queue_free() to free the object (if this object is a Node) to avoid this error and potential crashes.");
ERR_PRINT(vformat("Object '%s' was freed or unreferenced while a signal is being emitted from it. Try connecting to the signal using 'CONNECT_DEFERRED' flag, or use queue_free() to free the object (if this object is a Node) to avoid this error and potential crashes.",to_string()));
}
// Drop all connections to the signals of this object.
ERR_FAIL_COND_V_MSG(_language_count>=MAX_LANGUAGES,ERR_UNAVAILABLE,"Script languages limit has been reach, cannot register more.");
for(inti=0;i<_language_count;i++){
constScriptLanguage*other_language=_languages[i];
ERR_FAIL_COND_V_MSG(other_language->get_extension()==p_language->get_extension(),ERR_ALREADY_EXISTS,"A script language with extension '"+p_language->get_extension()+"' is already registered.");
ERR_FAIL_COND_V_MSG(other_language->get_name()==p_language->get_name(),ERR_ALREADY_EXISTS,"A script language with name '"+p_language->get_name()+"' is already registered.");
ERR_FAIL_COND_V_MSG(other_language->get_type()==p_language->get_type(),ERR_ALREADY_EXISTS,"A script language with type '"+p_language->get_type()+"' is already registered.");
ERR_FAIL_COND_V_MSG(other_language->get_extension()==p_language->get_extension(),ERR_ALREADY_EXISTS,vformat("A script language with extension '%s' is already registered.",p_language->get_extension()));
ERR_FAIL_COND_V_MSG(other_language->get_name()==p_language->get_name(),ERR_ALREADY_EXISTS,vformat("A script language with name '%s' is already registered.",p_language->get_name()));
ERR_FAIL_COND_V_MSG(other_language->get_type()==p_language->get_type(),ERR_ALREADY_EXISTS,vformat("A script language with type '%s' is already registered.",p_language->get_type()));
WARN_PRINT("Double translations for \"" +String(p_src_text)+"\" under the same context \""+String(p_context)+"\" for locale \""+get_locale()+"\".\nThere should only be one unique translation for a given string under the same context.");
WARN_PRINT(vformat("Double translations for \"%s\" under the same context \"%s\" for locale \"%s\".\nThere should only be one unique translation for a given string under the same context.",String(p_src_text),String(p_context),get_locale()));
ERR_FAIL_COND_MSG(p_plural_xlated_texts.size()!=plural_forms,"Trying to add plural texts that don't match the required number of plural forms for locale \"" +get_locale()+"\"");
ERR_FAIL_COND_MSG(p_plural_xlated_texts.size()!=plural_forms,vformat("Trying to add plural texts that don't match the required number of plural forms for locale \"%s\".",get_locale()));
WARN_PRINT("Double translations for \"" +p_src_text+"\" under the same context \""+p_context+"\" for locale "+get_locale()+".\nThere should only be one unique translation for a given string under the same context.");
WARN_PRINT(vformat("Double translations for \"%s\" under the same context \"%s\" for locale %s.\nThere should only be one unique translation for a given string under the same context.",p_src_text,p_context,get_locale()));
ERR_FAIL_COND_V_MSG(translation_map[p_context][p_src_text].is_empty(),StringName(),"Source text \"" +String(p_src_text)+"\" is registered but doesn't have a translation. Please report this bug.");
ERR_FAIL_COND_V_MSG(translation_map[p_context][p_src_text].is_empty(),StringName(),vformat("Source text \"%s\" is registered but doesn't have a translation. Please report this bug.",String(p_src_text)));
ERR_FAIL_COND_V_MSG(translation_map[p_context][p_src_text].is_empty(),StringName(),"Source text \"" +String(p_src_text)+"\" is registered but doesn't have a translation. Please report this bug.");
ERR_FAIL_COND_V_MSG(translation_map[p_context][p_src_text].is_empty(),StringName(),vformat("Source text \"%s\" is registered but doesn't have a translation. Please report this bug.",String(p_src_text)));
intplural_index=_get_plural_index(p_n);
ERR_FAIL_COND_V_MSG(plural_index<0||translation_map[p_context][p_src_text].size()<plural_index+1,StringName(),"Plural index returned or number of plural translations is not valid. Please report this bug.");
ERR_FAIL_V_MSG(false,"Attempted to "+String(p_operation)+" a variable of type '"+Variant::get_type_name(inout_variant.get_type())+"' into a "+where+" of type '"+Variant::get_type_name(type)+"'.");
ERR_FAIL_V_MSG(false,vformat("Attempted to %s a variable of type '%s' into a %s of type '%s'.",String(p_operation),Variant::get_type_name(inout_variant.get_type()),where,Variant::get_type_name(type)));
}
if(type!=Variant::OBJECT){
@ -113,7 +113,7 @@ struct ContainerTypeValidate {
returntrue;// This is fine, it's null.
}
Object*object=ObjectDB::get_instance(object_id);
ERR_FAIL_NULL_V_MSG(object,false,"Attempted to "+String(p_operation)+" an invalid (previously freed?) object instance into a '"+String(where)+".");
ERR_FAIL_NULL_V_MSG(object,false,vformat("Attempted to %s an invalid (previously freed?) object instance into a '%s'.",String(p_operation),String(where)));
#else
Object*object=p_variant;
if(object==nullptr){
@ -126,7 +126,7 @@ struct ContainerTypeValidate {
StringNameobj_class=object->get_class_name();
if(obj_class!=class_name){
ERR_FAIL_COND_V_MSG(!ClassDB::is_parent_class(object->get_class_name(),class_name),false,"Attempted to "+String(p_operation)+" an object of type '"+object->get_class()+"' into a "+where+", which does not inherit from '"+String(class_name)+"'.");
ERR_FAIL_COND_V_MSG(!ClassDB::is_parent_class(object->get_class_name(),class_name),false,vformat("Attempted to %s an object of type '%s' into a %s, which does not inherit from '%s'.",String(p_operation),object->get_class(),where,String(class_name)));
}
if(script.is_null()){
@ -136,8 +136,8 @@ struct ContainerTypeValidate {
Ref<Script>other_script=object->get_script();
// Check base script..
ERR_FAIL_COND_V_MSG(other_script.is_null(),false,"Attempted to "+String(p_operation)+" an object into a "+String(where)+", that does not inherit from '"+String(script->get_class_name())+"'.");
ERR_FAIL_COND_V_MSG(!other_script->inherits_script(script),false,"Attempted to "+String(p_operation)+" an object into a "+String(where)+", that does not inherit from '"+String(script->get_class_name())+"'.");
ERR_FAIL_COND_V_MSG(other_script.is_null(),false,vformat("Attempted to %s an object into a %s, that does not inherit from '%s'.",String(p_operation),String(where),String(script->get_class_name())));
ERR_FAIL_COND_V_MSG(!other_script->inherits_script(script),false,vformat("Attempted to %s an object into a %s, that does not inherit from '%s'.",String(p_operation),String(where),String(script->get_class_name())));