You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-29 16:16:38 +00:00
Project Manager: Fix and improve unhandled input
(cherry picked from commit f3a75a42dd)
This commit is contained in:
committed by
Rémi Verschelde
parent
36eeedb357
commit
d853eb2fb7
@@ -599,6 +599,10 @@ void ProjectManager::_unhandled_input(const InputEvent& p_ev) {
|
||||
|
||||
switch (k.scancode) {
|
||||
|
||||
case KEY_RETURN: {
|
||||
|
||||
_open_project();
|
||||
} break;
|
||||
case KEY_HOME: {
|
||||
|
||||
for (int i=0; i<scroll_childs->get_child_count(); i++) {
|
||||
@@ -608,6 +612,7 @@ void ProjectManager::_unhandled_input(const InputEvent& p_ev) {
|
||||
selected_list.clear();
|
||||
selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene"));
|
||||
scroll->set_v_scroll(0);
|
||||
_update_project_buttons();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -622,6 +627,7 @@ void ProjectManager::_unhandled_input(const InputEvent& p_ev) {
|
||||
selected_list.clear();
|
||||
selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene"));
|
||||
scroll->set_v_scroll(scroll_childs->get_size().y);
|
||||
_update_project_buttons();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -652,6 +658,8 @@ void ProjectManager::_unhandled_input(const InputEvent& p_ev) {
|
||||
if (offset_diff > 0)
|
||||
scroll->set_v_scroll(scroll->get_v_scroll() - offset_diff);
|
||||
|
||||
_update_project_buttons();
|
||||
|
||||
break;
|
||||
|
||||
} else if (current==selected_list.back()->key()) {
|
||||
@@ -688,6 +696,8 @@ void ProjectManager::_unhandled_input(const InputEvent& p_ev) {
|
||||
if (offset_diff > 0)
|
||||
scroll->set_v_scroll(scroll->get_v_scroll() + offset_diff);
|
||||
|
||||
_update_project_buttons();
|
||||
|
||||
break;
|
||||
|
||||
} else if (current==selected_list.back()->key()) {
|
||||
@@ -708,12 +718,6 @@ void ProjectManager::_unhandled_input(const InputEvent& p_ev) {
|
||||
|
||||
if (scancode_handled) {
|
||||
accept_event();
|
||||
|
||||
for(int i=0;i<scroll_childs->get_child_count();i++) {
|
||||
CanvasItem *item = scroll_childs->get_child(i)->cast_to<CanvasItem>();
|
||||
if (item)
|
||||
item->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -937,7 +941,7 @@ void ProjectManager::_open_project() {
|
||||
}
|
||||
|
||||
if (selected_list.size()>1) {
|
||||
multi_open_ask->set_text(TTR("Are you sure to open more than one projects?"));
|
||||
multi_open_ask->set_text(TTR("Are you sure to open more than one project?"));
|
||||
multi_open_ask->popup_centered_minsize();
|
||||
} else {
|
||||
_open_project_confirm();
|
||||
@@ -977,7 +981,7 @@ void ProjectManager::_run_project() {
|
||||
}
|
||||
|
||||
if (selected_list.size()>1) {
|
||||
multi_run_ask->set_text(TTR("Are you sure to run more than one projects?"));
|
||||
multi_run_ask->set_text(TTR("Are you sure to run more than one project?"));
|
||||
multi_run_ask->popup_centered_minsize();
|
||||
} else {
|
||||
_run_project_confirm();
|
||||
|
||||
Reference in New Issue
Block a user