Merge pull request #77750 from RandomShaper/tidy_shader_data_items

Let editor workaround a case of inconsistency in compound scenes
This commit is contained in:
Rémi Verschelde 2023-06-13 13:52:51 +02:00
commit ad85ecef8d
No known key found for this signature in database
GPG key ID: C3336907360768E1
7 changed files with 70 additions and 1 deletions

View file

@ -4109,6 +4109,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;
@ -6814,6 +6821,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;