Пример #1
0
void DependencyEditor::_searched(const String &p_path) {

	Map<String, String> dep_rename;
	dep_rename[replacing] = p_path;

	ResourceLoader::rename_dependencies(editing, dep_rename);

	_update_list();
	_update_file();
}
Пример #2
0
void DependencyEditor::edit(const String &p_path) {

	editing = p_path;
	set_title(TTR("Dependencies For:") + " " + p_path.get_file());

	_update_list();
	popup_centered_ratio();

	if (EditorNode::get_singleton()->is_scene_open(p_path)) {
		EditorNode::get_singleton()->show_warning(vformat(TTR("Scene '%s' is currently being edited.\nChanges will not take effect unless reloaded."), p_path.get_file()));
	} else if (ResourceCache::has(p_path)) {
		EditorNode::get_singleton()->show_warning(vformat(TTR("Resource '%s' is in use.\nChanges will take effect when reloaded."), p_path.get_file()));
	}
}
Пример #3
0
void DependencyEditor::_fix_all(){

	if (!EditorFileSystem::get_singleton()->get_filesystem())
		return;

	Map<String,Map<String,String> > candidates;

	for (List<String>::Element *E=missing.front();E;E=E->next()) {

		String base = E->get().get_file();
		if (!candidates.has(base)) {
			candidates[base]=Map<String,String>();
		}

		candidates[base][E->get()]="";
	}

	_fix_and_find(EditorFileSystem::get_singleton()->get_filesystem(),candidates);

	Map<String,String> remaps;

	for (Map<String,Map<String,String> >::Element *E=candidates.front();E;E=E->next()) {

		for (Map<String,String>::Element *F=E->get().front();F;F=F->next()) {

			if (F->get()!=String()) {
				remaps[F->key()]=F->get();
			}
		}

	}

	if (remaps.size()) {

		ResourceLoader::rename_dependencies(editing,remaps);

		_update_list();
		_update_file();
	}
}