summaryrefslogtreecommitdiff
path: root/editor/editor_data.cpp
diff options
context:
space:
mode:
authorJakub Grzesik <kubecz3k@gmail.com>2017-07-06 09:18:20 +0200
committerJakub Grzesik <kubecz3k@gmail.com>2017-07-18 17:48:19 +0200
commit708d8250011dad02fd7d3651eb057bdd9e52fb7f (patch)
tree7e78acb79d4cd57cdc5c182edfe94ed7216a5af3 /editor/editor_data.cpp
parent0ee47fefbe4f746d6e00e863e4523398365b4e47 (diff)
Make available more informations about editor for Tool Plugins
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r--editor/editor_data.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 58ffa223fb..11b900f45c 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -353,6 +353,7 @@ void EditorData::notify_edited_scene_changed() {
for (int i = 0; i < editor_plugins.size(); i++) {
editor_plugins[i]->edited_scene_changed();
+ editor_plugins[i]->notify_scene_changed(get_edited_scene_root());
}
}
@@ -488,8 +489,14 @@ void EditorData::move_edited_scene_index(int p_idx, int p_to_idx) {
}
void EditorData::remove_scene(int p_idx) {
ERR_FAIL_INDEX(p_idx, edited_scene.size());
- if (edited_scene[p_idx].root)
+ 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());
+ }
+
memdelete(edited_scene[p_idx].root);
+ }
if (current_edited_scene > p_idx)
current_edited_scene--;
@@ -615,6 +622,17 @@ int EditorData::get_edited_scene_count() const {
return edited_scene.size();
}
+Vector<EditorData::EditedScene> EditorData::get_edited_scenes() const {
+
+ Vector<EditedScene> out_edited_scenes_list = Vector<EditedScene>();
+
+ for (int i = 0; i < edited_scene.size(); i++) {
+ out_edited_scenes_list.push_back(edited_scene[i]);
+ }
+
+ return out_edited_scenes_list;
+}
+
void EditorData::set_edited_scene_version(uint64_t version, int scene_idx) {
ERR_FAIL_INDEX(current_edited_scene, edited_scene.size());
if (scene_idx < 0) {