|
@@ -3192,31 +3192,30 @@ bool Main::start() {
|
|
scn.instantiate();
|
|
scn.instantiate();
|
|
scn->set_path(info.path);
|
|
scn->set_path(info.path);
|
|
scn->reload_from_file();
|
|
scn->reload_from_file();
|
|
- ERR_CONTINUE_MSG(!scn.is_valid(), vformat("Can't autoload: %s.", info.path));
|
|
|
|
|
|
+ ERR_CONTINUE_MSG(!scn.is_valid(), vformat("Failed to instantiate an autoload, can't load from path: %s.", info.path));
|
|
|
|
|
|
if (scn.is_valid()) {
|
|
if (scn.is_valid()) {
|
|
n = scn->instantiate();
|
|
n = scn->instantiate();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
Ref<Resource> res = ResourceLoader::load(info.path);
|
|
Ref<Resource> res = ResourceLoader::load(info.path);
|
|
- ERR_CONTINUE_MSG(res.is_null(), vformat("Can't autoload: %s.", info.path));
|
|
|
|
|
|
+ ERR_CONTINUE_MSG(res.is_null(), vformat("Failed to instantiate an autoload, can't load from path: %s.", info.path));
|
|
|
|
|
|
Ref<Script> script_res = res;
|
|
Ref<Script> script_res = res;
|
|
if (script_res.is_valid()) {
|
|
if (script_res.is_valid()) {
|
|
StringName ibt = script_res->get_instance_base_type();
|
|
StringName ibt = script_res->get_instance_base_type();
|
|
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
|
|
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
|
|
- ERR_CONTINUE_MSG(!valid_type, vformat("Script does not inherit from Node: %s.", info.path));
|
|
|
|
|
|
+ ERR_CONTINUE_MSG(!valid_type, vformat("Failed to instantiate an autoload, script '%s' does not inherit from 'Node'.", info.path));
|
|
|
|
|
|
Object *obj = ClassDB::instantiate(ibt);
|
|
Object *obj = ClassDB::instantiate(ibt);
|
|
-
|
|
|
|
- ERR_CONTINUE_MSG(!obj, vformat("Cannot instance script for autoload, expected 'Node' inheritance, got: %s."));
|
|
|
|
|
|
+ ERR_CONTINUE_MSG(!obj, vformat("Failed to instantiate an autoload, cannot instantiate '%s'.", ibt));
|
|
|
|
|
|
n = Object::cast_to<Node>(obj);
|
|
n = Object::cast_to<Node>(obj);
|
|
n->set_script(script_res);
|
|
n->set_script(script_res);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- ERR_CONTINUE_MSG(!n, vformat("Path in autoload not a node or script: %s.", info.path));
|
|
|
|
|
|
+ ERR_CONTINUE_MSG(!n, vformat("Failed to instantiate an autoload, path is not pointing to a scene or a script: %s.", info.path));
|
|
n->set_name(info.name);
|
|
n->set_name(info.name);
|
|
|
|
|
|
//defer so references are all valid on _ready()
|
|
//defer so references are all valid on _ready()
|