diff options
| author | Dima Granetchi | 2016-07-31 01:04:16 +0300 |
|---|---|---|
| committer | Dima Granetchi | 2016-07-31 01:06:12 +0300 |
| commit | a1c0fdac9a4ec1e8c2097b457a52e568f983c7d0 (patch) | |
| tree | f384ce46cfae6333bca6bf64c25306b33d2238f2 /tools/editor/project_manager.cpp | |
| parent | 2b5198b23dde370563719f57d158f4f342263be2 (diff) | |
| download | godot-a1c0fdac9a4ec1e8c2097b457a52e568f983c7d0.tar.gz godot-a1c0fdac9a4ec1e8c2097b457a52e568f983c7d0.tar.zst godot-a1c0fdac9a4ec1e8c2097b457a52e568f983c7d0.zip | |
fix run button availability check
Diffstat (limited to 'tools/editor/project_manager.cpp')
| -rw-r--r-- | tools/editor/project_manager.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 28d9738fe..f885fbba0 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -518,23 +518,23 @@ void ProjectManager::_panel_draw(Node *p_hb) { void ProjectManager::_update_project_buttons() { - String single_selected = ""; - if (selected_list.size() == 1) { - single_selected = selected_list.front()->key(); - } - - single_selected_main = ""; for(int i=0;i<scroll_childs->get_child_count();i++) { + CanvasItem *item = scroll_childs->get_child(i)->cast_to<CanvasItem>(); item->update(); - - if (single_selected!="" && single_selected == item->get_meta("name")) - single_selected_main = item->get_meta("main_scene"); + } + + bool has_runnable_scene = false; + for (Map<String,String>::Element *E=selected_list.front(); E; E=E->next()) { + const String &selected_main = E->get(); + if (selected_main == "") continue; + has_runnable_scene = true; + break; } erase_btn->set_disabled(selected_list.size()<1); open_btn->set_disabled(selected_list.size()<1); - run_btn->set_disabled(selected_list.size()<1 || (selected_list.size()==1 && single_selected_main=="")); + run_btn->set_disabled(!has_runnable_scene); } void ProjectManager::_panel_input(const InputEvent& p_ev,Node *p_hb) { @@ -1072,7 +1072,6 @@ void ProjectManager::_erase_project_confirm() { EditorSettings::get_singleton()->save(); selected_list.clear(); last_clicked = ""; - single_selected_main=""; _load_recent_projects(); } |
