summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-05-17 17:24:36 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-05-17 17:24:36 +0200
commit8cb2e1be1b7ffb6a3a5de93b67373f1736beb2da (patch)
treef796fdf720019dc1943dfda94dba1b5164ebe265
parent10e6525a10cdd652affa47c92f0046b8204d772f (diff)
parent3dd722d92f2c8a750065e23188c0cd7fba4fb2d7 (diff)
Merge pull request #4690 from volzhs/dnd-visual
Scenetree Nodes drag and drop visual representation
-rw-r--r--tools/editor/scene_tree_editor.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index f14876e023..be1fec904f 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -834,15 +834,22 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2& p_point,Control* p_from)
VBoxContainer *vb = memnew( VBoxContainer );
Array objs;
+ int list_max = 10;
+ float opacity_step = 1.0f / list_max;
+ float opacity_item = 1.0f;
for(int i=0;i<selected.size();i++) {
- HBoxContainer *hb = memnew( HBoxContainer );
- TextureFrame *tf = memnew(TextureFrame);
- tf->set_texture(icons[i]);
- hb->add_child(tf);
- Label *label = memnew( Label( selected[i]->get_name() ) );
- hb->add_child(label);
- vb->add_child(hb);
+ if (i<list_max){
+ HBoxContainer *hb = memnew( HBoxContainer );
+ TextureFrame *tf = memnew(TextureFrame);
+ tf->set_texture(icons[i]);
+ hb->add_child(tf);
+ Label *label = memnew( Label( selected[i]->get_name() ) );
+ hb->add_child(label);
+ vb->add_child(hb);
+ hb->set_opacity(opacity_item);
+ opacity_item -= opacity_step;
+ }
NodePath p = selected[i]->get_path();
objs.push_back(p);
}