summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorPeace Sells <PeaceSells50@gmail.com>2015-09-07 19:55:47 -0600
committerPeace Sells <PeaceSells50@gmail.com>2015-09-07 19:55:47 -0600
commitfca36207e34e908a580a7f7277f7519f39d3fbda (patch)
tree369db13bf017b940380d77614faea81755104f30 /tools/editor
parentb0aa49accbd7e45dae38f1bd43b0fbdd11714211 (diff)
Fixed bug with adding an instance from the FIleSystem dialog.
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/scenes_dock.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index 7d9c5b24b2..dfd729354d 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -352,10 +352,30 @@ String ScenesDock::get_selected_path() const {
void ScenesDock::_instance_pressed() {
- TreeItem *sel = tree->get_selected();
- if (!sel)
- return;
- String path = sel->get_metadata(0);
+ if (tree_mode)
+ {
+ TreeItem *sel = tree->get_selected();
+ if (!sel)
+ return;
+ String path = sel->get_metadata(0);
+ }
+ else
+ {
+ int idx = -1;
+ for (int i = 0; i<files->get_item_count(); i++) {
+ if (files->is_selected(i))
+ {
+ idx = i;
+ break;
+ }
+ }
+
+ if (idx<0)
+ return;
+
+ path = files->get_item_metadata(idx);
+ }
+
emit_signal("instance",path);
}