Skip to content

Commit

Permalink
Fix for godotengine#12544, allowing objects to be automatically selec…
Browse files Browse the repository at this point in the history
…ted in the scene hierarchy when navigating with arrow keys through the scene tree.
  • Loading branch information
TheSofox committed Nov 10, 2017
1 parent 192a4d7 commit 300264a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2095,11 +2095,14 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {

if (select_mode == SELECT_MULTI) {

int col = selected_col < 0 ? 0 : selected_col;
while (next && !next->cells[col].selectable)
next = next->get_next_visible();
if (!next)
EXIT_BREAK;

selected_item = next;
emit_signal("cell_selected");
select_single_item(next, get_root(), col);

update();
} else {

Expand Down Expand Up @@ -2188,10 +2191,13 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {

if (select_mode == SELECT_MULTI) {

int col = selected_col < 0 ? 0 : selected_col;
while (prev && !prev->cells[col].selectable)
prev = prev->get_prev_visible();
if (!prev)
break;
selected_item = prev;
emit_signal("cell_selected");
break; // do nothing..
select_single_item(prev, get_root(), col);

update();
} else {

Expand Down

0 comments on commit 300264a

Please sign in to comment.