summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 3b71c85422..0b96900053 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -215,12 +215,12 @@ static const String META_TEXT_TO_COPY = "text_to_copy";
void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vector<String> &r_filenames) {
// Keep track of a list of "index sets," i.e. sets of indices
// within disambiguated_scene_names which contain the same name.
- Vector<Set<int>> index_sets;
- Map<String, int> scene_name_to_set_index;
+ Vector<RBSet<int>> index_sets;
+ HashMap<String, int> scene_name_to_set_index;
for (int i = 0; i < r_filenames.size(); i++) {
String scene_name = r_filenames[i];
if (!scene_name_to_set_index.has(scene_name)) {
- index_sets.append(Set<int>());
+ index_sets.append(RBSet<int>());
scene_name_to_set_index.insert(r_filenames[i], index_sets.size() - 1);
}
index_sets.write[scene_name_to_set_index[scene_name]].insert(i);
@@ -228,10 +228,10 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto
// For each index set with a size > 1, we need to disambiguate.
for (int i = 0; i < index_sets.size(); i++) {
- Set<int> iset = index_sets[i];
+ RBSet<int> iset = index_sets[i];
while (iset.size() > 1) {
// Append the parent folder to each scene name.
- for (Set<int>::Element *E = iset.front(); E; E = E->next()) {
+ for (RBSet<int>::Element *E = iset.front(); E; E = E->next()) {
int set_idx = E->get();
String scene_name = r_filenames[set_idx];
String full_path = p_full_paths[set_idx];
@@ -266,11 +266,11 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto
// Loop back through scene names and remove non-ambiguous names.
bool can_proceed = false;
- Set<int>::Element *E = iset.front();
+ RBSet<int>::Element *E = iset.front();
while (E) {
String scene_name = r_filenames[E->get()];
bool duplicate_found = false;
- for (Set<int>::Element *F = iset.front(); F; F = F->next()) {
+ for (RBSet<int>::Element *F = iset.front(); F; F = F->next()) {
if (E->get() == F->get()) {
continue;
}
@@ -281,7 +281,7 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto
}
}
- Set<int>::Element *to_erase = duplicate_found ? nullptr : E;
+ RBSet<int>::Element *to_erase = duplicate_found ? nullptr : E;
// We need to check that we could actually append anymore names
// if we wanted to for disambiguation. If we can't, then we have
@@ -800,7 +800,7 @@ void EditorNode::_notification(int p_what) {
main_editor_buttons.write[i]->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts")));
}
- Set<String> updated_textfile_extensions;
+ RBSet<String> updated_textfile_extensions;
bool extensions_match = true;
const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false);
for (const String &E : textfile_ext) {
@@ -907,11 +907,11 @@ void EditorNode::_resources_changed(const Vector<String> &p_resources) {
}
void EditorNode::_fs_changed() {
- for (Set<FileDialog *>::Element *E = file_dialogs.front(); E; E = E->next()) {
+ for (RBSet<FileDialog *>::Element *E = file_dialogs.front(); E; E = E->next()) {
E->get()->invalidate();
}
- for (Set<EditorFileDialog *>::Element *E = editor_file_dialogs.front(); E; E = E->next()) {
+ for (RBSet<EditorFileDialog *>::Element *E = editor_file_dialogs.front(); E; E = E->next()) {
E->get()->invalidate();
}
@@ -1185,7 +1185,7 @@ Error EditorNode::load_resource(const String &p_resource, bool p_ignore_broken_d
if (!p_ignore_broken_deps && dependency_errors.has(p_resource)) {
Vector<String> errors;
- for (Set<String>::Element *E = dependency_errors[p_resource].front(); E; E = E->next()) {
+ for (RBSet<String>::Element *E = dependency_errors[p_resource].front(); E; E = E->next()) {
errors.push_back(E->get());
}
dependency_error->show(DependencyErrorDialog::MODE_RESOURCE, p_resource, errors);
@@ -1417,7 +1417,7 @@ void EditorNode::_set_scene_metadata(const String &p_file, int p_idx) {
ERR_FAIL_COND_MSG(err != OK, "Cannot save config file to '" + path + "'.");
}
-bool EditorNode::_find_and_save_resource(Ref<Resource> p_res, Map<Ref<Resource>, bool> &processed, int32_t flags) {
+bool EditorNode::_find_and_save_resource(Ref<Resource> p_res, HashMap<Ref<Resource>, bool> &processed, int32_t flags) {
if (p_res.is_null()) {
return false;
}
@@ -1443,7 +1443,7 @@ bool EditorNode::_find_and_save_resource(Ref<Resource> p_res, Map<Ref<Resource>,
}
}
-bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<Ref<Resource>, bool> &processed, int32_t flags) {
+bool EditorNode::_find_and_save_edited_subresources(Object *obj, HashMap<Ref<Resource>, bool> &processed, int32_t flags) {
bool ret_changed = false;
List<PropertyInfo> pi;
obj->get_property_list(&pi);
@@ -1493,7 +1493,7 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<Ref<Resourc
return ret_changed;
}
-void EditorNode::_save_edited_subresources(Node *scene, Map<Ref<Resource>, bool> &processed, int32_t flags) {
+void EditorNode::_save_edited_subresources(Node *scene, HashMap<Ref<Resource>, bool> &processed, int32_t flags) {
_find_and_save_edited_subresources(scene, processed, flags);
for (int i = 0; i < scene->get_child_count(); i++) {
@@ -1622,7 +1622,7 @@ bool EditorNode::_validate_scene_recursive(const String &p_filename, Node *p_nod
return false;
}
-static bool _find_edited_resources(const Ref<Resource> &p_resource, Set<Ref<Resource>> &edited_resources) {
+static bool _find_edited_resources(const Ref<Resource> &p_resource, RBSet<Ref<Resource>> &edited_resources) {
if (p_resource->is_edited()) {
edited_resources.insert(p_resource);
return true;
@@ -1659,7 +1659,7 @@ int EditorNode::_save_external_resources() {
}
flg |= ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS;
- Set<Ref<Resource>> edited_subresources;
+ RBSet<Ref<Resource>> edited_subresources;
int saved = 0;
List<Ref<Resource>> cached;
ResourceCache::get_cached_resources(&cached);
@@ -1677,7 +1677,7 @@ int EditorNode::_save_external_resources() {
// Clear later, because user may have put the same subresource in two different resources,
// which will be shared until the next reload.
- for (Set<Ref<Resource>>::Element *E = edited_subresources.front(); E; E = E->next()) {
+ for (RBSet<Ref<Resource>>::Element *E = edited_subresources.front(); E; E = E->next()) {
Ref<Resource> res = E->get();
res->set_edited(false);
}
@@ -2125,7 +2125,7 @@ void EditorNode::_save_default_environment() {
Ref<Environment> fallback = get_tree()->get_root()->get_world_3d()->get_fallback_environment();
if (fallback.is_valid() && fallback->get_path().is_resource_file()) {
- Map<Ref<Resource>, bool> processed;
+ HashMap<Ref<Resource>, bool> processed;
_find_and_save_edited_subresources(fallback.ptr(), processed, 0);
save_resource_in_path(fallback, fallback->get_path());
}
@@ -2303,7 +2303,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
if (main_plugin) {
// Special case if use of external editor is true.
Resource *current_res = Object::cast_to<Resource>(current_obj);
- if (main_plugin->get_name() == "Script" && current_obj->is_class("VisualScript") && current_res && !current_res->is_built_in() && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) {
+ if (main_plugin->get_name() == "Script" && !current_obj->is_class("VisualScript") && current_res && !current_res->is_built_in() && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) {
if (!changing_scene) {
main_plugin->edit(current_obj);
}
@@ -3663,7 +3663,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
if (!p_ignore_broken_deps && dependency_errors.has(lpath)) {
current_menu_option = -1;
Vector<String> errors;
- for (Set<String>::Element *E = dependency_errors[lpath].front(); E; E = E->next()) {
+ for (RBSet<String>::Element *E = dependency_errors[lpath].front(); E; E = E->next()) {
errors.push_back(E->get());
}
dependency_error->show(DependencyErrorDialog::MODE_SCENE, lpath, errors);
@@ -3678,9 +3678,9 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
dependency_errors.erase(lpath); // At least not self path.
- for (KeyValue<String, Set<String>> &E : dependency_errors) {
+ for (KeyValue<String, RBSet<String>> &E : dependency_errors) {
String txt = vformat(TTR("Scene '%s' has broken dependencies:"), E.key) + "\n";
- for (Set<String>::Element *F = E.value.front(); F; F = F->next()) {
+ for (RBSet<String>::Element *F = E.value.front(); F; F = F->next()) {
txt += "\t" + F->get() + "\n";
}
add_io_error(txt);
@@ -4143,7 +4143,7 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p
}
}
- const Map<String, Vector<EditorData::CustomType>> &p_map = EditorNode::get_editor_data().get_custom_types();
+ const HashMap<String, Vector<EditorData::CustomType>> &p_map = EditorNode::get_editor_data().get_custom_types();
for (const KeyValue<String, Vector<EditorData::CustomType>> &E : p_map) {
const Vector<EditorData::CustomType> &ct = E.value;
for (int i = 0; i < ct.size(); ++i) {