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.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 5e50835ef2..aee9c21007 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -554,7 +554,7 @@ void EditorData::remove_scene(int p_idx) {
ERR_FAIL_INDEX(p_idx, edited_scene.size());
if (edited_scene[p_idx].root) {
for (int i = 0; i < editor_plugins.size(); i++) {
- editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_filename());
+ editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_scene_file_path());
}
memdelete(edited_scene[p_idx].root);
@@ -583,7 +583,7 @@ bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set<String>
if (p_node == p_root) {
ss = p_node->get_scene_inherited_state();
- } else if (p_node->get_filename() != String()) {
+ } else if (p_node->get_scene_file_path() != String()) {
ss = p_node->get_scene_instance_state();
}
@@ -643,12 +643,12 @@ bool EditorData::check_and_update_scene(int p_idx) {
}
}
- new_scene->set_filename(edited_scene[p_idx].root->get_filename());
+ new_scene->set_scene_file_path(edited_scene[p_idx].root->get_scene_file_path());
memdelete(edited_scene[p_idx].root);
edited_scene.write[p_idx].root = new_scene;
- if (new_scene->get_filename() != "") {
- edited_scene.write[p_idx].path = new_scene->get_filename();
+ if (new_scene->get_scene_file_path() != "") {
+ edited_scene.write[p_idx].path = new_scene->get_scene_file_path();
}
edited_scene.write[p_idx].selection = new_selection;
@@ -682,10 +682,10 @@ void EditorData::set_edited_scene_root(Node *p_root) {
ERR_FAIL_INDEX(current_edited_scene, edited_scene.size());
edited_scene.write[current_edited_scene].root = p_root;
if (p_root) {
- if (p_root->get_filename() != "") {
- edited_scene.write[current_edited_scene].path = p_root->get_filename();
+ if (p_root->get_scene_file_path() != "") {
+ edited_scene.write[current_edited_scene].path = p_root->get_scene_file_path();
} else {
- p_root->set_filename(edited_scene[current_edited_scene].path);
+ p_root->set_scene_file_path(edited_scene[current_edited_scene].path);
}
}
@@ -764,7 +764,7 @@ Ref<Script> EditorData::get_scene_root_script(int p_idx) const {
Ref<Script> s = edited_scene[p_idx].root->get_script();
if (!s.is_valid() && edited_scene[p_idx].root->get_child_count()) {
Node *n = edited_scene[p_idx].root->get_child(0);
- while (!s.is_valid() && n && n->get_filename() == String()) {
+ while (!s.is_valid() && n && n->get_scene_file_path() == String()) {
s = n->get_script();
n = n->get_parent();
}
@@ -777,11 +777,11 @@ String EditorData::get_scene_title(int p_idx, bool p_always_strip_extension) con
if (!edited_scene[p_idx].root) {
return TTR("[empty]");
}
- if (edited_scene[p_idx].root->get_filename() == "") {
+ if (edited_scene[p_idx].root->get_scene_file_path() == "") {
return TTR("[unsaved]");
}
- const String filename = edited_scene[p_idx].root->get_filename().get_file();
+ const String filename = edited_scene[p_idx].root->get_scene_file_path().get_file();
const String basename = filename.get_basename();
if (p_always_strip_extension) {
@@ -795,7 +795,7 @@ String EditorData::get_scene_title(int p_idx, bool p_always_strip_extension) con
continue;
}
- if (edited_scene[i].root && basename == edited_scene[i].root->get_filename().get_file().get_basename()) {
+ if (edited_scene[i].root && basename == edited_scene[i].root->get_scene_file_path().get_file().get_basename()) {
return filename;
}
}
@@ -811,17 +811,17 @@ void EditorData::set_scene_path(int p_idx, const String &p_path) {
if (!edited_scene[p_idx].root) {
return;
}
- edited_scene[p_idx].root->set_filename(p_path);
+ edited_scene[p_idx].root->set_scene_file_path(p_path);
}
String EditorData::get_scene_path(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), String());
if (edited_scene[p_idx].root) {
- if (edited_scene[p_idx].root->get_filename() == "") {
- edited_scene[p_idx].root->set_filename(edited_scene[p_idx].path);
+ if (edited_scene[p_idx].root->get_scene_file_path() == "") {
+ edited_scene[p_idx].root->set_scene_file_path(edited_scene[p_idx].path);
} else {
- return edited_scene[p_idx].root->get_filename();
+ return edited_scene[p_idx].root->get_scene_file_path();
}
}
@@ -1105,8 +1105,8 @@ Array EditorSelection::_get_transformable_selected_nodes() {
TypedArray<Node> EditorSelection::get_selected_nodes() {
TypedArray<Node> ret;
- for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) {
- ret.push_back(E->key());
+ for (const KeyValue<Node *, Object *> &E : selection) {
+ ret.push_back(E.key);
}
return ret;
@@ -1133,8 +1133,8 @@ void EditorSelection::_update_nl() {
selected_node_list.clear();
- for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) {
- Node *parent = E->key();
+ for (const KeyValue<Node *, Object *> &E : selection) {
+ Node *parent = E.key;
parent = parent->get_parent();
bool skip = false;
while (parent) {
@@ -1148,7 +1148,7 @@ void EditorSelection::_update_nl() {
if (skip) {
continue;
}
- selected_node_list.push_back(E->key());
+ selected_node_list.push_back(E.key);
}
nl_changed = true;
@@ -1183,8 +1183,8 @@ List<Node *> &EditorSelection::get_selected_node_list() {
List<Node *> EditorSelection::get_full_selected_node_list() {
List<Node *> node_list;
- for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) {
- node_list.push_back(E->key());
+ for (const KeyValue<Node *, Object *> &E : selection) {
+ node_list.push_back(E.key);
}
return node_list;