1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Let editor workaround a case of inconsistency in compound scenes

This commit is contained in:
Pedro J. Estébanez
2023-06-07 13:44:37 +02:00
parent 828ec2c5d0
commit 96c469a138
7 changed files with 70 additions and 1 deletions

View File

@@ -4103,6 +4103,13 @@ void EditorNode::add_io_error(const String &p_error) {
EditorInterface::get_singleton()->popup_dialog_centered_ratio(singleton->load_error_dialog, 0.5);
}
void EditorNode::add_io_warning(const String &p_warning) {
DEV_ASSERT(Thread::get_caller_id() == Thread::get_main_id());
singleton->load_errors->add_image(singleton->gui_base->get_theme_icon(SNAME("Warning"), SNAME("EditorIcons")));
singleton->load_errors->add_text(p_warning + "\n");
EditorInterface::get_singleton()->popup_dialog_centered_ratio(singleton->load_error_dialog, 0.5);
}
bool EditorNode::_find_scene_in_use(Node *p_node, const String &p_path) const {
if (p_node->get_scene_file_path() == p_path) {
return true;
@@ -6806,6 +6813,11 @@ EditorNode::EditorNode() {
ResourceLoader::set_error_notify_func(&EditorNode::add_io_error);
ResourceLoader::set_dependency_error_notify_func(&EditorNode::_dependency_error_report);
SceneState::set_instantiation_warning_notify_func([](const String &p_warning) {
add_io_warning(p_warning);
callable_mp(EditorInterface::get_singleton(), &EditorInterface::mark_scene_as_unsaved).call_deferred();
});
{
// Register importers at the beginning, so dialogs are created with the right extensions.
Ref<ResourceImporterTexture> import_texture;