Fix prompt for empty project files when loaded

Fixes #25541
This commit is contained in:
Twarit 2019-02-02 06:34:50 +05:30
parent d8b702b566
commit 56f4d59962

View file

@ -1471,6 +1471,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));