You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Merge pull request #42659 from kingoftheconnors/anim-tree-load-fail-alert
Add alert in anim trees if resource load fails
This commit is contained in:
@@ -381,6 +381,8 @@ void AnimationNodeBlendSpace1DEditor::_file_opened(const String &p_file) {
|
|||||||
file_loaded = ResourceLoader::load(p_file);
|
file_loaded = ResourceLoader::load(p_file);
|
||||||
if (file_loaded.is_valid()) {
|
if (file_loaded.is_valid()) {
|
||||||
_add_menu_type(MENU_LOAD_FILE_CONFIRM);
|
_add_menu_type(MENU_LOAD_FILE_CONFIRM);
|
||||||
|
} else {
|
||||||
|
EditorNode::get_singleton()->show_warning(TTR("This type of node can't be used. Only animation nodes are allowed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -315,6 +315,8 @@ void AnimationNodeBlendSpace2DEditor::_file_opened(const String &p_file) {
|
|||||||
file_loaded = ResourceLoader::load(p_file);
|
file_loaded = ResourceLoader::load(p_file);
|
||||||
if (file_loaded.is_valid()) {
|
if (file_loaded.is_valid()) {
|
||||||
_add_menu_type(MENU_LOAD_FILE_CONFIRM);
|
_add_menu_type(MENU_LOAD_FILE_CONFIRM);
|
||||||
|
} else {
|
||||||
|
EditorNode::get_singleton()->show_warning(TTR("This type of node can't be used. Only animation nodes are allowed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -283,6 +283,8 @@ void AnimationNodeBlendTreeEditor::_file_opened(const String &p_file) {
|
|||||||
file_loaded = ResourceLoader::load(p_file);
|
file_loaded = ResourceLoader::load(p_file);
|
||||||
if (file_loaded.is_valid()) {
|
if (file_loaded.is_valid()) {
|
||||||
_add_node(MENU_LOAD_FILE_CONFIRM);
|
_add_node(MENU_LOAD_FILE_CONFIRM);
|
||||||
|
} else {
|
||||||
|
EditorNode::get_singleton()->show_warning(TTR("This type of node can't be used. Only animation nodes are allowed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -974,6 +974,8 @@ void AnimationNodeStateMachineEditor::_file_opened(const String &p_file) {
|
|||||||
file_loaded = ResourceLoader::load(p_file);
|
file_loaded = ResourceLoader::load(p_file);
|
||||||
if (file_loaded.is_valid()) {
|
if (file_loaded.is_valid()) {
|
||||||
_add_menu_type(MENU_LOAD_FILE_CONFIRM);
|
_add_menu_type(MENU_LOAD_FILE_CONFIRM);
|
||||||
|
} else {
|
||||||
|
EditorNode::get_singleton()->show_warning(TTR("This type of node can't be used. Only animation nodes are allowed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user