You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Improve various texts
This commit is contained in:
@@ -117,7 +117,7 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
|
||||
for (const String &E : keywords) {
|
||||
if (E == p_name) {
|
||||
if (r_error) {
|
||||
*r_error = TTR("Invalid name.") + " " + TTR("Keyword cannot be used as an autoload name.");
|
||||
*r_error = TTR("Invalid name.") + " " + TTR("Keyword cannot be used as an AutoLoad name.");
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -373,13 +373,13 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) {
|
||||
|
||||
Object *obj = ClassDB::instantiate(ibt);
|
||||
|
||||
ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + ".");
|
||||
ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for AutoLoad, expected 'Node' inheritance, got: " + String(ibt) + ".");
|
||||
|
||||
n = Object::cast_to<Node>(obj);
|
||||
n->set_script(s);
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_V_MSG(!n, nullptr, "Path in autoload not a node or script: " + p_path + ".");
|
||||
ERR_FAIL_COND_V_MSG(!n, nullptr, "Path in AutoLoad not a node or script: " + p_path + ".");
|
||||
|
||||
return n;
|
||||
}
|
||||
@@ -692,18 +692,18 @@ bool EditorAutoloadSettings::autoload_add(const String &p_name, const String &p_
|
||||
|
||||
String error;
|
||||
if (!_autoload_name_is_valid(name, &error)) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't add autoload:") + "\n" + error);
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't add AutoLoad:") + "\n" + error);
|
||||
return false;
|
||||
}
|
||||
|
||||
const String &path = p_path;
|
||||
if (!FileAccess::exists(path)) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't add autoload:") + "\n" + vformat(TTR("%s is an invalid path. File does not exist."), path));
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't add AutoLoad:") + "\n" + vformat(TTR("%s is an invalid path. File does not exist."), path));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!path.begins_with("res://")) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't add autoload:") + "\n" + vformat(TTR("%s is an invalid path. Not in resource path (res://)."), path));
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't add AutoLoad:") + "\n" + vformat(TTR("%s is an invalid path. Not in resource path (res://)."), path));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user