diff options
Diffstat (limited to 'editor/project_manager.cpp')
-rw-r--r-- | editor/project_manager.cpp | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 7ce4029476..095ec891cd 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -434,22 +434,22 @@ private: if (mode == MODE_RENAME) { - String dir = _test_path(); - if (dir == "") { + String dir2 = _test_path(); + if (dir2 == "") { set_message(TTR("Invalid project path (changed anything?)."), MESSAGE_ERROR); return; } ProjectSettings *current = memnew(ProjectSettings); - int err = current->setup(dir, ""); + int err = current->setup(dir2, ""); if (err != OK) { set_message(vformat(TTR("Couldn't load project.godot in project path (error %d). It may be missing or corrupted."), err), MESSAGE_ERROR); } else { ProjectSettings::CustomMap edited_settings; edited_settings["application/config/name"] = project_name->get_text(); - if (current->save_custom(dir.plus_file("project.godot"), edited_settings, Vector<String>(), true) != OK) { + if (current->save_custom(dir2.plus_file("project.godot"), edited_settings, Vector<String>(), true) != OK) { set_message(TTR("Couldn't edit project.godot in project path."), MESSAGE_ERROR); } } @@ -1136,7 +1136,7 @@ void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) { break; } - // else fallthrough to key_down + FALLTHROUGH; } case KEY_DOWN: { @@ -1422,6 +1422,7 @@ void ProjectManager::_on_projects_updated() { } void ProjectManager::_on_project_created(const String &dir) { + project_filter->clear(); bool has_already = false; for (int i = 0; i < scroll_children->get_child_count(); i++) { HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); @@ -1526,6 +1527,13 @@ void ProjectManager::_open_selected_projects_ask() { } int config_version = (int)cf->get_value("", "config_version", 0); + + // Check if the config_version property was empty or 0 + if (config_version == 0) { + ask_update_settings->set_text(vformat(TTR("The following project settings file does not specify the version of Godot through which it was created.\n\n%s\n\nIf you proceed with opening it, it will be converted to Godot's current configuration file format.\nWarning: You will not be able to open the project with previous versions of the engine anymore."), conf)); + ask_update_settings->popup_centered_minsize(); + return; + } // Check if we need to convert project settings from an earlier engine version if (config_version < ProjectSettings::CONFIG_VERSION) { ask_update_settings->set_text(vformat(TTR("The following project settings file was generated by an older engine version, and needs to be converted for this version:\n\n%s\n\nDo you want to convert it?\nWarning: You will not be able to open the project with previous versions of the engine anymore."), conf)); @@ -1888,13 +1896,12 @@ ProjectManager::ProjectManager() { Panel *panel = memnew(Panel); gui_base->add_child(panel); panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); + panel->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); VBoxContainer *vb = memnew(VBoxContainer); panel->add_child(vb); - vb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 20 * EDSCALE); - vb->set_margin(MARGIN_TOP, 4 * EDSCALE); - vb->set_margin(MARGIN_BOTTOM, -4 * EDSCALE); - vb->add_constant_override("separation", 15 * EDSCALE); + vb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8 * EDSCALE); + vb->add_constant_override("separation", 8 * EDSCALE); String cp; cp += 0xA9; @@ -1902,11 +1909,9 @@ ProjectManager::ProjectManager() { HBoxContainer *top_hb = memnew(HBoxContainer); vb->add_child(top_hb); - CenterContainer *ccl = memnew(CenterContainer); Label *l = memnew(Label); l->set_text(VERSION_NAME + String(" - ") + TTR("Project Manager")); - ccl->add_child(l); - top_hb->add_child(ccl); + top_hb->add_child(l); top_hb->add_spacer(); l = memnew(Label); String hash = String(VERSION_HASH); @@ -2053,6 +2058,8 @@ ProjectManager::ProjectManager() { settings_hb->set_h_grow_direction(Control::GROW_DIRECTION_BEGIN); language_btn = memnew(OptionButton); + language_btn->set_flat(true); + language_btn->set_focus_mode(Control::FOCUS_NONE); Vector<String> editor_languages; List<PropertyInfo> editor_settings_properties; @@ -2230,3 +2237,9 @@ ProjectListFilter::ProjectListFilter() { has_search_box = false; } + +void ProjectListFilter::clear() { + if (has_search_box) { + search_box->clear(); + } +} |