diff options
Diffstat (limited to 'tools/editor/editor_settings.cpp')
-rw-r--r-- | tools/editor/editor_settings.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 1cdc426541..f504bfc5af 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -655,6 +655,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { set("run/auto_save/save_before_running",true); set("run/output/always_clear_output_on_play",true); set("run/output/always_open_output_on_play",true); + set("run/output/always_close_output_on_stop",false); set("filesystem/resources/save_compressed_resources",true); set("filesystem/resources/auto_reload_modified_images",true); @@ -1029,26 +1030,22 @@ void EditorSettings::set_optimize_save(bool p_optimize) { optimize_save=p_optimize; } -String EditorSettings::get_last_selected_language() -{ +Variant EditorSettings::get_project_metadata(const String& p_section, const String& p_key, Variant p_default) { Ref<ConfigFile> cf = memnew( ConfigFile ); String path = get_project_settings_path().plus_file("project_metadata.cfg"); Error err = cf->load(path); if (err != OK) { - return ""; + return p_default; } - Variant last_selected_language = cf->get_value("script_setup", "last_selected_language"); - if (last_selected_language.get_type() != Variant::STRING) - return ""; - return static_cast<String>(last_selected_language); + return cf->get_value(p_section, p_key, p_default); } -void EditorSettings::set_last_selected_language(String p_language) +void EditorSettings::set_project_metadata(const String& p_section, const String& p_key, Variant p_data) { Ref<ConfigFile> cf = memnew( ConfigFile ); String path = get_project_settings_path().plus_file("project_metadata.cfg"); cf->load(path); - cf->set_value("script_setup", "last_selected_language", p_language); + cf->set_value(p_section, p_key, p_data); cf->save(path); } |