Merge pull request #28954 from bruvzg/macos_user_icns
Allow using user provided `.icns` files for exported app icons.
This commit is contained in:
commit
40a5f81ae5
|
@ -121,7 +121,7 @@ void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options)
|
||||||
|
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name"), ""));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name"), ""));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine"));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine"));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.png"), ""));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.png,*.icns"), ""));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier", PROPERTY_HINT_PLACEHOLDER_TEXT, "com.example.game"), ""));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier", PROPERTY_HINT_PLACEHOLDER_TEXT, "com.example.game"), ""));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), ""));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), ""));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0"));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0"));
|
||||||
|
@ -542,6 +542,15 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
||||||
iconpath = ProjectSettings::get_singleton()->get("application/config/icon");
|
iconpath = ProjectSettings::get_singleton()->get("application/config/icon");
|
||||||
|
|
||||||
if (iconpath != "") {
|
if (iconpath != "") {
|
||||||
|
if (iconpath.get_extension() == "icns") {
|
||||||
|
FileAccess *icon = FileAccess::open(iconpath, FileAccess::READ);
|
||||||
|
if (icon) {
|
||||||
|
data.resize(icon->get_len());
|
||||||
|
icon->get_buffer(&data.write[0], icon->get_len());
|
||||||
|
icon->close();
|
||||||
|
memdelete(icon);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Ref<Image> icon;
|
Ref<Image> icon;
|
||||||
icon.instance();
|
icon.instance();
|
||||||
icon->load(iconpath);
|
icon->load(iconpath);
|
||||||
|
@ -549,6 +558,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
||||||
_make_icon(icon, data);
|
_make_icon(icon, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//bleh?
|
//bleh?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue