1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Merge pull request #64637 from Calinou/default-project-icon-use-svg

Create a SVG default project icon in new projects
This commit is contained in:
Yuri Sizov
2022-08-23 17:52:32 +03:00
committed by GitHub
4 changed files with 20 additions and 12 deletions

View File

@@ -484,12 +484,20 @@ private:
project_features.sort();
initial_settings["application/config/features"] = project_features;
initial_settings["application/config/name"] = project_name->get_text().strip_edges();
initial_settings["application/config/icon"] = "res://icon.png";
initial_settings["application/config/icon"] = "res://icon.svg";
if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("project.godot"), initial_settings, Vector<String>(), false) != OK) {
set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR);
} else {
ResourceSaver::save(create_unscaled_default_project_icon(), dir.plus_file("icon.png"));
// Store default project icon in SVG format.
Error err;
Ref<FileAccess> fa_icon = FileAccess::open(dir.plus_file("icon.svg"), FileAccess::WRITE, &err);
fa_icon->store_string(get_default_project_icon());
if (err != OK) {
set_message(TTR("Couldn't create icon.svg in project path."), MESSAGE_ERROR);
}
EditorVCSInterface::create_vcs_metadata_files(EditorVCSInterface::VCSMetadata(vcs_metadata_selection->get_selected()), dir);
}
} else if (mode == MODE_INSTALL) {