summaryrefslogtreecommitdiff
path: root/editor/editor_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r--editor/editor_data.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index a58a279faa..2d4945db14 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -82,7 +82,7 @@ void EditorSelectionHistory::add_object(ObjectID p_object, const String &p_prope
RefCounted *r = Object::cast_to<RefCounted>(obj);
_Object o;
if (r) {
- o.ref = REF(r);
+ o.ref = Ref<RefCounted>(r);
}
o.object = p_object;
o.property = p_property;
@@ -468,12 +468,12 @@ Variant EditorData::instance_custom_type(const String &p_type, const String &p_i
}
void EditorData::remove_custom_type(const String &p_type) {
- for (Map<String, Vector<CustomType>>::Element *E = custom_types.front(); E; E = E->next()) {
- for (int i = 0; i < E->get().size(); i++) {
- if (E->get()[i].name == p_type) {
- E->get().remove_at(i);
- if (E->get().is_empty()) {
- custom_types.erase(E->key());
+ for (KeyValue<String, Vector<CustomType>> &E : custom_types) {
+ for (int i = 0; i < E.value.size(); i++) {
+ if (E.value[i].name == p_type) {
+ E.value.remove_at(i);
+ if (E.value.is_empty()) {
+ custom_types.erase(E.key);
}
return;
}
@@ -534,6 +534,7 @@ void EditorData::remove_scene(int p_idx) {
}
memdelete(edited_scene[p_idx].root);
+ edited_scene.write[p_idx].root = nullptr;
}
if (current_edited_scene > p_idx) {
@@ -549,7 +550,7 @@ void EditorData::remove_scene(int p_idx) {
edited_scene.remove_at(p_idx);
}
-bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths) {
+bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, HashSet<String> &checked_paths) {
Ref<SceneState> ss;
if (p_node == p_root) {
@@ -587,7 +588,7 @@ bool EditorData::check_and_update_scene(int p_idx) {
return false;
}
- Set<String> checked_scenes;
+ HashSet<String> checked_scenes;
bool must_reload = _find_updated_instances(edited_scene[p_idx].root, edited_scene[p_idx].root, checked_scenes);
@@ -945,13 +946,10 @@ void EditorData::script_class_set_name(const String &p_path, const StringName &p
}
void EditorData::script_class_save_icon_paths() {
- List<StringName> keys;
- _script_class_icon_paths.get_key_list(&keys);
-
Dictionary d;
- for (const StringName &E : keys) {
- if (ScriptServer::is_global_class(E)) {
- d[E] = _script_class_icon_paths[E];
+ for (const KeyValue<StringName, String> &E : _script_class_icon_paths) {
+ if (ScriptServer::is_global_class(E.key)) {
+ d[E.key] = E.value;
}
}
@@ -1030,7 +1028,7 @@ void EditorSelection::add_node(Node *p_node) {
}
selection[p_node] = meta;
- p_node->connect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed), varray(p_node), CONNECT_ONESHOT);
+ p_node->connect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed).bind(p_node), CONNECT_ONESHOT);
}
void EditorSelection::remove_node(Node *p_node) {
@@ -1157,7 +1155,7 @@ List<Node *> EditorSelection::get_full_selected_node_list() {
void EditorSelection::clear() {
while (!selection.is_empty()) {
- remove_node(selection.front()->key());
+ remove_node(selection.begin()->key);
}
changed = true;